Skip to content

Commit

Permalink
fix: add .cargo/config.toml with profile.release set to false
Browse files Browse the repository at this point in the history
Updated Parse-Rustflags script to modify existing config
  • Loading branch information
deevus committed Feb 16, 2025
1 parent 531b7c9 commit 28ebf8b
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[target."cfg(all())"]
rustflags = []
[profile.release]
debug = "False"
7 changes: 6 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ jobs:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- name: Install PSToml module
shell: pwsh
run: Install-Module -Name PSToml -Scope CurrentUser

- name: Checkout self
uses: actions/checkout@v4

Expand All @@ -55,7 +59,8 @@ jobs:
workspaces: "zed -> target"

- name: Setup rustflags
run: pwsh ./Parse-Rustflags.ps1 ${{ matrix.rustflags }}
shell: pwsh
run: ./Parse-Rustflags.ps1 ${{ matrix.rustflags }}

- name: Build release
working-directory: zed
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
zed/
14 changes: 3 additions & 11 deletions Parse-Rustflags.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@ if ($rustflags.Length -eq 0) {
}

$config_path = ".cargo/config.toml"

New-Item -Path $config_path -Force | Out-Null

"[target.'cfg(all())']" | Out-File -FilePath $config_path -Append | Out-Null

"rustflags = [" | Out-File -FilePath $config_path -Append -NoNewLine | Out-Null
foreach ($flag in $rustflags) {
$line = """${flag}"", "
$line | Out-File -FilePath $config_path -Append -NoNewLine | Out-Null
}
"]" | Out-File -FilePath $config_path -Append | Out-Null
$config = Get-Content $config_path | ConvertFrom-Toml
$config.target.Item("cfg(all())").rustflags = $rustflags
$config | ConvertTo-Toml -Depth 5 | Out-File $config_path

0 comments on commit 28ebf8b

Please sign in to comment.