Skip to content

Commit

Permalink
Keep opt profile
Browse files Browse the repository at this point in the history
Based on the suggestion from archseer, the release build will use opt.
The release profile will be separate for testing purposes.
  • Loading branch information
janos-r committed Jan 16, 2025
1 parent ef07562 commit 8570907
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ jobs:
run: ${{ env.CARGO }} test --release --locked --target ${{ matrix.target }} --workspace

- name: Build release binary
run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}
run: ${{ env.CARGO }} build --profile opt --locked --target ${{ matrix.target }}

- name: Build AppImage
shell: bash
Expand All @@ -175,7 +175,7 @@ jobs:
mkdir -p "$APP.AppDir"/usr/{bin,lib/helix}
cp "target/${{ matrix.target }}/release/hx" "$APP.AppDir/usr/bin/hx"
cp "target/${{ matrix.target }}/opt/hx" "$APP.AppDir/usr/bin/hx"
rm -rf runtime/grammars/sources
cp -r runtime "$APP.AppDir/usr/lib/helix/runtime"
Expand Down Expand Up @@ -204,7 +204,7 @@ jobs:
run: |
cargo install cargo-deb
mkdir -p target/release
cp target/${{ matrix.target }}/release/hx target/release/
cp target/${{ matrix.target }}/opt/hx target/release/
cargo deb --no-build
mkdir -p dist
mv target/debian/*.deb dist/
Expand All @@ -214,9 +214,9 @@ jobs:
run: |
mkdir -p dist
if [ "${{ matrix.os }}" = "windows-2019" ]; then
cp "target/${{ matrix.target }}/release/hx.exe" "dist/"
cp "target/${{ matrix.target }}/opt/hx.exe" "dist/"
else
cp "target/${{ matrix.target }}/release/hx" "dist/"
cp "target/${{ matrix.target }}/opt/hx" "dist/"
fi
if [ -d runtime/grammars/sources ]; then
rm -rf runtime/grammars/sources
Expand Down
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ default-members = [
]

[profile.release]
lto = "thin"

[profile.opt]
lto = "fat"
codegen-units = 1
strip = true
Expand Down
2 changes: 1 addition & 1 deletion book/src/building-from-source.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ to package the runtime into `/usr/lib/helix/runtime`. The rough steps a build
script could follow are:

1. `export HELIX_DEFAULT_RUNTIME=/usr/lib/helix/runtime`
1. `cargo build --release --locked`
1. `cargo build --profile opt --locked`
1. `cp -r runtime $BUILD_DIR/usr/lib/helix/`
1. `cp target/opt/hx $BUILD_DIR/usr/bin/hx`

Expand Down

0 comments on commit 8570907

Please sign in to comment.