Faster debug builds (#2483)

* Config dev profile for faster debug builds

* Remove redundant changes to Cargo.toml in CI

* Forgot Windows

---------

Co-authored-by: Vítor Vasconcellos <vasconcellos.dev@gmail.com>
This commit is contained in:
Consoli 2024-05-14 02:59:52 -03:00 committed by GitHub
parent 518d5836f6
commit f4a79a2fcd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 21 deletions

View file

@ -34,27 +34,6 @@ runs:
shell: bash
run: echo '{}' | npx -y mustache - .cargo/config.toml.mustache .cargo/config.toml
- name: Turn Off Debuginfo and bump opt-level
shell: bash
if: ${{ runner.os != 'Windows' }}
run: |
sed '/\[profile.dev]/a\
debug = 0
' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml
sed '/\[profile.dev]/a\
opt-level=1
' Cargo.toml > Cargo.toml.tmp && mv Cargo.toml.tmp Cargo.toml
- name: Turn Off Debuginfo and bump opt-level
if: ${{ runner.os == 'Windows' }}
shell: powershell
run: |
(Get-Content Cargo.toml) -replace '\[profile.dev\]', '[profile.dev]
debug = 0' | Set-Content Cargo.toml
(Get-Content Cargo.toml) -replace '\[profile.dev\]', '[profile.dev]
opt-level=1' | Set-Content Cargo.toml
- name: Restore cached Prisma codegen
id: cache-prisma-restore
uses: actions/cache/restore@v4

View file

@ -108,6 +108,12 @@ pdfium-render = { git = "https://github.com/fogodev/pdfium-render.git", rev = "e
[profile.dev]
# Make compilation faster on macOS
split-debuginfo = "unpacked"
opt-level = 0
debug = 0
strip = "none"
lto = false
codegen-units = 256
incremental = true
# Set the settings for build scripts and proc-macros.
[profile.dev.build-override]