Skip to content

Build.sh --with-packages UX is broken with a fresh source tarball #2900

@MichaelSimons

Description

@MichaelSimons

Snippet from https://github.com/dotnet/installer/blob/main/src/SourceBuild/tarball/content/build.sh#L123

if [ -d "$SCRIPT_ROOT/packages/archive" ]; then
  sourceBuiltArchive=`find $SCRIPT_ROOT/packages/archive -maxdepth 1 -name 'Private.SourceBuilt.Artifacts*.tar.gz'`
  if [ -f "$SCRIPT_ROOT/packages/previously-source-built/PackageVersions.props" ]; then
    packageVersionsPath=$SCRIPT_ROOT/packages/previously-source-built/PackageVersions.props
  elif [ -f "$sourceBuiltArchive" ]; then
    tar -xzf "$sourceBuiltArchive" -C /tmp PackageVersions.props
    packageVersionsPath=/tmp/PackageVersions.props
  fi
elif [ -f "$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR/PackageVersions.props" ]; then
  packageVersionsPath="$CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR/PackageVersions.props"
fi

The problem with this logic is that the tarball comes with an empty $SCRIPT_ROOT/packages/archive directory. This means the elif will not get executed when the --with-packages option is specified which sets $CUSTOM_PREVIOUSLY_BUILT_PACKAGES_DIR. To workaround this you must manually delete the $SCRIPT_ROOT/packages/archive directory or copy your previous packages into it and not use the --with-packages option.

Metadata

Metadata

Assignees

Labels

area-product-experienceImprovements in the end-user's product experience

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions