Skip to content
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
27 changes: 24 additions & 3 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,33 @@ 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",
"-Dwarnings"
]

[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",
"-Dwarnings"
]

# 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
8 changes: 0 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,6 @@ which = { version = "8.0" }
# build-only dependencies
# dsc-lib, dsc-lib-registry, sshdconfig, tree-sitter-dscexpression, tree-sitter-ssh-server-config
cc = { version = "1.2" }
# registry, dsc-lib-registry
static_vcruntime = { version = "2.0" }

# test-only dependencies
# dsc-lib-jsonschema
Expand Down
3 changes: 0 additions & 3 deletions archive/ntreg/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,3 @@ thiserror = "1.0"

[target.'cfg(onecore)'.dependencies]
pal = { path = "../pal" }

[build-dependencies]
static_vcruntime = "2.0"
2 changes: 0 additions & 2 deletions archive/ntreg/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rustc-link-lib=onecore_apiset");
println!("cargo:rustc-link-lib=onecoreuap_apiset");
static_vcruntime::metabuild();
}

#[cfg(not(onecore))]
fn main() {
println!("cargo:rerun-if-changed=build.rs");
static_vcruntime::metabuild();
}
3 changes: 0 additions & 3 deletions archive/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ serde_json = { version = "1.0", features = ["preserve_order"] }

[target.'cfg(onecore)'.dependencies]
pal = { path = "../pal" }

[build-dependencies]
static_vcruntime = "2.0"
2 changes: 0 additions & 2 deletions archive/registry/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs");
println!("cargo:rustc-link-lib=onecore_apiset");
println!("cargo:rustc-link-lib=onecoreuap_apiset");
static_vcruntime::metabuild();
}

#[cfg(not(onecore))]
fn main() {
// Prevent this build script from rerunning unnecessarily.
println!("cargo:rerun-if-changed=build.rs");
static_vcruntime::metabuild();
}
3 changes: 0 additions & 3 deletions build.helpers.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -750,9 +750,6 @@ function Set-RustEnvironment {
Write-Verbose "Caching current rust environment variables..."
[hashtable]$currentRustEnvironment = Get-RustEnvironment

Write-Verbose "Setting RUSTFLAGS to '-Dwarnings'"
$env:RUSTFLAGS='-Dwarnings'

if ($VerbosePreference -eq 'Continue') {
Write-Verbose "Running verbose, setting RUSTC_LOG "
# $env:RUSTC_LOG='rustc_codegen_ssa::back::link=info'
Expand Down
24 changes: 9 additions & 15 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ trap {
}

$env:RUSTC_LOG=$null
$env:RUSTFLAGS='-Dwarnings'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, you still have one of these in build.helpers.psm1 as well. Line 753-754

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BUILD:   Performing setup steps::Configuring Rust environment
VERBOSE: Caching current rust environment variables...
VERBOSE: No Rust environment variables defined
VERBOSE: Setting RUSTFLAGS to '-Dwarnings'

$usingADO = ($null -ne $env:TF_BUILD)
if ($usingADO -or $UseCFSAuth) {
$UseCFS = $true
Expand Down Expand Up @@ -182,20 +181,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
1 change: 0 additions & 1 deletion lib/dsc-lib-registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,4 @@ tracing-subscriber = { workspace = true }
utfx = { workspace = true }

[build-dependencies]
static_vcruntime = { workspace = true }
cc = { workspace = true }
1 change: 1 addition & 0 deletions packaging/msix/AppxManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
<rescap:Capability Name="unvirtualizedResources" />
<rescap:Capability Name="packageManagement" />
<rescap:Capability Name="packageQuery" />
<rescap:Capability Name="appLicensing" />
</Capabilities>
</Package>
3 changes: 0 additions & 3 deletions resources/registry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,3 @@ tracing-subscriber = { workspace = true }
utfx = { workspace = true }
# workspace crate dependencies
dsc-lib-registry = { workspace = true }

[build-dependencies]
static_vcruntime = { workspace = true }
1 change: 0 additions & 1 deletion resources/registry/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,4 @@
fn main() {
// Prevent this build script from rerunning unnecessarily.
println!("cargo:rerun-if-changed=build.rs");
static_vcruntime::metabuild();
}