diff --git a/eng/Version.Details.props b/eng/Version.Details.props index 1555baf43e1..b9029cf0cad 100644 --- a/eng/Version.Details.props +++ b/eng/Version.Details.props @@ -6,32 +6,32 @@ This file should be imported by eng/Versions.props - 11.0.0-beta.26276.113 - 11.0.0-beta.26276.113 - 11.0.0-beta.26276.113 - 11.0.0-beta.26276.113 - 11.0.0-beta.26276.113 - 11.0.0-beta.26276.113 - 11.0.0-beta.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 - 11.0.0-preview.5.26276.113 + 11.0.0-beta.26277.111 + 11.0.0-beta.26277.111 + 11.0.0-beta.26277.111 + 11.0.0-beta.26277.111 + 11.0.0-beta.26277.111 + 11.0.0-beta.26277.111 + 11.0.0-beta.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 + 11.0.0-preview.6.26277.111 diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml index a7522000969..4e820d25695 100644 --- a/eng/Version.Details.xml +++ b/eng/Version.Details.xml @@ -6,114 +6,114 @@ Note: if the Uri is a new place, you will need to add a subscription from that p And you can check these with "darc get-dependencies target-repo "winforms" --> - + - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 - + https://github.com/dotnet/dotnet - 1458981aa05717a57476cbef8ec76f066f70fcb5 + 6ca055abbe0f7c50651e7768c3f466ef07907dc8 diff --git a/eng/Versions.props b/eng/Versions.props index b2b5629acf2..83714a95f89 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -7,7 +7,7 @@ 0 0 preview - 5 + 6 $(MajorVersion).$(MinorVersion).$(PatchVersion) diff --git a/eng/common/build.ps1 b/eng/common/build.ps1 index 18397a60eb8..4b4f6b0923f 100644 --- a/eng/common/build.ps1 +++ b/eng/common/build.ps1 @@ -24,6 +24,7 @@ Param( [switch][Alias('pb')]$productBuild, [switch]$fromVMR, [switch][Alias('bl')]$binaryLog, + [string][Alias('bln')]$binaryLogName = '', [switch][Alias('nobl')]$excludeCIBinarylog, [switch] $ci, [switch] $prepareMachine, @@ -46,6 +47,7 @@ function Print-Usage() { Write-Host " -platform Platform configuration: 'x86', 'x64' or any valid Platform value to pass to msbuild" Write-Host " -verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" Write-Host " -binaryLog Output binary log (short: -bl)" + Write-Host " -binaryLogName Binary log file name or path; implies -binaryLog (short: -bln)" Write-Host " -help Print help and exit" Write-Host "" @@ -102,7 +104,19 @@ function Build { $toolsetBuildProj = InitializeToolset InitializeCustomToolset - $bl = if ($binaryLog) { '/bl:' + (Join-Path $LogDir 'Build.binlog') } else { '' } + $bl = '' + if ($binaryLog) { + $binaryLogPath = if ([string]::IsNullOrEmpty($binaryLogName)) { + Join-Path $LogDir 'Build.binlog' + } elseif ([System.IO.Path]::IsPathRooted($binaryLogName)) { + $binaryLogName + } else { + Join-Path $LogDir $binaryLogName + } + + Create-Directory (Split-Path -Parent $binaryLogPath) + $bl = '/bl:' + $binaryLogPath + } $platformArg = if ($platform) { "/p:Platform=$platform" } else { '' } $check = if ($buildCheck) { '/check' } else { '' } @@ -162,6 +176,10 @@ try { $nodeReuse = $false } + if (-not [string]::IsNullOrEmpty($binaryLogName)) { + $binaryLog = $true + } + if ($nativeToolsOnMachine) { $env:NativeToolsOnMachine = $true } diff --git a/eng/common/build.sh b/eng/common/build.sh index 74605d2effd..719ee4b5874 100755 --- a/eng/common/build.sh +++ b/eng/common/build.sh @@ -13,6 +13,7 @@ usage() echo " --configuration Build configuration: 'Debug' or 'Release' (short: -c)" echo " --verbosity Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" echo " --binaryLog Create MSBuild binary log (short: -bl)" + echo " --binaryLogName Binary log file name or path; implies --binaryLog (short: -bln)" echo " --help Print help and exit (short: -h)" echo "" @@ -83,6 +84,7 @@ warn_not_as_error='' node_reuse=true build_check=false binary_log=false +binary_log_name='' exclude_ci_binary_log=false projects='' @@ -114,6 +116,11 @@ while [[ $# -gt 0 ]]; do -binarylog|-bl) binary_log=true ;; + -binarylogname|-bln) + binary_log=true + binary_log_name=$2 + shift + ;; -excludecibinarylog|-nobl) exclude_ci_binary_log=true ;; @@ -232,7 +239,17 @@ function Build { local bl="" if [[ "$binary_log" == true ]]; then - bl="/bl:\"$log_dir/Build.binlog\"" + local binary_log_path="" + if [[ -z "$binary_log_name" ]]; then + binary_log_path="$log_dir/Build.binlog" + elif [[ "$binary_log_name" = /* ]]; then + binary_log_path="$binary_log_name" + else + binary_log_path="$log_dir/$binary_log_name" + fi + + mkdir -p "$(dirname "$binary_log_path")" + bl="/bl:\"$binary_log_path\"" fi local check="" diff --git a/eng/common/core-templates/job/helix-job-monitor.yml b/eng/common/core-templates/job/helix-job-monitor.yml new file mode 100644 index 00000000000..767450da2fc --- /dev/null +++ b/eng/common/core-templates/job/helix-job-monitor.yml @@ -0,0 +1,217 @@ +parameters: +# Maximum run time of the monitor job in minutes. Also used for --max-wait-minutes. +- name: timeoutInMinutes + type: number + default: 360 + +# Owner segment of the source repository (e.g. 'dotnet' for 'dotnet/runtime') passed via --organization. +# Defaults to the owner segment of BUILD_REPOSITORY_NAME when empty. +- name: organization + type: string + default: '' + +# Name of the source repository (e.g. 'runtime' for 'dotnet/runtime') passed via --repository. +# Defaults to the repo segment of BUILD_REPOSITORY_NAME when empty. +- name: repository + type: string + default: '' + +# Optional dependency list for the generated job. +- name: dependsOn + type: object + default: [] + +# Optional condition for the generated job. +- name: condition + type: string + default: '' + +# NuGet package id of the Helix job monitor tool. +- name: toolPackageId + type: string + default: Microsoft.DotNet.Helix.JobMonitor + +# Console command exposed by the installed tool package. +- name: toolCommand + type: string + default: dotnet-helix-job-monitor + +# Optional explicit tool version. Only honored when 'toolNupkgArtifactName' is set; in the +# default code path the version is taken from the consuming repo's .config/dotnet-tools.json. +- name: toolVersion + type: string + default: '' + +# Base URI for the Helix service (--helix-base-uri). +- name: helixBaseUri + type: string + default: https://helix.dot.net/ + +# Helix API access token forwarded to the tool via the HELIX_ACCESSTOKEN environment variable. +- name: helixAccessToken + type: string + default: '' + +# Polling interval in seconds (--polling-interval-seconds). +- name: pollingIntervalSeconds + type: number + default: 30 + +# Advanced: optional pipeline artifact (produced earlier in this run) that contains the tool +# nupkg. When set, the artifact is downloaded and the tool is installed from the nupkg into +# a local tool-path; this bypasses the repo's .config/dotnet-tools.json manifest and is +# primarily intended for the Arcade repository itself, where the Helix job monitor tool is +# built in the same pipeline that runs this template. +# +# When this parameter is empty (the default), the consuming repository must declare the tool +# in its .config/dotnet-tools.json manifest (alongside other local .NET tools); the template +# will check out the repo and run 'dotnet tool restore' to install the version pinned there. +- name: toolNupkgArtifactName + type: string + default: '' + +# Advanced: sub-path within the downloaded artifact where the tool nupkg is located. Defaults +# to the standard Arcade non-shipping packages location for a Release build (relative to the +# pipeline artifact root, which is itself the build's 'artifacts' directory). +- name: toolNupkgArtifactSubPath + type: string + default: 'packages/Release/NonShipping' + +jobs: +- job: HelixJobMonitor + displayName: Monitor Helix Jobs + timeoutInMinutes: ${{ parameters.timeoutInMinutes }} + ${{ if ne(length(parameters.dependsOn), 0) }}: + dependsOn: ${{ parameters.dependsOn }} + ${{ if ne(parameters.condition, '') }}: + condition: ${{ parameters.condition }} + pool: + ${{ if eq(variables['System.TeamProject'], 'public') }}: + name: $(DncEngPublicBuildPool) + demands: ImageOverride -equals build.azurelinux.3.amd64.open + ${{ else }}: + name: $(DncEngInternalBuildPool) + demands: ImageOverride -equals build.azurelinux.3.amd64 + steps: + - checkout: self + fetchDepth: 1 + + - ${{ if ne(parameters.toolNupkgArtifactName, '') }}: + - task: DownloadPipelineArtifact@2 + displayName: Download Helix Job Monitor artifact + inputs: + buildType: current + artifactName: ${{ parameters.toolNupkgArtifactName }} + itemPattern: '${{ parameters.toolNupkgArtifactSubPath }}/${{ parameters.toolPackageId }}.*.nupkg' + targetPath: $(Agent.TempDirectory)/helix-job-monitor-nupkg + + - bash: | + set -euo pipefail + + toolPath="$AGENT_TEMPDIRECTORY/helix-job-monitor-tool" + mkdir -p "$toolPath" + + packageId='${{ parameters.toolPackageId }}' + toolVersion='${{ parameters.toolVersion }}' + nupkgArtifactSubPath='${{ parameters.toolNupkgArtifactSubPath }}' + nupkgDir="$AGENT_TEMPDIRECTORY/helix-job-monitor-nupkg/$nupkgArtifactSubPath" + + if [ ! -d "$nupkgDir" ]; then + echo "Expected nupkg directory '$nupkgDir' was not produced by the artifact download." >&2 + exit 1 + fi + + nupkg=$(find "$nupkgDir" -maxdepth 1 -type f -name "$packageId.*.nupkg" | head -n 1) + if [ -z "$nupkg" ]; then + echo "No '$packageId.*.nupkg' found in '$nupkgDir'." >&2 + exit 1 + fi + + # Derive the version from the nupkg filename so the local package is selected + # deterministically instead of resolving against any other configured feed. + nupkgBase=$(basename "$nupkg" .nupkg) + derivedVersion="${nupkgBase#${packageId}.}" + if [ -z "$toolVersion" ]; then + toolVersion="$derivedVersion" + fi + + echo "Using locally built '$packageId' version '$toolVersion' from '$nupkgDir'." + + # Create a minimal NuGet.config that only references the local nupkg directory. + # This avoids conflicts with the repo's package source mapping which blocks --add-source. + toolNugetConfig="$AGENT_TEMPDIRECTORY/helix-job-monitor-nuget.config" + printf '\n\n \n \n \n \n\n' "$nupkgDir" > "$toolNugetConfig" + + pushd "$(Build.SourcesDirectory)" > /dev/null + ./eng/common/dotnet.sh tool install \ + --tool-path "$toolPath" "$packageId" \ + --version "$toolVersion" \ + --configfile "$toolNugetConfig" + + # Locate the tool DLL so the run step can invoke it via ./eng/common/dotnet.sh exec. + toolDll=$(find "$toolPath/.store" -path '*/tools/*/any/*.deps.json' -type f | head -n 1) + toolDll="${toolDll%.deps.json}.dll" + if [ ! -f "$toolDll" ]; then + echo "Could not find tool DLL in '$toolPath/.store'." >&2 + exit 1 + fi + + echo "Tool DLL: $toolDll" + echo "##vso[task.setvariable variable=HelixJobMonitorDll]$toolDll" + displayName: Install Helix Job Monitor + + - ${{ else }}: + - bash: ./eng/common/dotnet.sh tool restore + displayName: Restore Helix Job Monitor + + - bash: | + set -euo pipefail + + toolArgs=( + --helix-base-uri '${{ parameters.helixBaseUri }}' + --polling-interval-seconds '${{ parameters.pollingIntervalSeconds }}' + --max-wait-minutes "$((${{ parameters.timeoutInMinutes }} - 2))" # Set the tool's timeout slightly lower than the Azure DevOps job timeout to allow it to exit gracefully. + --stage-name '$(System.StageName)' + ) + + organization='${{ parameters.organization }}' + repository='${{ parameters.repository }}' + + # Fall back to Azure DevOps-provided environment variables when the caller did not + # supply organization / repository explicitly. BUILD_REPOSITORY_NAME is typically + # 'owner/repo' for GitHub-backed builds. + if [ -z "$organization" ] || [ -z "$repository" ]; then + buildRepoName="${BUILD_REPOSITORY_NAME:-}" + if [ -n "$buildRepoName" ] && [[ "$buildRepoName" == */* ]]; then + repoOwner="${buildRepoName%%/*}" + repoName="${buildRepoName#*/}" + if [ -z "$organization" ]; then organization="$repoOwner"; fi + if [ -z "$repository" ]; then repository="$repoName"; fi + fi + fi + + if [ -n "$organization" ]; then toolArgs+=( --organization "$organization" ); fi + if [ -n "$repository" ]; then toolArgs+=( --repository "$repository" ); fi + + # Build.Reason and Build.SourceBranch are required to derive the Helix source filter + # the same way the Helix SDK submitter does (PR -> 'pr', internal -> 'official', + # otherwise -> 'ci'). Without these, manually-queued / scheduled / CI builds would + # be looked up under the wrong source prefix and find zero jobs. + toolArgs+=( --build-reason "$(Build.Reason)" ) + toolArgs+=( --source-branch "$(Build.SourceBranch)" ) + + if [ -n '${{ parameters.toolNupkgArtifactName }}' ]; then + # Tool was installed from a local nupkg; run the DLL via the repo-local dotnet. + export DOTNET_ROOT="$(Build.SourcesDirectory)/.dotnet" + ./eng/common/dotnet.sh exec "$(HelixJobMonitorDll)" "${toolArgs[@]}" + else + # Tool was restored from the local .config/dotnet-tools.json manifest; invoke it + # through the manifest from the repo root. + pushd "$BUILD_SOURCESDIRECTORY" > /dev/null + trap 'popd > /dev/null' EXIT + ./eng/common/dotnet.sh tool run '${{ parameters.toolCommand }}' -- "${toolArgs[@]}" + fi + displayName: Monitor Helix Jobs + env: + SYSTEM_ACCESSTOKEN: $(System.AccessToken) + HELIX_ACCESSTOKEN: ${{ parameters.helixAccessToken }} diff --git a/eng/common/core-templates/steps/publish-logs.yml b/eng/common/core-templates/steps/publish-logs.yml index 5fc099a1143..648e6cfb115 100644 --- a/eng/common/core-templates/steps/publish-logs.yml +++ b/eng/common/core-templates/steps/publish-logs.yml @@ -33,7 +33,6 @@ steps: '$(publishing-dnceng-devdiv-code-r-build-re)' '$(dn-bot-all-orgs-artifact-feeds-rw)' '$(akams-client-id)' - '$(dnceng-symbol-server-pat)' '$(dn-bot-all-orgs-build-rw-code-rw)' '$(System.AccessToken)' ${{parameters.CustomSensitiveDataList}} diff --git a/eng/common/core-templates/steps/source-index-stage1-publish.yml b/eng/common/core-templates/steps/source-index-stage1-publish.yml index 3ad83b8c307..fdca622357f 100644 --- a/eng/common/core-templates/steps/source-index-stage1-publish.yml +++ b/eng/common/core-templates/steps/source-index-stage1-publish.yml @@ -1,15 +1,15 @@ parameters: - sourceIndexUploadPackageVersion: 2.0.0-20250906.1 - sourceIndexProcessBinlogPackageVersion: 1.0.1-20250906.1 + sourceIndexUploadPackageVersion: 2.0.0-20260521.2 + sourceIndexProcessBinlogPackageVersion: 1.0.1-20260521.2 sourceIndexPackageSource: https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json binlogPath: artifacts/log/Debug/Build.binlog steps: - task: UseDotNet@2 - displayName: "Source Index: Use .NET 9 SDK" + displayName: "Source Index: Use .NET 10 SDK" inputs: packageType: sdk - version: 9.0.x + version: 10.0.x installationPath: $(Agent.TempDirectory)/dotnet workingDirectory: $(Agent.TempDirectory) diff --git a/eng/common/cross/build-rootfs.sh b/eng/common/cross/build-rootfs.sh index cef5d2d6716..f06854ccc18 100755 --- a/eng/common/cross/build-rootfs.sh +++ b/eng/common/cross/build-rootfs.sh @@ -76,7 +76,7 @@ __AlpinePackages+=" openssl-dev" __AlpinePackages+=" zlib-dev" __FreeBSDBase="13.5-RELEASE" -__FreeBSDPkg="1.21.3" +__FreeBSDPkg="2.7.5" __FreeBSDABI="13" __FreeBSDPackages="libunwind" __FreeBSDPackages+=" icu" @@ -577,7 +577,7 @@ elif [[ "$__CodeName" == "freebsd" ]]; then ./autogen.sh && ./configure --prefix="$__RootfsDir"/host && make -j "$JOBS" && make install rm -rf "$__RootfsDir/tmp/pkg-${__FreeBSDPkg}" # install packages we need. - INSTALL_AS_USER=$(whoami) "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf update + INSTALL_AS_USER=$(whoami) IGNORE_OSVERSION=yes "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf update # shellcheck disable=SC2086 INSTALL_AS_USER=$(whoami) "$__RootfsDir"/host/sbin/pkg -r "$__RootfsDir" -C "$__RootfsDir"/usr/local/etc/pkg.conf install --yes $__FreeBSDPackages elif [[ "$__CodeName" == "openbsd" ]]; then diff --git a/eng/common/cross/install-debs.py b/eng/common/cross/install-debs.py index 100c4378da3..20ca770a1e2 100755 --- a/eng/common/cross/install-debs.py +++ b/eng/common/cross/install-debs.py @@ -328,7 +328,18 @@ def extract_deb_file(deb_file, tmp_dir, extract_dir, ar_tool): raise ValueError(f"Unsupported compression format: {file_extension}") with tarfile.open(tar_file_path, mode) as tar: - tar.extractall(path=extract_dir, filter='tar') + tar.extractall(path=extract_dir, filter=_rootfs_extraction_filter) + +def _rootfs_extraction_filter(member, dest_path): + """Tarfile extraction filter based on the 'data' filter that additionally + rewrites absolute-target symlinks/hardlinks into rootfs-relative paths. + """ + if (member.issym() or member.islnk()) and os.path.isabs(member.linkname): + link_dir = os.path.dirname(member.name) + new_linkname = os.path.relpath(member.linkname.lstrip('/'), + start=link_dir or '.') + member = member.replace(linkname=new_linkname, deep=False) + return tarfile.data_filter(member, dest_path) def finalize_setup(rootfsdir): lib_dir = os.path.join(rootfsdir, 'lib') diff --git a/global.json b/global.json index a726e806867..9ed4a828d84 100644 --- a/global.json +++ b/global.json @@ -24,11 +24,11 @@ "runner": "Microsoft.Testing.Platform" }, "msbuild-sdks": { - "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26276.113", - "Microsoft.DotNet.CMake.Sdk": "11.0.0-beta.26276.113", - "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.26276.113", + "Microsoft.DotNet.Arcade.Sdk": "11.0.0-beta.26277.111", + "Microsoft.DotNet.CMake.Sdk": "11.0.0-beta.26277.111", + "Microsoft.DotNet.Helix.Sdk": "11.0.0-beta.26277.111", "FIX-85B6-MERGE-9C38-CONFLICT": "1.0.0", - "Microsoft.NET.Sdk.IL": "11.0.0-preview.5.26276.113" + "Microsoft.NET.Sdk.IL": "11.0.0-preview.6.26277.111" }, "native-tools": { "cmake": "latest"