Эх сурвалжийг харах

feat(cli): add `rustls` as default Cargo feature (#6900)

Lucas Fernandes Nogueira 2 жил өмнө
parent
commit
2659ca1ab4

+ 6 - 0
.changes/rustls-default.md

@@ -0,0 +1,6 @@
+---
+"cli.rs": patch
+"cli.js": patch
+---
+
+Add `rustls` as default Cargo feature.

+ 11 - 11
.github/workflows/publish-cli-js.yml

@@ -30,14 +30,14 @@ jobs:
             target: x86_64-apple-darwin
             architecture: x64
             build: |
-              yarn build:release --features rustls
+              yarn build:release
               strip -x *.node
           - host: windows-latest
-            build: yarn build:release --features rustls
+            build: yarn build:release
             target: x86_64-pc-windows-msvc
             architecture: x64
           - host: windows-latest
-            build: yarn build:release --features rustls --target i686-pc-windows-msvc
+            build: yarn build:release --target i686-pc-windows-msvc
             target: i686-pc-windows-msvc
             architecture: x64
           - host: ubuntu-20.04
@@ -45,26 +45,26 @@ jobs:
             docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian
             build: |
               cd tooling/cli/node
-              yarn build:release --features rustls --target x86_64-unknown-linux-gnu
+              yarn build:release --target x86_64-unknown-linux-gnu
               strip *.node
           - host: ubuntu-20.04
             target: x86_64-unknown-linux-musl
             docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine
             build: |
               cd tooling/cli/node
-              yarn build:release --features rustls
+              yarn build:release
               strip *.node
           - host: macos-latest
             target: aarch64-apple-darwin
             build: |
-              yarn build:release --features rustls --target=aarch64-apple-darwin
+              yarn build:release --target=aarch64-apple-darwin
               strip -x *.node
           - host: ubuntu-20.04
             target: aarch64-unknown-linux-gnu
             docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64
             build: |
               cd tooling/cli/node
-              yarn build:release --features rustls --target aarch64-unknown-linux-gnu
+              yarn build:release --target aarch64-unknown-linux-gnu
               aarch64-unknown-linux-gnu-strip *.node
           - host: ubuntu-20.04
             architecture: x64
@@ -73,7 +73,7 @@ jobs:
               sudo apt-get update
               sudo apt-get install gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf -y
             build: |
-              yarn build:release --features rustls --target=armv7-unknown-linux-gnueabihf
+              yarn build:release --target=armv7-unknown-linux-gnueabihf
               arm-linux-gnueabihf-strip *.node
           - host: ubuntu-20.04
             architecture: x64
@@ -82,12 +82,12 @@ jobs:
             build: |
               cd tooling/cli/node
               rustup target add aarch64-unknown-linux-musl
-              yarn build:release --features rustls --target aarch64-unknown-linux-musl
+              yarn build:release --target aarch64-unknown-linux-musl
               /aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node
           #- host: windows-latest
           #  architecture: x64
           #  target: aarch64-pc-windows-msvc
-          #  build: yarn build:release --features rustls --target aarch64-pc-windows-msvc
+          #  build: yarn build:release --target aarch64-pc-windows-msvc
     name: stable - ${{ matrix.settings.target }} - node@16
     runs-on: ${{ matrix.settings.host }}
     steps:
@@ -179,7 +179,7 @@ jobs:
   #            freebsd-version
   #            cd ./tooling/cli/node/
   #            yarn install --ignore-scripts --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
-  #            yarn build:release --features rustls
+  #            yarn build:release
   #            strip -x *.node
   #            rm -rf node_modules
   #            rm -rf ../target

+ 2 - 1
tooling/bundler/Cargo.toml

@@ -64,6 +64,7 @@ name = "tauri_bundler"
 path = "src/lib.rs"
 
 [features]
-default = [ "attohttpc/default" ]
+default = [ "native-tls" ]
+native-tls = [ "attohttpc/tls-native" ]
 native-tls-vendored = [ "attohttpc/tls-native-vendored" ]
 rustls = [ "attohttpc/rustls" ]

+ 0 - 1
tooling/cli/Cargo.lock

@@ -179,7 +179,6 @@ version = "0.24.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "8d9a9bf8b79a749ee0b911b91b671cc2b6c670bdbc7e3dfd537576ddc94bb2a2"
 dependencies = [
- "flate2",
  "http",
  "log",
  "native-tls",

+ 2 - 1
tooling/cli/Cargo.toml

@@ -92,6 +92,7 @@ libc = "0.2"
 lto = true
 
 [features]
-default = [ "tauri-bundler/default" ]
+default = [ "rustls" ]
+native-tls = [ "tauri-bundler/native-tls" ]
 native-tls-vendored = [ "tauri-bundler/native-tls-vendored" ]
 rustls = [ "tauri-bundler/rustls" ]

+ 1 - 5
tooling/cli/node/Cargo.toml

@@ -10,12 +10,8 @@ crate-type = ["cdylib"]
 # Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
 napi = { version = "2.12", default-features = false, features = ["napi4"] }
 napi-derive = "2.12"
-tauri-cli = { path = "..", default-features = false }
+tauri-cli = { path = ".." }
 log = "0.4.17"
 
 [build-dependencies]
 napi-build = "2.0"
-
-[features]
-native-tls-vendored = ["tauri-cli/native-tls-vendored"]
-rustls = ["tauri-cli/rustls"]