From c15a44cf1391889b937f92902489b8332bb64909 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 13:41:14 -0700 Subject: [PATCH 01/13] Fix use of tree-sitter binding due to change in crate --- dsc_lib/src/parser/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dsc_lib/src/parser/mod.rs b/dsc_lib/src/parser/mod.rs index b0440b2f..69a10808 100644 --- a/dsc_lib/src/parser/mod.rs +++ b/dsc_lib/src/parser/mod.rs @@ -26,7 +26,7 @@ impl Statement { /// This function will return an error if the underlying parser fails to initialize. pub fn new() -> Result { let mut parser = Parser::new(); - parser.set_language(&tree_sitter_dscexpression::LANGUAGE.into())?; + parser.set_language(&tree_sitter_dscexpression::language())?; let function_dispatcher = FunctionDispatcher::new(); Ok(Self { parser, From 7c2efeae9fdafc7cb04ed6cc9ba3361636cad6a2 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 14:21:38 -0700 Subject: [PATCH 02/13] specify tree-sitter-rust dependency explicitly to get version that resolves language change --- dsc/Cargo.lock | 11 +++++++++++ dsc_lib/Cargo.lock | 11 +++++++++++ tools/test_group_resource/Cargo.lock | 11 +++++++++++ tree-sitter-dscexpression/Cargo.lock | 11 +++++++++++ tree-sitter-dscexpression/Cargo.toml | 3 ++- 5 files changed, 46 insertions(+), 1 deletion(-) diff --git a/dsc/Cargo.lock b/dsc/Cargo.lock index ef6004e5..188680f3 100644 --- a/dsc/Cargo.lock +++ b/dsc/Cargo.lock @@ -1876,6 +1876,7 @@ dependencies = [ "cc", "tree-sitter", "tree-sitter-language", + "tree-sitter-rust", ] [[package]] @@ -1884,6 +1885,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" +[[package]] +name = "tree-sitter-rust" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8" +dependencies = [ + "cc", + "tree-sitter-language", +] + [[package]] name = "unicode-bidi" version = "0.3.17" diff --git a/dsc_lib/Cargo.lock b/dsc_lib/Cargo.lock index 6ed62eb1..855bbeed 100644 --- a/dsc_lib/Cargo.lock +++ b/dsc_lib/Cargo.lock @@ -1475,6 +1475,7 @@ dependencies = [ "cc", "tree-sitter", "tree-sitter-language", + "tree-sitter-rust", ] [[package]] @@ -1483,6 +1484,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" +[[package]] +name = "tree-sitter-rust" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8" +dependencies = [ + "cc", + "tree-sitter-language", +] + [[package]] name = "unicode-bidi" version = "0.3.17" diff --git a/tools/test_group_resource/Cargo.lock b/tools/test_group_resource/Cargo.lock index 1b4df837..69ded569 100644 --- a/tools/test_group_resource/Cargo.lock +++ b/tools/test_group_resource/Cargo.lock @@ -1486,6 +1486,7 @@ dependencies = [ "cc", "tree-sitter", "tree-sitter-language", + "tree-sitter-rust", ] [[package]] @@ -1494,6 +1495,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" +[[package]] +name = "tree-sitter-rust" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8" +dependencies = [ + "cc", + "tree-sitter-language", +] + [[package]] name = "unicode-bidi" version = "0.3.17" diff --git a/tree-sitter-dscexpression/Cargo.lock b/tree-sitter-dscexpression/Cargo.lock index d6afaa84..1689b8e6 100644 --- a/tree-sitter-dscexpression/Cargo.lock +++ b/tree-sitter-dscexpression/Cargo.lock @@ -87,6 +87,7 @@ dependencies = [ "cc", "tree-sitter", "tree-sitter-language", + "tree-sitter-rust", ] [[package]] @@ -94,3 +95,13 @@ name = "tree-sitter-language" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8ddffe35a0e5eeeadf13ff7350af564c6e73993a24db62caee1822b185c2600" + +[[package]] +name = "tree-sitter-rust" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cffbbcb780348fbae8395742ae5b34c1fd794e4085d43aac9f259387f9a84dc8" +dependencies = [ + "cc", + "tree-sitter-language", +] diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index a085a5ae..8467568c 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -22,6 +22,7 @@ path = "bindings/rust/lib.rs" [dependencies] tree-sitter = "0.24.3" tree-sitter-language = "0.1.2" +tree-sitter-rust = "0.23.0" [build-dependencies] -cc = "1.1.29" +cc = "1.1" From e5dd00aa479bce3d966decf3389ae4fec5679c68 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 14:38:06 -0700 Subject: [PATCH 03/13] try setting dependency first --- tree-sitter-dscexpression/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index 8467568c..99b0961f 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -20,9 +20,9 @@ include = [ path = "bindings/rust/lib.rs" [dependencies] +tree-sitter-rust = "0.23.0" tree-sitter = "0.24.3" tree-sitter-language = "0.1.2" -tree-sitter-rust = "0.23.0" [build-dependencies] cc = "1.1" From b11481b799ed4e15f3ea80f7325604391b525746 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 14:43:51 -0700 Subject: [PATCH 04/13] update version and explicitly add tree-sitter-rust to dsc_lib --- dsc/Cargo.lock | 3 ++- dsc/Cargo.toml | 2 +- dsc_lib/Cargo.lock | 1 + dsc_lib/Cargo.toml | 3 ++- tools/test_group_resource/Cargo.lock | 1 + tree-sitter-dscexpression/Cargo.toml | 2 +- 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dsc/Cargo.lock b/dsc/Cargo.lock index 188680f3..96e38a4c 100644 --- a/dsc/Cargo.lock +++ b/dsc/Cargo.lock @@ -469,7 +469,7 @@ dependencies = [ [[package]] name = "dsc" -version = "3.0.0-preview.11" +version = "3.0.0-rc.1" dependencies = [ "clap", "clap_complete", @@ -517,6 +517,7 @@ dependencies = [ "tracing-indicatif", "tree-sitter", "tree-sitter-dscexpression", + "tree-sitter-rust", ] [[package]] diff --git a/dsc/Cargo.toml b/dsc/Cargo.toml index b0bdd9ca..5b1c6428 100644 --- a/dsc/Cargo.toml +++ b/dsc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "dsc" -version = "3.0.0-preview.11" +version = "3.0.0-rc.1" edition = "2021" [profile.release] diff --git a/dsc_lib/Cargo.lock b/dsc_lib/Cargo.lock index 855bbeed..7750672d 100644 --- a/dsc_lib/Cargo.lock +++ b/dsc_lib/Cargo.lock @@ -391,6 +391,7 @@ dependencies = [ "tracing-indicatif", "tree-sitter", "tree-sitter-dscexpression", + "tree-sitter-rust", ] [[package]] diff --git a/dsc_lib/Cargo.toml b/dsc_lib/Cargo.toml index f4a2cfd7..1babf7df 100644 --- a/dsc_lib/Cargo.toml +++ b/dsc_lib/Cargo.toml @@ -25,10 +25,11 @@ tokio = { version = "1.40.0", features = ["full"] } tracing = "0.1.37" tracing-indicatif = { version = "0.3.6" } tree-sitter = "0.24.3" +tree-sitter-rust = "0.23.0" tree-sitter-dscexpression = { path = "../tree-sitter-dscexpression" } [dev-dependencies] serde_yaml = "0.9.3" [build-dependencies] -cc="1.1.30" +cc="1.1" diff --git a/tools/test_group_resource/Cargo.lock b/tools/test_group_resource/Cargo.lock index 69ded569..16638746 100644 --- a/tools/test_group_resource/Cargo.lock +++ b/tools/test_group_resource/Cargo.lock @@ -391,6 +391,7 @@ dependencies = [ "tracing-indicatif", "tree-sitter", "tree-sitter-dscexpression", + "tree-sitter-rust", ] [[package]] diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index 99b0961f..cfd39fa4 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -20,8 +20,8 @@ include = [ path = "bindings/rust/lib.rs" [dependencies] -tree-sitter-rust = "0.23.0" tree-sitter = "0.24.3" +tree-sitter-rust = "0.23.0" tree-sitter-language = "0.1.2" [build-dependencies] From 8e85617d78eeaa69ec1a5ff15802f931e482fdd3 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 14:58:54 -0700 Subject: [PATCH 05/13] update edition year for tree-sitter-dscexpression --- tree-sitter-dscexpression/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index cfd39fa4..2ec36032 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -5,7 +5,7 @@ version = "1.0.0" keywords = ["incremental", "parsing", "DSCExpression"] categories = ["parsing", "text-editors"] repository = "https://github.com/powershell/dsc" -edition = "2018" +edition = "2021" license = "MIT" build = "bindings/rust/build.rs" From 60061ce5fab79e2b13395f5f11eacb72611d5d6e Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Thu, 24 Oct 2024 15:15:29 -0700 Subject: [PATCH 06/13] revert back binding change since the generated code uses the LANGUAGE syntax --- dsc_lib/src/parser/mod.rs | 2 +- tree-sitter-dscexpression/Cargo.lock | 4 ++-- tree-sitter-dscexpression/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dsc_lib/src/parser/mod.rs b/dsc_lib/src/parser/mod.rs index 69a10808..b0440b2f 100644 --- a/dsc_lib/src/parser/mod.rs +++ b/dsc_lib/src/parser/mod.rs @@ -26,7 +26,7 @@ impl Statement { /// This function will return an error if the underlying parser fails to initialize. pub fn new() -> Result { let mut parser = Parser::new(); - parser.set_language(&tree_sitter_dscexpression::language())?; + parser.set_language(&tree_sitter_dscexpression::LANGUAGE.into())?; let function_dispatcher = FunctionDispatcher::new(); Ok(Self { parser, diff --git a/tree-sitter-dscexpression/Cargo.lock b/tree-sitter-dscexpression/Cargo.lock index 1689b8e6..0e3d508f 100644 --- a/tree-sitter-dscexpression/Cargo.lock +++ b/tree-sitter-dscexpression/Cargo.lock @@ -28,9 +28,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index 2ec36032..6d2d2c20 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -20,8 +20,8 @@ include = [ path = "bindings/rust/lib.rs" [dependencies] -tree-sitter = "0.24.3" tree-sitter-rust = "0.23.0" +tree-sitter = "0.24.3" tree-sitter-language = "0.1.2" [build-dependencies] From bdd10430bdeb447f0c672543ee97348b62fab7d3 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Sat, 26 Oct 2024 16:12:13 -0700 Subject: [PATCH 07/13] Only build linux musl --- .cargo/config.toml | 2 +- .github/workflows/rust.yml | 20 ++--- .pipelines/DSC-Official.yml | 114 +++++++++++++-------------- .vscode/settings.json | 3 +- build.ps1 | 7 ++ dsc/Cargo.lock | 4 +- dsc/Cargo.toml | 28 +++---- dsc_lib/Cargo.lock | 4 +- dsc_lib/Cargo.toml | 42 +++++----- osinfo/Cargo.toml | 6 +- pal/Cargo.toml | 2 +- process/Cargo.toml | 6 +- registry/Cargo.toml | 20 ++--- runcommandonset/Cargo.toml | 10 +-- security_context_lib/Cargo.toml | 4 +- tools/test_group_resource/Cargo.lock | 4 +- tree-sitter-dscexpression/Cargo.toml | 6 +- 17 files changed, 145 insertions(+), 137 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 7e2bf62b..8945e070 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,7 +3,7 @@ registry-auth = true [registries] -POWERSHELL = { index = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" } +POWERSHELL = { index = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell~force-auth/Cargo/index/" } [registry] global-credential-providers = ["cargo:token"] diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a04bb5c5..7f738a83 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -15,18 +15,18 @@ env: CARGO_TERM_COLOR: always jobs: - build-linux: + # build-linux: - runs-on: ubuntu-latest + # runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Build - shell: pwsh - run: ./build.ps1 -clippy - - name: Run tests - shell: pwsh - run: ./build.ps1 -test + # steps: + # - uses: actions/checkout@v3 + # - name: Build + # shell: pwsh + # run: ./build.ps1 -clippy + # - name: Run tests + # shell: pwsh + # run: ./build.ps1 -test build-musl: diff --git a/.pipelines/DSC-Official.yml b/.pipelines/DSC-Official.yml index 9d00379e..8ef74b68 100644 --- a/.pipelines/DSC-Official.yml +++ b/.pipelines/DSC-Official.yml @@ -5,7 +5,7 @@ pr: branches: include: - onebranch - - release* + - v3.* schedules: - cron: '0 3 * * 1' @@ -33,7 +33,7 @@ extends: template: v2/OneBranch.Official.CrossPlat.yml@onebranchTemplates parameters: featureFlags: - WindowsHostVersion: + WindowsHostVersion: Disk: Large Version: 2022 Network: KS1 # note that this property is sticky so commenting out will use the previous set one @@ -59,7 +59,7 @@ extends: apiscan: enabled: false - stages: + stages: - stage: BuildAndSign displayName: Build Native Binaries dependsOn: [] @@ -225,61 +225,61 @@ extends: displayName: 'Create msixbundle' condition: succeeded() - - job: BuildLinux - dependsOn: SetPackageVersion - variables: - LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest' - PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] - ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' - displayName: Linux-x64-gnu - pool: - type: linux - steps: - - task: RustInstaller@1 - inputs: - rustVersion: ms-stable - toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json - additionalTargets: x86_64-unknown-linux-gnu - displayName: Install Rust - env: - ob_restore_phase: true - - pwsh: | - ./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu - ./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-gnu -Release - Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)" - displayName: 'Build x86_64-unknown-linux-gnu' - condition: succeeded() + # - job: BuildLinux + # dependsOn: SetPackageVersion + # variables: + # LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2204:latest' + # PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] + # ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' + # displayName: Linux-x64-gnu + # pool: + # type: linux + # steps: + # - task: RustInstaller@1 + # inputs: + # rustVersion: ms-stable + # toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json + # additionalTargets: x86_64-unknown-linux-gnu + # displayName: Install Rust + # env: + # ob_restore_phase: true + # - pwsh: | + # ./build.ps1 -Release -Architecture x86_64-unknown-linux-gnu + # ./build.ps1 -PackageType tgz -Architecture x86_64-unknown-linux-gnu -Release + # Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)" + # displayName: 'Build x86_64-unknown-linux-gnu' + # condition: succeeded() - - job: BuildLinuxArm64 - dependsOn: SetPackageVersion - variables: - LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2004-arm64:latest' - PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] - ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' - displayName: Linux-ARM64-gnu - pool: - type: linux - hostArchitecture: arm64 - steps: - - task: RustInstaller@1 - inputs: - rustVersion: ms-stable - toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json - additionalTargets: aarch64-unknown-linux-gnu - displayName: Install Rust - env: - ob_restore_phase: true - - pwsh: | - apt update - apt -y install gcc-aarch64-linux-gnu - if ((openssl version -d) -match 'OPENSSLDIR: "(?.*?)"') { - $env:OPENSSL_LIB_DIR = $matches['dir'] - } - ./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu - ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release - Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)" - displayName: 'Build aarch64-unknown-linux-gnu' - condition: succeeded() + # - job: BuildLinuxArm64 + # dependsOn: SetPackageVersion + # variables: + # LinuxContainerImage: 'onebranch.azurecr.io/linux/ubuntu-2004-arm64:latest' + # PackageVersion: $[ dependencies.SetPackageVersion.outputs['Package.Version'] ] + # ob_outputDirectory: '$(Build.ArtifactStagingDirectory)' + # displayName: Linux-ARM64-gnu + # pool: + # type: linux + # hostArchitecture: arm64 + # steps: + # - task: RustInstaller@1 + # inputs: + # rustVersion: ms-stable + # toolchainFeed: https://pkgs.dev.azure.com/mscodehub/Rust/_packaging/Rust/nuget/v3/index.json + # additionalTargets: aarch64-unknown-linux-gnu + # displayName: Install Rust + # env: + # ob_restore_phase: true + # - pwsh: | + # apt update + # apt -y install gcc-aarch64-linux-gnu + # if ((openssl version -d) -match 'OPENSSLDIR: "(?.*?)"') { + # $env:OPENSSL_LIB_DIR = $matches['dir'] + # } + # ./build.ps1 -Release -Architecture aarch64-unknown-linux-gnu + # ./build.ps1 -PackageType tgz -Architecture aarch64-unknown-linux-gnu -Release + # Copy-Item ./bin/*.tar.gz "$(ob_outputDirectory)" + # displayName: 'Build aarch64-unknown-linux-gnu' + # condition: succeeded() - job: BuildLinuxMusl dependsOn: SetPackageVersion diff --git a/.vscode/settings.json b/.vscode/settings.json index 54f38dc4..292ec34e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -25,5 +25,6 @@ "sarif-viewer.connectToGithubCodeScanning": "off", "vscode-nmake-tools.workspaceBuildDirectories": [ "." - ] + ], + "azure-pipelines.1ESPipelineTemplatesSchemaFile": true } \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 09e848df..a03894c5 100644 --- a/build.ps1 +++ b/build.ps1 @@ -655,6 +655,13 @@ if ($packageType -eq 'msixbundle') { } } + # for Linux, we only build musl as its statically linked, so we remove the musl suffix + if ($architecture -eq 'aarch64-unknown-linux-musl') { + $architecture = 'aarch64-linux' + } elseif ($architecture -eq 'x86_64-unknown-linux-musl') { + $architecture = 'x86_64-linux' + } + $packageName = "DSC-$productVersion-$architecture.tar" $tarFile = Join-Path $PSScriptRoot 'bin' $packageName tar cvf $tarFile -C $tgzTarget . diff --git a/dsc/Cargo.lock b/dsc/Cargo.lock index 96e38a4c..be78e463 100644 --- a/dsc/Cargo.lock +++ b/dsc/Cargo.lock @@ -1744,9 +1744,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", diff --git a/dsc/Cargo.toml b/dsc/Cargo.toml index 5b1c6428..fe11c4b6 100644 --- a/dsc/Cargo.toml +++ b/dsc/Cargo.toml @@ -11,22 +11,22 @@ opt-level = 2 lto = true [dependencies] -clap = { version = "4.5.17", features = ["derive"] } -clap_complete = { version = "4.5.28" } -crossterm = { version = "0.28.1" } -ctrlc = { version = "3.4.0" } +clap = { version = "4.5", features = ["derive"] } +clap_complete = { version = "4.5" } +crossterm = { version = "0.28" } +ctrlc = { version = "3.4" } dsc_lib = { path = "../dsc_lib" } indicatif = { version = "0.17" } -jsonschema = { version = "0.23.0", default-features = false } -path-absolutize = { version = "3.1.1" } +jsonschema = { version = "0.23", default-features = false } +path-absolutize = { version = "3.1" } # reqwest = { version = "0.12.8", features = ["native-tls"], default-features = false } -schemars = { version = "0.8.12" } -serde = { version = "1.0.210", features = ["derive"] } -serde_json = { version = "1.0.128", features = ["preserve_order"] } -serde_yaml = { version = "0.9.3" } +schemars = { version = "0.8" } +serde = { version = "1.0", features = ["derive"] } +serde_json = { version = "1.0", features = ["preserve_order"] } +serde_yaml = { version = "0.9" } syntect = { version = "5.0", features = ["default-fancy"], default-features = false } -sysinfo = { version = "0.32.0" } -thiserror = "1.0.52" +sysinfo = { version = "0.32" } +thiserror = "1.0" tracing = { version = "0.1.37" } -tracing-subscriber = { version = "0.3.17", features = ["ansi", "env-filter", "json"] } -tracing-indicatif = { version = "0.3.6" } +tracing-subscriber = { version = "0.3", features = ["ansi", "env-filter", "json"] } +tracing-indicatif = { version = "0.3" } diff --git a/dsc_lib/Cargo.lock b/dsc_lib/Cargo.lock index 7750672d..d78785ae 100644 --- a/dsc_lib/Cargo.lock +++ b/dsc_lib/Cargo.lock @@ -1360,9 +1360,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", diff --git a/dsc_lib/Cargo.toml b/dsc_lib/Cargo.toml index 1babf7df..e49321b0 100644 --- a/dsc_lib/Cargo.toml +++ b/dsc_lib/Cargo.toml @@ -4,32 +4,32 @@ version = "3.0.0" edition = "2021" [dependencies] -base64 = "0.22.1" -chrono = "0.4.26" -clap = { version = "4.5.17", features = ["derive"] } -derive_builder ="0.20.1" -indicatif = "0.17.0" -jsonschema = { version = "0.23.0", default-features = false } -linked-hash-map = "0.5.6" -num-traits = "0.2.14" -regex = "1.7.0" +base64 = "0.22" +chrono = "0.4" +clap = { version = "4.5", features = ["derive"] } +derive_builder ="0.20" +indicatif = "0.17" +jsonschema = { version = "0.23", default-features = false } +linked-hash-map = "0.5" +num-traits = "0.2" +regex = "1.11" # reqwest = { version = "0.12.8", features = ["native-tls"], default-features = false } -schemars = { version = "0.8.12", features = ["preserve_order"] } -serde = { version = "1.0.210", features = ["derive"] } -serde_json = { version = "1.0.128", features = ["preserve_order"] } -serde_yaml = { version = "0.9.3" } -thiserror = "1.0.0" +schemars = { version = "0.8", features = ["preserve_order"] } +serde = { version = "1.0", features = ["derive"] } +serde_json = { version = "1.0", features = ["preserve_order"] } +serde_yaml = { version = "0.9" } +thiserror = "1.0" security_context_lib = { path = "../security_context_lib" } -semver = "1.0.0" -tokio = { version = "1.40.0", features = ["full"] } -tracing = "0.1.37" -tracing-indicatif = { version = "0.3.6" } -tree-sitter = "0.24.3" -tree-sitter-rust = "0.23.0" +semver = "1.0" +tokio = { version = "1.41", features = ["full"] } +tracing = "0.1" +tracing-indicatif = { version = "0.3" } +tree-sitter = "0.24" +tree-sitter-rust = "0.23" tree-sitter-dscexpression = { path = "../tree-sitter-dscexpression" } [dev-dependencies] -serde_yaml = "0.9.3" +serde_yaml = "0.9" [build-dependencies] cc="1.1" diff --git a/osinfo/Cargo.toml b/osinfo/Cargo.toml index ad745d3d..b83f0e7d 100644 --- a/osinfo/Cargo.toml +++ b/osinfo/Cargo.toml @@ -6,6 +6,6 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -os_info = { version = "3.7.0" } -serde = { version = "1.0.0", features = ["derive"] } -serde_json = { version = "1.0.0", features = ["preserve_order"] } +os_info = { version = "3.7" } +serde = { version = "1.0", features = ["derive"] } +serde_json = { version = "1.0", features = ["preserve_order"] } diff --git a/pal/Cargo.toml b/pal/Cargo.toml index 06c821de..a75d6c5b 100644 --- a/pal/Cargo.toml +++ b/pal/Cargo.toml @@ -13,4 +13,4 @@ opt-level = 2 lto = true [build-dependencies] -cc = "1.1.20" +cc = "1.1" diff --git a/process/Cargo.toml b/process/Cargo.toml index fec2dba2..66d599a7 100644 --- a/process/Cargo.toml +++ b/process/Cargo.toml @@ -4,6 +4,6 @@ version = "0.1.0" edition = "2021" [dependencies] -sysinfo = "0.31.2" -serde = { version = "1.0.0", features = ["derive"] } -serde_json = { version = "1.0.0", features = ["preserve_order"] } +sysinfo = "0.31" +serde = { version = "1.0", features = ["derive"] } +serde_json = { version = "1.0", features = ["preserve_order"] } diff --git a/registry/Cargo.toml b/registry/Cargo.toml index 6a954c97..2550f8d1 100644 --- a/registry/Cargo.toml +++ b/registry/Cargo.toml @@ -14,16 +14,16 @@ lto = true lto = true [dependencies] -clap = { version = "4.5.20", features = ["derive"] } -crossterm = "0.28.1" -registry = "1.2.3" -schemars = "0.8.0" -serde = "1.0.130" -serde_json = "1.0.68" -thiserror = "1.0.64" -tracing = { version = "0.1.37" } -tracing-subscriber = { version = "0.3.17", features = ["ansi", "env-filter", "json"] } -utfx = "0.1.0" +clap = { version = "4.5", features = ["derive"] } +crossterm = "0.28" +registry = "1.2" +schemars = "0.8" +serde = "1.0" +serde_json = "1.0" +thiserror = "1.0" +tracing = { version = "0.1" } +tracing-subscriber = { version = "0.3", features = ["ansi", "env-filter", "json"] } +utfx = "0.1" [build-dependencies] static_vcruntime = "2.0" diff --git a/runcommandonset/Cargo.toml b/runcommandonset/Cargo.toml index f61792a5..3eff0b7f 100644 --- a/runcommandonset/Cargo.toml +++ b/runcommandonset/Cargo.toml @@ -6,8 +6,8 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -clap = { version = "4.4.0", features = ["derive"] } -serde = { version = "1.0.0", features = ["derive"] } -serde_json = { version = "1.0.0", features = ["preserve_order"] } -tracing = { version = "0.1.37" } -tracing-subscriber = { version = "0.3.17", features = ["ansi", "env-filter", "json"] } +clap = { version = "4.4", features = ["derive"] } +serde = { version = "1.0", features = ["derive"] } +serde_json = { version = "1.0", features = ["preserve_order"] } +tracing = { version = "0.1" } +tracing-subscriber = { version = "0.3", features = ["ansi", "env-filter", "json"] } diff --git a/security_context_lib/Cargo.toml b/security_context_lib/Cargo.toml index 9d58ccb2..eebb7cff 100644 --- a/security_context_lib/Cargo.toml +++ b/security_context_lib/Cargo.toml @@ -4,7 +4,7 @@ version = "0.1.0" edition = "2021" [target.'cfg(target_os = "windows")'.dependencies] -is_elevated = "0.1.0" +is_elevated = "0.1" [target.'cfg(not(target_os = "windows"))'.dependencies] -nix = { version = "0.29.0", features = ["user"] } +nix = { version = "0.29", features = ["user"] } diff --git a/tools/test_group_resource/Cargo.lock b/tools/test_group_resource/Cargo.lock index 16638746..9775a5e8 100644 --- a/tools/test_group_resource/Cargo.lock +++ b/tools/test_group_resource/Cargo.lock @@ -1371,9 +1371,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index 6d2d2c20..e0e4a05d 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -20,9 +20,9 @@ include = [ path = "bindings/rust/lib.rs" [dependencies] -tree-sitter-rust = "0.23.0" -tree-sitter = "0.24.3" -tree-sitter-language = "0.1.2" +tree-sitter-rust = "0.23" +tree-sitter = "0.24" +tree-sitter-language = "0.1" [build-dependencies] cc = "1.1" From 21ece26f9726b9f836a98330ca46a27eebbe22c6 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Sat, 26 Oct 2024 16:15:27 -0700 Subject: [PATCH 08/13] rename linux CI build --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7f738a83..620fdcde 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -28,7 +28,7 @@ jobs: # shell: pwsh # run: ./build.ps1 -test - build-musl: + build-linux: runs-on: ubuntu-latest From 3504c5b3cc2170305e3a5a420383f9dffaed549d Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Sat, 26 Oct 2024 16:29:14 -0700 Subject: [PATCH 09/13] update build script to try to always auth --- build.ps1 | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.ps1 b/build.ps1 index a03894c5..eff5f473 100644 --- a/build.ps1 +++ b/build.ps1 @@ -195,9 +195,7 @@ if (!$SkipBuild) { throw "Azure CLI not found" } - if ($null -ne $env:CARGO_REGISTRIES_POWERSHELL_TOKEN) { - Write-Host "Using existing token" - } else { + 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) { @@ -208,6 +206,9 @@ if (!$SkipBuild) { $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' } } + else { + Write-Warning "Azure CLI not found, proceeding with anonymous access." + } } # make sure dependencies are built first so clippy runs correctly From e2ef50c021086e3b80c9576d67e5a808a02b18ef Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Sat, 26 Oct 2024 16:38:33 -0700 Subject: [PATCH 10/13] don't force auth if can't get token --- build.ps1 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build.ps1 b/build.ps1 index eff5f473..15e77f47 100644 --- a/build.ps1 +++ b/build.ps1 @@ -200,6 +200,7 @@ if (!$SkipBuild) { $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." + $env:CARGO_REGISITRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" } else { $header = "Bearer $accessToken" $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header @@ -208,6 +209,7 @@ if (!$SkipBuild) { } else { Write-Warning "Azure CLI not found, proceeding with anonymous access." + $env:CARGO_REGISITRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" } } From c75e1d77a99af455c1c7f835f842bfb02391616b Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Sat, 26 Oct 2024 16:41:05 -0700 Subject: [PATCH 11/13] fix typo --- build.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.ps1 b/build.ps1 index 15e77f47..839c2ad2 100644 --- a/build.ps1 +++ b/build.ps1 @@ -200,7 +200,7 @@ if (!$SkipBuild) { $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." - $env:CARGO_REGISITRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" + $env:CARGO_REGISTRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" } else { $header = "Bearer $accessToken" $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header @@ -209,7 +209,7 @@ if (!$SkipBuild) { } else { Write-Warning "Azure CLI not found, proceeding with anonymous access." - $env:CARGO_REGISITRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" + $env:CARGO_REGISTRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" } } From 0db783be40abd5cfdab6575b8811b6d640784f6d Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 28 Oct 2024 12:31:55 -0700 Subject: [PATCH 12/13] update build script to default to anonymous CFS and strip release binaries --- .cargo/config.toml | 2 +- build.ps1 | 38 +++++++++++++++------------- dsc_lib/Cargo.toml | 7 +++++ osinfo/Cargo.toml | 7 ++++- registry/Cargo.toml | 3 --- runcommandonset/Cargo.toml | 7 ++++- security_context_lib/Cargo.toml | 7 +++++ tree-sitter-dscexpression/Cargo.toml | 7 +++++ y2j/Cargo.toml | 7 +++++ 9 files changed, 61 insertions(+), 24 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index 8945e070..7e2bf62b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,7 +3,7 @@ registry-auth = true [registries] -POWERSHELL = { index = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell~force-auth/Cargo/index/" } +POWERSHELL = { index = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" } [registry] global-credential-providers = ["cargo:token"] diff --git a/build.ps1 b/build.ps1 index 839c2ad2..9cc8b4b1 100644 --- a/build.ps1 +++ b/build.ps1 @@ -15,7 +15,8 @@ param( [switch]$UseX64MakeAppx, [switch]$UseCratesIO, [switch]$UpdateLockFile, - [switch]$Audit + [switch]$Audit, + [switch]$UseCFSAuth ) if ($GetPackageVersion) { @@ -191,25 +192,26 @@ if (!$SkipBuild) { ${env:CARGO_SOURCE_crates-io_REPLACE_WITH} = $null $env:CARGO_REGISTRIES_CRATESIO_INDEX = $null - if ($null -eq (Get-Command 'az' -ErrorAction Ignore)) { - throw "Azure CLI not found" - } + if ($UseCFSAuth -or $null -ne $env:TF_BUILD) { + 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." - $env:CARGO_REGISTRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" - } else { - $header = "Bearer $accessToken" - $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header - $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' + 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_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell~force-auth/Cargo/index/" + $env:CARGO_REGISTRIES_POWERSHELL_TOKEN = $header + $env:CARGO_REGISTRIES_POWERSHELL_CREDENTIAL_PROVIDER = 'cargo:token' + } + } + else { + Write-Warning "Azure CLI not found, proceeding with anonymous access." } - } - else { - Write-Warning "Azure CLI not found, proceeding with anonymous access." - $env:CARGO_REGISTRIES_POWERSHELL_INDEX = "sparse+https://pkgs.dev.azure.com/powershell/PowerShell/_packaging/powershell/Cargo/index/" } } diff --git a/dsc_lib/Cargo.toml b/dsc_lib/Cargo.toml index e49321b0..049dab8b 100644 --- a/dsc_lib/Cargo.toml +++ b/dsc_lib/Cargo.toml @@ -3,6 +3,13 @@ name = "dsc_lib" version = "3.0.0" edition = "2021" +[profile.release] +strip = true +# optimize for size +opt-level = 2 +# enable link time optimization to remove dead code +lto = true + [dependencies] base64 = "0.22" chrono = "0.4" diff --git a/osinfo/Cargo.toml b/osinfo/Cargo.toml index b83f0e7d..f339f9df 100644 --- a/osinfo/Cargo.toml +++ b/osinfo/Cargo.toml @@ -3,7 +3,12 @@ name = "osinfo" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[profile.release] +strip = true +# optimize for size +opt-level = 2 +# enable link time optimization to remove dead code +lto = true [dependencies] os_info = { version = "3.7" } diff --git a/registry/Cargo.toml b/registry/Cargo.toml index 2550f8d1..b8c8a8f6 100644 --- a/registry/Cargo.toml +++ b/registry/Cargo.toml @@ -10,9 +10,6 @@ opt-level = 2 # enable link time optimization to remove dead code lto = true -[profile.dev] -lto = true - [dependencies] clap = { version = "4.5", features = ["derive"] } crossterm = "0.28" diff --git a/runcommandonset/Cargo.toml b/runcommandonset/Cargo.toml index 3eff0b7f..00d4a998 100644 --- a/runcommandonset/Cargo.toml +++ b/runcommandonset/Cargo.toml @@ -3,7 +3,12 @@ name = "runcommandonset" version = "0.1.0" edition = "2021" -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html +[profile.release] +strip = true +# optimize for size +opt-level = 2 +# enable link time optimization to remove dead code +lto = true [dependencies] clap = { version = "4.4", features = ["derive"] } diff --git a/security_context_lib/Cargo.toml b/security_context_lib/Cargo.toml index eebb7cff..75184245 100644 --- a/security_context_lib/Cargo.toml +++ b/security_context_lib/Cargo.toml @@ -3,6 +3,13 @@ name = "security_context_lib" version = "0.1.0" edition = "2021" +[profile.release] +strip = true +# optimize for size +opt-level = 2 +# enable link time optimization to remove dead code +lto = true + [target.'cfg(target_os = "windows")'.dependencies] is_elevated = "0.1" diff --git a/tree-sitter-dscexpression/Cargo.toml b/tree-sitter-dscexpression/Cargo.toml index e0e4a05d..689dbfc8 100644 --- a/tree-sitter-dscexpression/Cargo.toml +++ b/tree-sitter-dscexpression/Cargo.toml @@ -19,6 +19,13 @@ include = [ [lib] path = "bindings/rust/lib.rs" +[profile.release] +strip = true +# optimize for size +opt-level = 2 +# enable link time optimization to remove dead code +lto = true + [dependencies] tree-sitter-rust = "0.23" tree-sitter = "0.24" diff --git a/y2j/Cargo.toml b/y2j/Cargo.toml index c0729cfc..7e65656f 100644 --- a/y2j/Cargo.toml +++ b/y2j/Cargo.toml @@ -3,6 +3,13 @@ name = "y2j" version = "1.0.0" edition = "2021" +[profile.release] +strip = true +# optimize for size +opt-level = 2 +# enable link time optimization to remove dead code +lto = true + [dependencies] serde_json = { version = "1.0.0", features = ["preserve_order"] } serde_yaml = { version = "0.9.3" } From 420150ef1e32ba17851cd73adc49cebfefd55331 Mon Sep 17 00:00:00 2001 From: Steve Lee Date: Mon, 28 Oct 2024 13:30:39 -0700 Subject: [PATCH 13/13] fix use of $architecture variable in build script --- .pipelines/DSC-Official.yml | 2 +- build.ps1 | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.pipelines/DSC-Official.yml b/.pipelines/DSC-Official.yml index 8ef74b68..3bc4351a 100644 --- a/.pipelines/DSC-Official.yml +++ b/.pipelines/DSC-Official.yml @@ -5,7 +5,7 @@ pr: branches: include: - onebranch - - v3.* + - release/v* schedules: - cron: '0 3 * * 1' diff --git a/build.ps1 b/build.ps1 index 9cc8b4b1..680e9048 100644 --- a/build.ps1 +++ b/build.ps1 @@ -661,13 +661,15 @@ if ($packageType -eq 'msixbundle') { } # for Linux, we only build musl as its statically linked, so we remove the musl suffix - if ($architecture -eq 'aarch64-unknown-linux-musl') { - $architecture = 'aarch64-linux' + $productArchitecture = if ($architecture -eq 'aarch64-unknown-linux-musl') { + 'aarch64-linux' } elseif ($architecture -eq 'x86_64-unknown-linux-musl') { - $architecture = 'x86_64-linux' + 'x86_64-linux' + } else { + $architecture } - $packageName = "DSC-$productVersion-$architecture.tar" + $packageName = "DSC-$productVersion-$productArchitecture.tar" $tarFile = Join-Path $PSScriptRoot 'bin' $packageName tar cvf $tarFile -C $tgzTarget . if ($LASTEXITCODE -ne 0) {