diff --git a/.cargo/config.toml b/.cargo/config.toml
index 27cca1ce0..aaef8570d 100644
--- a/.cargo/config.toml
+++ b/.cargo/config.toml
@@ -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]
diff --git a/.github/ISSUE_TEMPLATE/Feature_Request.yml b/.github/ISSUE_TEMPLATE/Feature_Request.yml
index 426f8e949..76c6bec52 100644
--- a/.github/ISSUE_TEMPLATE/Feature_Request.yml
+++ b/.github/ISSUE_TEMPLATE/Feature_Request.yml
@@ -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
diff --git a/.pipelines/DSC-Official.yml b/.pipelines/DSC-Official.yml
index 4d9cf7259..60870a794 100644
--- a/.pipelines/DSC-Official.yml
+++ b/.pipelines/DSC-Official.yml
@@ -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
diff --git a/Cargo.lock b/Cargo.lock
index 8e5a5c607..b2b5c1cbd 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -729,7 +729,6 @@ dependencies = [
"schemars",
"serde",
"serde_json",
- "static_vcruntime",
"thiserror 2.0.17",
"tracing",
"tracing-subscriber",
@@ -784,7 +783,6 @@ dependencies = [
"schemars",
"serde",
"serde_json",
- "static_vcruntime",
"thiserror 2.0.17",
"tracing",
"tracing-subscriber",
@@ -2678,12 +2676,6 @@ version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
-[[package]]
-name = "static_vcruntime"
-version = "2.0.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "954e3e877803def9dc46075bf4060147c55cd70db97873077232eae0269dc89b"
-
[[package]]
name = "streaming-iterator"
version = "0.1.9"
diff --git a/Cargo.toml b/Cargo.toml
index 31f5c69fd..6339ec197 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -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
diff --git a/archive/ntreg/Cargo.toml b/archive/ntreg/Cargo.toml
index 18c322bdf..362b04261 100644
--- a/archive/ntreg/Cargo.toml
+++ b/archive/ntreg/Cargo.toml
@@ -29,6 +29,3 @@ thiserror = "1.0"
[target.'cfg(onecore)'.dependencies]
pal = { path = "../pal" }
-
-[build-dependencies]
-static_vcruntime = "2.0"
diff --git a/archive/ntreg/build.rs b/archive/ntreg/build.rs
index abbdaf1e7..bc775bbcc 100644
--- a/archive/ntreg/build.rs
+++ b/archive/ntreg/build.rs
@@ -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();
}
diff --git a/archive/registry/Cargo.toml b/archive/registry/Cargo.toml
index 13dcd4026..e2656a748 100644
--- a/archive/registry/Cargo.toml
+++ b/archive/registry/Cargo.toml
@@ -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"
diff --git a/archive/registry/build.rs b/archive/registry/build.rs
index ce4b7a084..a75972259 100644
--- a/archive/registry/build.rs
+++ b/archive/registry/build.rs
@@ -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();
}
diff --git a/build.helpers.psm1 b/build.helpers.psm1
index 1142333d0..83a3a7719 100644
--- a/build.helpers.psm1
+++ b/build.helpers.psm1
@@ -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'
diff --git a/build.ps1 b/build.ps1
index 1ee551e20..f92f6571f 100755
--- a/build.ps1
+++ b/build.ps1
@@ -29,7 +29,6 @@ trap {
}
$env:RUSTC_LOG=$null
-$env:RUSTFLAGS='-Dwarnings'
$usingADO = ($null -ne $env:TF_BUILD)
if ($usingADO -or $UseCFSAuth) {
$UseCFS = $true
@@ -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 {
diff --git a/lib/dsc-lib-registry/Cargo.toml b/lib/dsc-lib-registry/Cargo.toml
index f72e50347..cd38a3e3b 100644
--- a/lib/dsc-lib-registry/Cargo.toml
+++ b/lib/dsc-lib-registry/Cargo.toml
@@ -24,5 +24,4 @@ tracing-subscriber = { workspace = true }
utfx = { workspace = true }
[build-dependencies]
-static_vcruntime = { workspace = true }
cc = { workspace = true }
diff --git a/packaging/msix/AppxManifest.xml b/packaging/msix/AppxManifest.xml
index 37f7f541e..3cbee4de7 100644
--- a/packaging/msix/AppxManifest.xml
+++ b/packaging/msix/AppxManifest.xml
@@ -47,5 +47,6 @@
+
diff --git a/resources/registry/Cargo.toml b/resources/registry/Cargo.toml
index 50dd79eb8..de7e3a825 100644
--- a/resources/registry/Cargo.toml
+++ b/resources/registry/Cargo.toml
@@ -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 }
diff --git a/resources/registry/build.rs b/resources/registry/build.rs
index 495c64a43..977722481 100644
--- a/resources/registry/build.rs
+++ b/resources/registry/build.rs
@@ -4,5 +4,4 @@
fn main() {
// Prevent this build script from rerunning unnecessarily.
println!("cargo:rerun-if-changed=build.rs");
- static_vcruntime::metabuild();
}