Skip to content
Merged
Show file tree
Hide file tree
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
25 changes: 22 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,31 @@ POWERSHELL = { index = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/
[registry]
global-credential-providers = ["cargo:token"]

# Enable Control Flow Guard (needed for OneBranch's post-build analysis).
# Avoid linking with vcruntime140.dll by statically linking everything,
# and then explicitly linking with ucrtbase.dll dynamically.
# We do this, because vcruntime140.dll is an optional Windows component.
[target.x86_64-pc-windows-msvc]
rustflags = ["-Ccontrol-flow-guard", "-Ctarget-feature=+crt-static", "-Clink-args=/DYNAMICBASE /CETCOMPAT"]
rustflags = [
"-CControl-flow-guard",
"-Ctarget-feature=+crt-static",
"-Clink-args=/DEFAULTLIB:ucrt.lib",
"-Clink-args=/NODEFAULTLIB:vcruntime.lib",
"-Clink-args=/NODEFAULTLIB:msvcrt.lib",
"-Clink-args=/NODEFAULTLIB:libucrt.lib",
"-Clink-args=/DYNAMICBASE",
"-Clink-args=/CETCOMPAT"
]

[target.aarch64-windows-msvc]
rustflags = ["-Ccontrol-flow-guard", "-Ctarget-feature=+crt-static", "-Clink-args=/DYNAMICBASE"]
rustflags = [
"-CControl-flow-guard",
"-Ctarget-feature=+crt-static",
"-Clink-args=/DEFAULTLIB:ucrt.lib",
"-Clink-args=/NODEFAULTLIB:vcruntime.lib",
"-Clink-args=/NODEFAULTLIB:msvcrt.lib",
"-Clink-args=/NODEFAULTLIB:libucrt.lib",
"-Clink-args=/DYNAMICBASE"
]

# The following is only needed for release builds
[source.crates-io]
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/Feature_Request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ body:
new feature would solve. Try formulating it in user story style
(if applicable).
placeholder: >-
'As a user I want X so that Y...' with X being the being the
'As a user I want X so that Y...' with X being the
action and Y being the value of the action.
validations:
required: true
Expand Down
2 changes: 1 addition & 1 deletion .pipelines/DSC-Official.yml
Original file line number Diff line number Diff line change
Expand Up @@ -585,7 +585,7 @@ extends:
throw "PackageVersion variable is not set. Cannot proceed with publishing Universal Package."
}
Write-Verbose -Verbose "Universal Package version: $packageVersion"
az artifacts universal publish --organization https://dev.azure.com//PowerShell --project PowerShell --feed PowerShell-Universal --name microsoft.dsc-linux --version $packageVersion --description "Microsoft Desired State Configuration (DSC) - Universal Package" --path "$(LinuxDirectory)" --scope project --verbose
az artifacts universal publish --organization https://dev.azure.com/PowerShell --project PowerShell --feed PowerShell-Universal --name microsoft.dsc-linux --version $packageVersion --description "Microsoft Desired State Configuration (DSC) - Universal Package" --path "$(LinuxDirectory)" --scope project --verbose
condition: succeeded()

- task: AzureCLI@2
Expand Down
23 changes: 9 additions & 14 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,15 @@ if ($null -ne $packageType) {
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."
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 {
Expand Down