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

Update crates and remove dependency on node for building #573

Merged
merged 19 commits into from
Oct 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
16 changes: 15 additions & 1 deletion .pipelines/DSC-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ variables:
BuildConfiguration: 'release'
PackageRoot: '$(System.ArtifactsDirectory)/Packages'
# LinuxContainerImage: 'mcr.microsoft.com/onebranch/cbl-mariner/build:2.0'
LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest'
Codeql.TSAEnabled: true

resources:
repositories:
Expand Down Expand Up @@ -228,6 +228,7 @@ extends:
- job: BuildLinux
dependsOn: SetPackageVersion
variables:
LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
displayName: Linux-x64-gnu
Expand All @@ -252,11 +253,13 @@ extends:
- job: BuildLinuxArm64
dependsOn: SetPackageVersion
variables:
LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2004-arm64:latest'
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
displayName: Linux-ARM64-gnu
pool:
type: linux
hostArchitecture: arm64
steps:
- task: RustInstaller@1
inputs:
Expand All @@ -269,6 +272,9 @@ extends:
- pwsh: |
apt update
apt -y install gcc-aarch64-linux-gnu
if ((openssl version -d) -match 'OPENSSLDIR: "(?<dir>.*?)"') {
$env:OPENSSL_LIB_DIR = $matches['dir']
}
./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu
./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
Expand All @@ -278,6 +284,7 @@ extends:
- job: BuildLinuxMusl
dependsOn: SetPackageVersion
variables:
LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest'
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
displayName: Linux-x64-musl
Expand All @@ -304,11 +311,13 @@ extends:
- job: BuildLinuxArm64Musl
dependsOn: SetPackageVersion
variables:
LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2004-arm64:latest'
PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ]
ob_outputDirectory: '$(Build.ArtifactStagingDirectory)'
displayName: Linux-ARM64-musl
pool:
type: linux
hostArchitecture: arm64
steps:
- task: RustInstaller@1
inputs:
Expand All @@ -327,7 +336,12 @@ extends:
apt -y install llvm
apt -y install musl-tools
apt -y install gcc-multilib
apt -y install libssl-dev
apt -y install pkg-config
rustup default stable-aarch64-unknown-linux-musl
if ((openssl version -d) -match 'OPENSSLDIR: "(?<dir>.*?)"') {
$env:OPENSSL_LIB_DIR = $matches['dir']
}
./build.ps1 -Release -Architecture aarch64-unknown-linux-musl
./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-musl -Release
Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)"
Expand Down
48,625 changes: 48,625 additions & 0 deletions NOTICE.txt

Large diffs are not rendered by default.

25 changes: 23 additions & 2 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ param(
[switch]$SkipLinkCheck,
[switch]$UseX64MakeAppx,
[switch]$UseCratesIO,
[switch]$UpdateLockFile
[switch]$UpdateLockFile,
[switch]$Audit
)

if ($GetPackageVersion) {
Expand All @@ -32,6 +33,7 @@ $filesForWindowsPackage = @(
'echo.dsc.resource.json',
'assertion.dsc.resource.json',
'group.dsc.resource.json',
'NOTICE.txt',
'powershell.dsc.resource.json',
'psDscAdapter/',
'reboot_pending.dsc.resource.json',
Expand All @@ -53,6 +55,7 @@ $filesForLinuxPackage = @(
'apt.dsc.resource.json',
'apt.dsc.resource.sh',
'group.dsc.resource.json',
'NOTICE.txt',
'powershell.dsc.resource.json',
'psDscAdapter/',
'RunCommandOnSet.dsc.resource.json',
Expand All @@ -67,6 +70,7 @@ $filesForMacPackage = @(
'brew.dsc.resource.json',
'brew.dsc.resource.sh',
'group.dsc.resource.json',
'NOTICE.txt',
'powershell.dsc.resource.json',
'psDscAdapter/',
'RunCommandOnSet.dsc.resource.json',
Expand Down Expand Up @@ -222,7 +226,8 @@ if (!$SkipBuild) {
"runcommandonset",
"tools/dsctest",
"tools/test_group_resource",
"y2j"
"y2j",
"."
)
$pedantic_unclean_projects = @()
$clippy_unclean_projects = @("tree-sitter-dscexpression")
Expand Down Expand Up @@ -252,6 +257,14 @@ if (!$SkipBuild) {
cargo generate-lockfile
}
else {
if ($Audit) {
if ($null -eq (Get-Command cargo-audit -ErrorAction Ignore)) {
cargo install cargo-audit --features=fix
}

cargo audit fix
}

./build.ps1
}
}
Expand All @@ -276,6 +289,14 @@ if (!$SkipBuild) {
cargo generate-lockfile
}
else {
if ($Audit) {
if ($null -eq (Get-Command cargo-audit -ErrorAction Ignore)) {
cargo install cargo-audit --features=fix
}

cargo audit fix
}

cargo build @flags
}
}
Expand Down
1 change: 1 addition & 0 deletions copy_files.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NOTICE.txt
Loading
Loading