Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[main] Update dependencies from dotnet/arcade #618

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update dependencies from https://github.com/dotnet/arcade build 20250…
…106.1

Microsoft.SourceBuild.Intermediate.arcade , Microsoft.DotNet.Arcade.Sdk
 From Version 10.0.0-beta.24613.2 -> To Version 10.0.0-beta.25056.1
  • Loading branch information
dotnet-maestro[bot] committed Jan 6, 2025
commit b11ff9533e2264051d9c42ba1584328c7f98ca6c
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Dependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25053.3">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="10.0.0-beta.25056.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>05d4d46d438eec2d012a0dae7a9118e5fab947af</Sha>
<Sha>e58820063a8754d418518bce69ca2df0e3b4ac25</Sha>
</Dependency>
<!-- Intermediate is necessary for source build. -->
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="10.0.0-beta.25053.3">
<Dependency Name="Microsoft.SourceBuild.Intermediate.arcade" Version="10.0.0-beta.25056.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>05d4d46d438eec2d012a0dae7a9118e5fab947af</Sha>
<Sha>e58820063a8754d418518bce69ca2df0e3b4ac25</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<!-- Intermediate is necessary for source build. -->
6 changes: 6 additions & 0 deletions eng/common/core-templates/post-build/post-build.yml
Original file line number Diff line number Diff line change
@@ -44,6 +44,11 @@ parameters:
displayName: Publish installers and checksums
type: boolean
default: true

- name: requireDefaultChannels
displayName: Fail the build if there are no default channel(s) registrations for the current build
type: boolean
default: false

- name: SDLValidationParameters
type: object
@@ -312,5 +317,6 @@ stages:
-PublishingInfraVersion ${{ parameters.publishingInfraVersion }}
-AzdoToken '$(System.AccessToken)'
-WaitPublishingFinish true
-RequireDefaultChannels ${{ parameters.requireDefaultChannels }}
-ArtifactsPublishingAdditionalParameters '${{ parameters.artifactsPublishingAdditionalParameters }}'
-SymbolPublishingAdditionalParameters '${{ parameters.symbolPublishingAdditionalParameters }}'
2 changes: 1 addition & 1 deletion eng/common/cross/build-rootfs.sh
Original file line number Diff line number Diff line change
@@ -800,7 +800,7 @@ elif [[ -n "$__CodeName" ]]; then
PYTHON=${PYTHON_EXECUTABLE:-python3}

# shellcheck disable=SC2086,SC2046
echo running "$PYTHON" "$__CrossDir/install-debs.py" --arch "$__UbuntuArch" --rootfsdir "$__RootfsDir" --artool "$AR" \
echo running "$PYTHON" "$__CrossDir/install-debs.py" --arch "$__UbuntuArch" --mirror "$__UbuntuRepo" --rootfsdir "$__RootfsDir" --artool "$AR" \
$(echo $suites | xargs -n 1 | xargs -I {} echo -n "--suite {} ") \
$__UbuntuPackages

68 changes: 33 additions & 35 deletions eng/common/cross/install-debs.py
Original file line number Diff line number Diff line change
@@ -162,23 +162,35 @@ def parse_package_index(content):
packages = {}
aliases = {}
entries = re.split(r'\n\n+', content)

for entry in entries:
fields = dict(re.findall(r'^(\S+): (.+)$', entry, re.MULTILINE))
if "Package" in fields:
package_name = fields["Package"]
packages[package_name] = {
"Version": fields.get("Version"),
"Filename": fields.get("Filename"),
"Depends": fields.get("Depends")
}
if "Provides" in fields:
provides_list = [x.strip() for x in fields["Provides"].split(",")]
for alias in provides_list:
# strip version specifiers
alias_name = re.sub(r'\s*\(=.*\)', '', alias)
if alias_name not in aliases:
aliases[alias_name] = []
aliases[alias_name].append(package_name)
version = fields.get("Version")
filename = fields.get("Filename")
depends = fields.get("Depends")
provides = fields.get("Provides", None)

# Only update if package_name is not in packages or if the new version is higher
if package_name not in packages or compare_debian_versions(version, packages[package_name]["Version"]) > 0:
packages[package_name] = {
"Version": version,
"Filename": filename,
"Depends": depends
}

# Update aliases if package provides any alternatives
if provides:
provides_list = [x.strip() for x in provides.split(",")]
for alias in provides_list:
# Strip version specifiers
alias_name = re.sub(r'\s*\(=.*\)', '', alias)
if alias_name not in aliases:
aliases[alias_name] = []
if package_name not in aliases[alias_name]:
aliases[alias_name].append(package_name)

return packages, aliases

def install_packages(mirror, packages_info, aliases, tmp_dir, extract_dir, ar_tool, desired_packages):
@@ -189,27 +201,13 @@ def install_packages(mirror, packages_info, aliases, tmp_dir, extract_dir, ar_to
packages_to_download = {}

for pkg in resolved_packages:
available_versions = [pkg]
if pkg in packages_info:
packages_to_download[pkg] = packages_info[pkg]

if pkg in aliases:
available_versions.extend(aliases[pkg])

# Choose the package with the latest version
if available_versions:
best_package = max(
(p for p in available_versions if p in packages_info),
key=lambda p: (
1 if p == pkg else 0,
cmp_to_key(lambda p1, p2: compare_debian_versions(
packages_info[p1]["Version"],
packages_info[p2]["Version"]
))(p)
),
default=None
)

if best_package:
packages_to_download[best_package] = packages_info[best_package]
for alias in aliases[pkg]:
if alias in packages_info:
packages_to_download[alias] = packages_info[alias]

asyncio.run(download_deb_files_parallel(mirror, packages_to_download, tmp_dir))

@@ -225,11 +223,11 @@ def install_packages(mirror, packages_info, aliases, tmp_dir, extract_dir, ar_to
for pkg in reversed(resolved_packages):
deb_file = package_to_deb_file_map.get(pkg)
if deb_file and os.path.exists(deb_file):
extract_deb_file_using_dpkg(deb_file, tmp_dir, extract_dir, ar_tool)
extract_deb_file(deb_file, tmp_dir, extract_dir, ar_tool)

print("All done!")

def extract_deb_file_using_dpkg(deb_file, tmp_dir, extract_dir, ar_tool):
def extract_deb_file(deb_file, tmp_dir, extract_dir, ar_tool):
"""Extract .deb file contents"""

os.makedirs(extract_dir, exist_ok=True)
@@ -270,7 +268,7 @@ def extract_deb_file_using_dpkg(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=None)
tar.extractall(path=extract_dir, filter='fully_trusted')

def finalize_setup(rootfsdir):
lib_dir = os.path.join(rootfsdir, 'lib')
7 changes: 6 additions & 1 deletion eng/common/post-build/publish-using-darc.ps1
Original file line number Diff line number Diff line change
@@ -5,7 +5,8 @@ param(
[Parameter(Mandatory=$false)][string] $MaestroApiEndPoint = 'https://maestro.dot.net',
[Parameter(Mandatory=$true)][string] $WaitPublishingFinish,
[Parameter(Mandatory=$false)][string] $ArtifactsPublishingAdditionalParameters,
[Parameter(Mandatory=$false)][string] $SymbolPublishingAdditionalParameters
[Parameter(Mandatory=$false)][string] $SymbolPublishingAdditionalParameters,
[Parameter(Mandatory=$false)][string] $RequireDefaultChannels
)

try {
@@ -33,6 +34,10 @@ try {
if ("false" -eq $WaitPublishingFinish) {
$optionalParams.Add("--no-wait") | Out-Null
}

if ("true" -eq $RequireDefaultChannels) {
$optionalParams.Add("--default-channels-required") | Out-Null
}

& $darc add-build-to-channel `
--id $buildId `
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -7,6 +7,6 @@
"allowPrerelease": true
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25053.3"
"Microsoft.DotNet.Arcade.Sdk": "10.0.0-beta.25056.1"
}
}