diff --git a/.cargo/config.toml b/.cargo/config.toml index 511ebe358..39c82a34b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,7 +3,10 @@ registry-auth = true [registries] -POWERSHELL = { index = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" } +DSCCargoMirror = { index = "sparse+https://pkgs.dev.azure.com/msazure/One/_packaging/DSCCargoMirror/Cargo/index/" } + +[source.crates-io] +replace-with = "DSCCargoMirror" [registry] global-credential-providers = ["cargo:token"] @@ -36,10 +39,6 @@ rustflags = [ "-Dwarnings" ] -# The following is only needed for release builds -[source.crates-io] -replace-with = "POWERSHELL" - # Enable running `cargo xtask ` [alias] xtask = "run --package xtask --" diff --git a/.github/instructions/instructions.md b/.github/instructions/instructions.md index 9e263e1dc..3c0d951b2 100644 --- a/.github/instructions/instructions.md +++ b/.github/instructions/instructions.md @@ -416,7 +416,6 @@ The build script automatically installs these. If issues persist: | `-UseCFS` | Switch | Use Component Framework Service | | `-UpdateLockFile` | Switch | Update Cargo.lock file | | `-Audit` | Switch | Run cargo audit for security vulnerabilities | -| `-UseCFSAuth` | Switch | Use CFS authentication | | `-Clean` | Switch | Clean build artifacts before building | | `-CacheRustBuild` | Switch | Cache Rust build artifacts | | `-RustDocs` | Switch | Generate Rust documentation | diff --git a/.pipelines/DSC-Official.yml b/.pipelines/DSC-Official.yml index 2978e359f..af5506be1 100644 --- a/.pipelines/DSC-Official.yml +++ b/.pipelines/DSC-Official.yml @@ -65,7 +65,6 @@ extends: forStages: [Build] credscan: enabled: true - scanFolder: $(System.DefaultWorkingDirectory) binskim: enabled: true apiscan: @@ -83,44 +82,29 @@ extends: type: windows vmImage: windows-latest variables: - repoRoot: '$(System.DefaultWorkingDirectory)\DSC' - ob_sdl_tsa_configFile: '$(System.DefaultWorkingDirectory)\.config\tsaoptions.json' ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' ob_sdl_sbom_enabled: false ob_signing_setup_enabled: false ob_sdl_codeql_compiled_enabled: false steps: - - checkout: self - pwsh: | - Write-Verbose -Verbose (Get-ChildItem '$(repoRoot)' | Out-String) - $packageVersion = $(repoRoot)/packaging.ps1 -GetPackageVersion + $packageVersion = ./packaging.ps1 -GetPackageVersion $vstsCommandString = "vso[task.setvariable variable=Version;isoutput=true]$packageVersion" Write-Host ("sending " + $vstsCommandString) Write-Host "##$vstsCommandString" name: Package displayName: Set Package Version - - task: AzureCLI@2 - displayName: Get Az Token - inputs: - azureSubscription: PowerShell-CICD-Feed-Access - scriptType: pscore - scriptLocation: inlineScript - inlineScript: | - $token = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv - $vstsCommandString = "vso[task.setvariable variable=AzToken;isoutput=true]$token" - Write-Host "Setting token" - Write-Host "##$vstsCommandString" - job: BuildWin_x64 dependsOn: SetPackageVersion variables: - ob_sdl_tsa_configFile: '$(System.DefaultWorkingDirectory)\.config\tsaoptions.json' ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' signSrcPath: '$(System.DefaultWorkingDirectory)\out' - AzToken: $[ dependencies.SetPackageVersion.outputs['AzToken'] ] ob_sdl_sbom_enabled: true ob_signing_setup_enabled: true ob_sdl_codeql_compiled_enabled: true + ob_symbolsPublishing_enabled: true + ob_symbolsPublishing_indexSources: true pool: type: windows steps: @@ -129,19 +113,18 @@ extends: buildName: x86_64-pc-windows-msvc signSrcPath: '$(signSrcPath)' PackageRoot: '$(PackageRoot)' - aztoken: '$(AzToken)' rustSDK: '$(Rust.SDK)' - job: BuildWin_arm64 dependsOn: SetPackageVersion variables: - ob_sdl_tsa_configFile: '$(System.DefaultWorkingDirectory)\.config\tsaoptions.json' ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' signSrcPath: '$(System.DefaultWorkingDirectory)\out' - AzToken: $[ dependencies.SetPackageVersion.outputs['AzToken'] ] ob_sdl_sbom_enabled: true ob_signing_setup_enabled: true ob_sdl_codeql_compiled_enabled: true + ob_symbolsPublishing_enabled: true + ob_symbolsPublishing_indexSources: true pool: type: windows steps: @@ -150,7 +133,6 @@ extends: buildName: aarch64-pc-windows-msvc signSrcPath: '$(signSrcPath)' PackageRoot: '$(PackageRoot)' - aztoken: '$(AzToken)' rustSDK: '$(Rust.SDK)' - job: CreateMsixBundle @@ -159,19 +141,12 @@ extends: - BuildWin_arm64 variables: ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' - ob_sdl_tsa_configFile: '$(System.DefaultWorkingDirectory)\.config\tsaoptions.json' - ob_symbolsPublishing_enabled: true - ob_symbolsPublishing_symbolsFolder: '$(System.DefaultWorkingDirectory)\DSC\bin' - ob_symbolsPublishing_searchPattern: '**/*.pdb' - ob_symbolsPublishing_indexSources: true ob_sdl_sbom_enabled: false ob_signing_setup_enabled: false ob_sdl_codeql_compiled_enabled: false - ob_restore_phase: true pool: type: windows steps: - - checkout: self - download: current artifact: drop_BuildAndSign_BuildWin_x64 patterns: '*.msix' @@ -179,12 +154,11 @@ extends: artifact: drop_BuildAndSign_BuildWin_arm64 patterns: '*.msix' - pwsh: | - Set-Location "$(System.DefaultWorkingDirectory)\DSC" $null = New-Item -ItemType Directory -Path "./bin/msix" -Force -ErrorAction Ignore Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWin_x64/*.msix" ./bin/msix -Verbose Copy-Item "$(Pipeline.Workspace)/drop_BuildAndSign_BuildWin_arm64/*.msix" ./bin/msix -Verbose - ./build.ps1 -PackageType msixbundle - Copy-Item "$(System.DefaultWorkingDirectory)/DSC/bin/*.msixbundle" "$(ob_outputDirectory)" + ./build.ps1 -Release -PackageType msixbundle + Copy-Item "./bin/*.msixbundle" "$(ob_outputDirectory)" displayName: 'Create msixbundle' condition: succeeded() @@ -302,29 +276,24 @@ extends: variables: LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest' PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] - AzToken: $[ dependencies.SetPackageVersion.outputs['AzToken'] ] ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' - ob_linuxSymbolsPublishing_enabled: true - ob_linuxSymbolsPublishing_symbolsFolder: '$(System.DefaultWorkingDirectory)/DSC/bin' - ob_linuxSymbolsPublishing_searchPattern: '**/*.dbg' displayName: Linux-x64-musl pool: type: linux steps: - task: RustInstaller@1 inputs: - rustVersion: ms-stable + rustVersion: ms-prod-1.93 toolchainFeed: $(Rust.SDK) additionalTargets: x86_64-unknown-linux-musl displayName: Install Rust - env: - ob_restore_phase: true + - task: CargoAuthenticate@0 + inputs: + configFile: '.cargo/config.toml' + displayName: Authenticate with Azure Artifacts - pwsh: | apt update apt -y install musl-tools rpm dpkg build-essential protobuf-compiler - $header = "Bearer $(AzToken)" - $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header - $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' ./build.ps1 -Release -Architecture x86_64-unknown-linux-musl ./packaging.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-musl -Release ./packaging.ps1 -PackageType rpm -Architecture x86_64-unknown-linux-musl -Release @@ -340,11 +309,7 @@ extends: variables: LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204-arm64:latest' PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] - AzToken: $[ dependencies.SetPackageVersion.outputs['AzToken'] ] ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' - ob_linuxSymbolsPublishing_enabled: true - ob_linuxSymbolsPublishing_symbolsFolder: '$(System.DefaultWorkingDirectory)/DSC/bin' - ob_linuxSymbolsPublishing_searchPattern: '**/*.dbg' displayName: Linux-ARM64-musl pool: type: linux @@ -352,20 +317,14 @@ extends: steps: - task: RustInstaller@1 inputs: - rustVersion: ms-stable + rustVersion: ms-prod-1.93 toolchainFeed: $(Rust.SDK) additionalTargets: aarch64-unknown-linux-musl displayName: Install Rust - env: - ob_restore_phase: true - - task: AzureCLI@2 - displayName: Azure CLI + - task: CargoAuthenticate@0 inputs: - azureSubscription: PowerShell-CICD-Feed-Access - scriptType: pscore - scriptLocation: inlineScript - inlineScript: | - az account show + configFile: '.cargo/config.toml' + displayName: Authenticate with Azure Artifacts - pwsh: | $env:CC_aarch64_unknown_linux_musl='clang' $env:AR_aarch64_unknown_linux_musl='llvm-ar' @@ -386,9 +345,6 @@ extends: if ((openssl version -d) -match 'OPENSSLDIR: "(?.*?)"') { $env:OPENSSL_LIB_DIR = $matches['dir'] } - $header = "Bearer $(AzToken)" - $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header - $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' ./build.ps1 -Release -Architecture aarch64-unknown-linux-musl ./packaging.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-musl -Release ./packaging.ps1 -PackageType rpm -Architecture aarch64-unknown-linux-musl -Release @@ -403,7 +359,6 @@ extends: dependsOn: SetPackageVersion variables: PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] - AzToken: $[ dependencies.SetPackageVersion.outputs['AzToken'] ] ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' displayName: BuildMac pool: @@ -420,24 +375,15 @@ extends: steps: - task: RustInstaller@1 inputs: - rustVersion: ms-stable + rustVersion: ms-prod-1.93 toolchainFeed: $(Rust.SDK) additionalTargets: $(buildName) displayName: Install Rust - env: - ob_restore_phase: true - - task: AzureCLI@2 - displayName: Azure CLI + - task: CargoAuthenticate@0 inputs: - azureSubscription: PowerShell-CICD-Feed-Access - scriptType: pscore - scriptLocation: inlineScript - inlineScript: | - az account show + configFile: '.cargo/config.toml' + displayName: Authenticate with Azure Artifacts - pwsh: | - $header = "Bearer $(AzToken)" - $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header - $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' Write-Verbose -Verbose "Building for $(buildName)" ./build.ps1 -Release -Architecture $(buildName) ./packaging.ps1 -PackageType tgz -Architecture $(buildName) -Release diff --git a/.pipelines/DSC-Windows.yml b/.pipelines/DSC-Windows.yml index 1ede90d8f..812165e76 100644 --- a/.pipelines/DSC-Windows.yml +++ b/.pipelines/DSC-Windows.yml @@ -8,41 +8,25 @@ parameters: - name: BuildConfiguration type: string default: Release - - name: aztoken - type: string - name: RustSDK type: string steps: -- checkout: self - env: - ob_restore_phase: true -- task: CodeQL3000Init@0 # Add CodeQL Init task right before your 'Build' step. - inputs: - Enabled: true - AnalyzeInPipeline: true - Language: rust - env: - ob_restore_phase: true - pwsh: | $tmpdir = "$(Agent.TempDirectory)" Write-Host "##vso[task.setvariable variable=CARGO_TARGET_DIR;]$tmpdir" displayName: 🛠️ Workaround for the LoadLibrary ACCESS_VIOLATION OneBranch issue - env: - ob_restore_phase: true - task: RustInstaller@1 inputs: - rustVersion: ms-stable + rustVersion: ms-prod-1.93 toolchainFeed: ${{ parameters.RustSDK }} additionalTargets: ${{ parameters.buildName }} displayName: Install Rust - env: - ob_restore_phase: true +- task: CargoAuthenticate@0 + inputs: + configFile: '.cargo/config.toml' + displayName: Authenticate with Azure Artifacts - pwsh: | - $header = "Bearer ${{ parameters.aztoken }}" - $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header - $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' - Set-Location "$(Build.SourcesDirectory)/DSC" $LLVMBIN = "$($env:PROGRAMFILES)\Microsoft Visual Studio\2022\Enterprise\VC\Tools\Llvm\bin" if (!(Test-Path $LLVMBIN)) { throw "LLVM path '$LLVMBIN' does not exist" @@ -52,13 +36,6 @@ steps: Write-Verbose -Verbose "Building for ${{ parameters.buildName }}" ./build.ps1 -Release -Architecture ${{ parameters.buildName }} -SkipLinkCheck -Verbose displayName: 'Build ${{ parameters.buildName }}' - env: - ob_restore_phase: true - condition: succeeded() -- task: CodeQL3000Finalize@0 # Add CodeQL Finalize task right after your 'Build' step. - condition: always() - env: - ob_restore_phase: true - pwsh: | $null = New-Item -ItemType Directory -Path "${{ parameters.PackageRoot }}" -ErrorAction Ignore $null = New-Item -ItemType Directory -Path "${{ parameters.PackageRoot }}/out" -ErrorAction Ignore @@ -68,13 +45,10 @@ steps: # copy only the exes from the TMP folder since it contains intermediately built files we don't want to sign write-host 'Binaries in ${env:CARGO_TARGET_DIR}' Copy-Item -Path "$env:CARGO_TARGET_DIR/${{ parameters.buildName }}/${{ parameters.BuildConfiguration }}/*.exe" -Destination "${{ parameters.signSrcPath }}" -Verbose - Copy-Item -Path "$(Build.SourcesDirectory)/DSC/bin/${{ parameters.buildName }}/${{ parameters.BuildConfiguration }}/*" -Recurse -Destination "${{ parameters.signSrcPath }}" -Verbose -Force + Copy-Item -Path "./bin/${{ parameters.buildName }}/${{ parameters.BuildConfiguration }}/*" -Recurse -Destination "${{ parameters.signSrcPath }}" -Verbose -Force write-host 'Binaries in ${{ parameters.signSrcPath }}' dir -r "${{ parameters.signSrcPath }}" displayName: Copy built binaries - env: - ob_restore_phase: true - condition: succeeded() - task: onebranch.pipeline.signing@1 displayName: Sign 1st party files inputs: @@ -91,17 +65,13 @@ steps: inputs: SourceFolder: "${{ parameters.signSrcPath }}" Contents: '**' - TargetFolder: $(Build.SourcesDirectory)/DSC/bin/${{ parameters.buildName }}/${{ parameters.BuildConfiguration }} + TargetFolder: ./bin/${{ parameters.buildName }}/${{ parameters.BuildConfiguration }} OverWrite: true - pwsh: | - Set-Location "$(Build.SourcesDirectory)/DSC" ./packaging.ps1 -PackageType zip -Architecture ${{ parameters.buildName }} -Release Copy-Item ./bin/*.zip "$(Build.ArtifactStagingDirectory)" -Verbose displayName: 'Zip ${{ parameters.buildName }}' - condition: succeeded() - pwsh: | - Set-Location "$(Build.SourcesDirectory)/DSC" ./build.ps1 -PackageType msix -Architecture ${{ parameters.buildName }} -Release -UseX64MakeAppx Copy-Item ./bin/msix/*.msix "$(Build.ArtifactStagingDirectory)" -Verbose displayName: 'Create msix for ${{ parameters.buildName }}' - condition: succeeded() diff --git a/build.ps1 b/build.ps1 index 7479946cb..918d90236 100755 --- a/build.ps1 +++ b/build.ps1 @@ -94,7 +94,6 @@ param( [switch]$UseCFS, [switch]$UpdateLockFile, [switch]$Audit, - [switch]$UseCFSAuth, [switch]$Clean, [switch]$CacheRustBuild, [switch]$RustDocs, @@ -113,7 +112,7 @@ begin { Import-Module ./helpers.build.psm1 -Force -Verbose:$false $usingADO = ($null -ne $env:TF_BUILD) - if ($usingADO -or $UseCFSAuth) { + if ($usingADO) { $UseCFS = $true } # Import the build data @@ -183,7 +182,7 @@ process { Write-BuildProgress @progressParams -Status 'Configuring Rust environment' [hashtable]$priorRustEnvironment = Set-RustEnvironment -CacheRustBuild:$CacheRustBuild @VerboseParam Write-BuildProgress @progressParams -Status 'Configuring Cargo environment' - Set-CargoEnvironment -UseCFS:$UseCFS -UseCFSAuth:$UseCFSAuth @VerboseParam + Set-CargoEnvironment -UseCFS:$UseCFS @VerboseParam # Install or update rust if (!$usingADO) { @@ -300,10 +299,11 @@ process { if (-not [string]::IsNullOrEmpty($PackageType)) { $progressParams.Activity = "Packaging" $packageParams = @{ - BuildData = $BuildData - PackageType = $PackageType - Architecture = $Architecture - Release = $Release + BuildData = $BuildData + PackageType = $PackageType + Architecture = $Architecture + Release = $Release + UseX64MakeAppx = $UseX64MakeAppx } Write-BuildProgress @progressParams Build-DscPackage @packageParams @VerboseParam diff --git a/helpers.build.psm1 b/helpers.build.psm1 index 9c9dac003..b577a284c 100644 --- a/helpers.build.psm1 +++ b/helpers.build.psm1 @@ -370,7 +370,7 @@ function Get-RustUp { if ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore)) { Write-Verbose -Verbose "Using msrustup" $rustup = 'msrustup' - $channel = 'ms-stable' + $channel = 'ms-prod-1.93' if ($architecture -eq 'current') { $env:MSRUSTUP_TOOLCHAIN = "$architecture" } @@ -805,8 +805,7 @@ function Set-CargoEnvironment { #> [cmdletbinding()] param( - [switch]$UseCFS, - [switch]$UseCFSAuth + [switch]$UseCFS ) process { @@ -814,28 +813,6 @@ function Set-CargoEnvironment { Write-Host "Using CFS for cargo source replacement" ${env:CARGO_SOURCE_crates-io_REPLACE_WITH} = $null $env:CARGO_REGISTRIES_CRATESIO_INDEX = $null - - if ($UseCFSAuth) { - if ($null -eq (Get-Command 'az' -ErrorAction Ignore)) { - throw "Azure CLI not found" - } - - if ($null -ne (Get-Command az -ErrorAction Ignore)) { - Write-Host "Getting token" - $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv - if ($LASTEXITCODE -ne 0) { - Write-Warning "Failed to get access token, use 'az login' first, or use '-useCratesIO' to use crates.io. Proceeding with anonymous access." - } else { - $header = "Bearer $accessToken" - $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header - $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' - $env:CARGO_REGISTRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell~force-auth/Cargo/index/" - } - } - else { - Write-Warning "Azure CLI not found, proceeding with anonymous access." - } - } } else { # this will override the config.toml Write-Host "Setting CARGO_SOURCE_crates-io_REPLACE_WITH to 'crates-io'" @@ -1232,7 +1209,12 @@ function Update-PathEnvironment { } } -function Find-MakeAppx() { +function Find-MakeAppx { + [CmdletBinding()] + param( + [switch]$UseX64MakeAppx + ) + $makeappx = Get-Command makeappx -CommandType Application -ErrorAction Ignore if ($null -eq $makeappx) { # try to find @@ -1809,7 +1791,8 @@ function Build-DscMsixPackage { 'x86_64-unknown-linux-musl' )] $Architecture = 'current', - [switch]$Release + [switch]$Release, + [switch]$UseX64MakeAppx ) begin { @@ -1826,7 +1809,7 @@ function Build-DscMsixPackage { $productVersion = Get-DscCliVersion $isPrivate = $packageType -eq 'msix-private' $isPreview = $productVersion -like '*-*' - $makeappx = Find-MakeAppx + $makeappx = Find-MakeAppx -UseX64MakeAppx:$UseX64MakeAppx $makepri = Get-Item (Join-Path $makeappx.Directory "makepri.exe") -ErrorAction Stop } @@ -1836,7 +1819,7 @@ function Build-DscMsixPackage { $msixArguments = @( 'bundle' '/d', $artifactDirectory.MsixBundle - '/p', "$($artifactDirectory.Bin)\$packageName.msixbundle" + '/p', "$($artifactDirectory.BinRoot)\$packageName.msixbundle" ) & $makeappx @msixArguments return @@ -2167,7 +2150,8 @@ function Build-DscPackage { 'x86_64-unknown-linux-musl' )] $Architecture = 'current', - [switch]$Release + [switch]$Release, + [switch]$UseX64MakeAppx ) begin { @@ -2182,6 +2166,7 @@ function Build-DscPackage { ArtifactDirectory = $artifactDirectory Architecture = $Architecture Release = $Release + UseX64MakeAppx = $UseX64MakeAppx } } diff --git a/packaging.ps1 b/packaging.ps1 index 1932c0428..ef912eb4e 100755 --- a/packaging.ps1 +++ b/packaging.ps1 @@ -18,7 +18,6 @@ param( [switch]$UseCFS, [switch]$UpdateLockFile, [switch]$Audit, - [switch]$UseCFSAuth, [switch]$Clean, [switch]$Verbose ) @@ -30,7 +29,7 @@ trap { $env:RUSTC_LOG=$null $usingADO = ($null -ne $env:TF_BUILD) -if ($usingADO -or $UseCFSAuth) { +if ($usingADO) { $UseCFS = $true } @@ -163,7 +162,7 @@ $channel = 'stable' if ($null -ne (Get-Command msrustup -CommandType Application -ErrorAction Ignore)) { Write-Verbose -Verbose "Using msrustup" $rustup = 'msrustup' - $channel = 'ms-stable' + $channel = 'ms-prod-1.93' if ($architecture -eq 'current') { $env:MSRUSTUP_TOOLCHAIN = "$architecture" } @@ -178,23 +177,6 @@ if ($null -ne $packageType) { Write-Host "Using CFS for cargo source replacement" ${env:CARGO_SOURCE_crates-io_REPLACE_WITH} = $null $env:CARGO_REGISTRIES_CRATESIO_INDEX = $null - - if ($UseCFSAuth) { - if ($null -eq (Get-Command 'az' -ErrorAction Ignore)) { - throw "Azure CLI not found" - } - - Write-Host "Getting token" - $accessToken = az account get-access-token --query accessToken --resource 499b84ac-1321-427f-aa17-267ca6975798 -o tsv - if ($LASTEXITCODE -ne 0) { - Write-Warning "Failed to get access token, use 'az login' first, or use '-useCratesIO' to use crates.io. Proceeding with anonymous access." - } else { - $header = "Bearer $accessToken" - $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header - $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' - $env:CARGO_REGISTRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell~force-auth/Cargo/index/" - } - } } else { # this will override the config.toml Write-Host "Setting CARGO_SOURCE_crates-io_REPLACE_WITH to 'crates-io'" diff --git a/packaging/rpm/dsc.spec b/packaging/rpm/dsc.spec index 424283519..76267d725 100644 --- a/packaging/rpm/dsc.spec +++ b/packaging/rpm/dsc.spec @@ -33,6 +33,7 @@ ln -s /opt/dsc/dsc-bicep-ext $RPM_BUILD_ROOT/usr/bin/dsc-bicep-ext %files /opt/dsc/* /usr/bin/dsc +/usr/bin/dsc-bicep-ext %changelog * Wed Oct 22 2025 Microsoft Corporation