From 50251e230c8d52617286dc8695d8980f832ef995 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Thu, 14 Aug 2025 13:14:33 -0700 Subject: [PATCH 1/9] change to use new repo --- .pipelines/DSC-Official.yml | 21 ++++++++++++++------- .pipelines/DSC-Windows.yml | 4 +++- 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.pipelines/DSC-Official.yml b/.pipelines/DSC-Official.yml index a4765ad65..057ad7775 100644 --- a/.pipelines/DSC-Official.yml +++ b/.pipelines/DSC-Official.yml @@ -8,10 +8,15 @@ pr: - release/v* variables: - BuildConfiguration: 'release' - PackageRoot: '$(System.ArtifactsDirectory)/Packages' - WindowsContainerImage: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' - Codeql.TSAEnabled: true + - name: BuildConfiguration + value: 'release' + - name: PackageRoot + value: '$(System.ArtifactsDirectory)/Packages' + - name: WindowsContainerImage + value: 'onebranch.azurecr.io/windows/ltsc2022/vse2022:latest' + - name: Codeql.TSAEnabled + value: true + - group: DSC-Rust.SDK resources: repositories: @@ -106,6 +111,7 @@ extends: signSrcPath: '$(signSrcPath)' PackageRoot: '$(PackageRoot)' token: '$(AzToken)' + rustSDK: $(Rust.SDK) - job: BuildWin_arm64 dependsOn: SetPackageVersion @@ -125,6 +131,7 @@ extends: signSrcPath: '$(signSrcPath)' PackageRoot: '$(PackageRoot)' token: '$(AzToken)' + rustSDK: $(Rust.SDK) - job: CreateMsixBundle dependsOn: @@ -208,7 +215,7 @@ extends: - task: RustInstaller@1 inputs: rustVersion: ms-stable - toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json + toolchainFeed: $(Rust.SDK) additionalTargets: x86_64-unknown-linux-musl displayName: Install Rust env: @@ -243,7 +250,7 @@ extends: - task: RustInstaller@1 inputs: rustVersion: ms-stable - toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json + toolchainFeed: $(Rust.SDK) additionalTargets: aarch64-unknown-linux-musl displayName: Install Rust env: @@ -302,7 +309,7 @@ extends: - task: RustInstaller@1 inputs: rustVersion: ms-stable - toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json + toolchainFeed: $(Rust.SDK) additionalTargets: $(buildName) displayName: Install Rust env: diff --git a/.pipelines/DSC-Windows.yml b/.pipelines/DSC-Windows.yml index fa18abf96..26b9d8542 100644 --- a/.pipelines/DSC-Windows.yml +++ b/.pipelines/DSC-Windows.yml @@ -10,6 +10,8 @@ parameters: default: Release - name: token type: string + - name: RustSDK + type: string steps: - checkout: self @@ -31,7 +33,7 @@ steps: - task: RustInstaller@1 inputs: rustVersion: ms-stable - toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json + toolchainFeed: ${{ parameters.RustSDK }} additionalTargets: ${{ parameters.buildName }} displayName: Install Rust env: From 271bea22f016b5a38602255ff0d07a957d183cf9 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Thu, 14 Aug 2025 13:37:37 -0700 Subject: [PATCH 2/9] update sub name --- .pipelines/DSC-Official.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.pipelines/DSC-Official.yml b/.pipelines/DSC-Official.yml index 057ad7775..9ce381960 100644 --- a/.pipelines/DSC-Official.yml +++ b/.pipelines/DSC-Official.yml @@ -83,7 +83,7 @@ extends: - task: AzureCLI@2 displayName: Get Az Token inputs: - azureSubscription: az-blob-cicd-infra + azureSubscription: PowerShell-CICD-Feed-Access scriptType: pscore scriptLocation: inlineScript inlineScript: | @@ -258,7 +258,7 @@ extends: - task: AzureCLI@2 displayName: Azure CLI inputs: - azureSubscription: az-blob-cicd-infra + azureSubscription: PowerShell-CICD-Feed-Access scriptType: pscore scriptLocation: inlineScript inlineScript: | @@ -317,7 +317,7 @@ extends: - task: AzureCLI@2 displayName: Azure CLI inputs: - azureSubscription: az-blob-cicd-infra + azureSubscription: PowerShell-CICD-Feed-Access scriptType: pscore scriptLocation: inlineScript inlineScript: | From b04bf4a8b30d73adb409452c3e7803e755aa94b6 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Thu, 14 Aug 2025 15:46:35 -0700 Subject: [PATCH 3/9] change to installing musl-gcc --- .pipelines/DSC-Official.yml | 3 ++- build.ps1 | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.pipelines/DSC-Official.yml b/.pipelines/DSC-Official.yml index 9ce381960..20ee7afac 100644 --- a/.pipelines/DSC-Official.yml +++ b/.pipelines/DSC-Official.yml @@ -271,7 +271,8 @@ extends: apt -y install clang apt -y install llvm apt -y install musl-tools - apt -y install gcc-multilib + apt -y install musi-gcc + #apt -y install gcc-multilib apt -y install libssl-dev apt -y install pkg-config msrustup default stable-aarch64-unknown-linux-musl diff --git a/build.ps1 b/build.ps1 index 5cb6b3922..76cfead26 100755 --- a/build.ps1 +++ b/build.ps1 @@ -309,6 +309,7 @@ if (!$SkipBuild) { # projects are in dependency order $projects = @( + ".", "tree-sitter-dscexpression", "tree-sitter-ssh-server-config", "security_context_lib", From 0292085a62126e939b6fb88a2287388777f32624 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Thu, 14 Aug 2025 17:39:34 -0700 Subject: [PATCH 4/9] don't update rust if used in ADO --- build.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index 76cfead26..c26d0e6e9 100755 --- a/build.ps1 +++ b/build.ps1 @@ -25,6 +25,7 @@ param( $env:RUSTC_LOG=$null $env:RUSTFLAGS='-Dwarnings' +$usingADO = ($null -ne $env:TF_BUILD) trap { Write-Error "An error occurred: $($_ | Out-String)" @@ -184,7 +185,7 @@ if ($null -ne $packageType) { Remove-Item temp:/rustup-init.exe -ErrorAction Ignore } } - else { + elseif (!$usingADO) { Write-Verbose -Verbose "Rust found, updating..." & $rustup update } @@ -500,8 +501,6 @@ if (!$Clippy -and !$SkipBuild) { if ($Test) { $failed = $false - - $usingADO = ($null -ne $env:TF_BUILD) $repository = 'PSGallery' if ($usingADO) { From 77e03e0f38cd8c6106b584c1de88bc08463e9094 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Fri, 15 Aug 2025 09:19:53 -0700 Subject: [PATCH 5/9] don't run msrustup at all within ADO --- build.ps1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/build.ps1 b/build.ps1 index c26d0e6e9..8cd995b90 100755 --- a/build.ps1 +++ b/build.ps1 @@ -155,7 +155,10 @@ function Find-LinkExe { } $channel = 'stable' -if ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore)) { +$rustup = 'echo' +if ($usingADO) { + break +} elseif ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore)) { $rustup = 'msrustup' $channel = 'ms-stable' if ($architecture -eq 'current') { @@ -163,8 +166,6 @@ if ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore } } elseif ($null -ne (Get-Command rustup -CommandType Application -ErrorAction Ignore)) { $rustup = 'rustup' -} else { - $rustup = 'echo' } if ($null -ne $packageType) { @@ -185,7 +186,7 @@ if ($null -ne $packageType) { Remove-Item temp:/rustup-init.exe -ErrorAction Ignore } } - elseif (!$usingADO) { + else { Write-Verbose -Verbose "Rust found, updating..." & $rustup update } From 4b08d5df418e865e0a748c6607760aa1183c9a23 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL)" Date: Fri, 15 Aug 2025 16:29:35 +0000 Subject: [PATCH 6/9] Apply suggestions from code review --- build.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.ps1 b/build.ps1 index 8cd995b90..f1d158c8e 100755 --- a/build.ps1 +++ b/build.ps1 @@ -157,7 +157,7 @@ function Find-LinkExe { $channel = 'stable' $rustup = 'echo' if ($usingADO) { - break + return } elseif ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore)) { $rustup = 'msrustup' $channel = 'ms-stable' From cad96daabe216990c0c2ec90a548ec1d1d73d7c5 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Fri, 15 Aug 2025 10:11:03 -0700 Subject: [PATCH 7/9] explicit not use rustup --- build.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index c26d0e6e9..024866066 100755 --- a/build.ps1 +++ b/build.ps1 @@ -192,7 +192,9 @@ if ($null -ne $packageType) { $BuildToolsPath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC" - & $rustup default stable + if (!$usingADO) { + & $rustup default stable + } ## Test if Node is installed ## Skipping upgrade as users may have a specific version they want to use @@ -261,7 +263,7 @@ else { } if (!$SkipBuild) { - if ($architecture -ne 'Current') { + if ($architecture -ne 'Current' -and !$usingADO) { & $rustup target add --toolchain $channel $architecture } From 288a0ab040aa4cc5a52e3651d5d5fff054518874 Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Tue, 19 Aug 2025 09:05:21 -0700 Subject: [PATCH 8/9] address Aditya's feedback --- .cargo/config.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 5c7f0d697..27cca1ce0 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -18,9 +18,3 @@ rustflags = ["-Ccontrol-flow-guard", "-Ctarget-feature=+crt-static", "-Clink-arg # The following is only needed for release builds [source.crates-io] replace-with = "POWERSHELL" - -#[target.aarch64-unknown-linux-gnu] -#linker = "aarch64-linux-gnu-gcc" - -#[target.aarch64-unknown-linux-musl] -#linker = "aarch64-linux-musl-gcc" From 82361fe407e37a8aefb624c20d099a6e76ad9a2b Mon Sep 17 00:00:00 2001 From: "Steve Lee (POWERSHELL HE/HIM) (from Dev Box)" Date: Tue, 19 Aug 2025 09:45:41 -0700 Subject: [PATCH 9/9] fix accidental dupe --- .pipelines/DSC-Windows.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.pipelines/DSC-Windows.yml b/.pipelines/DSC-Windows.yml index 9b54d8ccc..d7580ccae 100644 --- a/.pipelines/DSC-Windows.yml +++ b/.pipelines/DSC-Windows.yml @@ -12,8 +12,6 @@ parameters: type: string - name: RustSDK type: string - - name: RustSDK - type: string steps: - checkout: self