Skip to content

Commit

Permalink
perf: remove lto setting from CLI (#6861)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucas Nogueira <[email protected]>
  • Loading branch information
CrabNejonas and lucasfernog committed Aug 14, 2023
1 parent d928d23 commit 02eb08b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/publish-cli-rs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path ./tooling/cli/Cargo.toml --release ${{ matrix.config.args }}
args: --manifest-path ./tooling/cli/Cargo.toml --profile release-size-optimized ${{ matrix.config.args }}

- name: Upload CLI
uses: actions/upload-artifact@v3
with:
name: cargo-tauri-${{ matrix.config.rust_target }}${{ matrix.config.ext }}
path: tooling/cli/target/release/cargo-tauri${{ matrix.config.ext }}
path: tooling/cli/target/release-size-optimized/cargo-tauri${{ matrix.config.ext }}
if-no-files-found: error

upload:
Expand Down
10 changes: 7 additions & 3 deletions tooling/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ cc = "1"
[target."cfg(unix)".dependencies]
libc = "0.2"

[profile.release]
lto = true

[features]
default = [ "rustls" ]
native-tls = [
Expand All @@ -118,3 +115,10 @@ native-tls-vendored = [
"tauri-mobile/openssl-vendored"
]
rustls = [ "tauri-bundler/rustls", "tauri-mobile/rustls", "ureq/tls" ]

[profile.release-size-optimized]
inherits = "release"
codegen-units = 1
lto = true
incremental = false
opt-level = "s"
5 changes: 3 additions & 2 deletions tooling/cli/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
},
"scripts": {
"artifacts": "napi artifacts",
"build:release": "cross-env TARGET=node napi build --platform --release",
"build:release": "cross-env TARGET=node napi build --platform --profile release-size-optimized",
"build": "cross-env TARGET=node napi build --platform",
"prepublishOnly": "napi prepublish -t npm --gh-release-id $RELEASE_ID",
"prepack": "cp ../schema.json .",
Expand All @@ -67,5 +67,6 @@
"tauri": "node ./tauri.js",
"format": "prettier --write ./package.json ./tauri.js",
"format:check": "prettier --check ./package.json ./tauri.js"
}
},
"dependencies": {}
}

0 comments on commit 02eb08b

Please sign in to comment.