-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat: Add musl-gcc static linking support for Linux builds (#2998) #4346
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
leaanthony
wants to merge
9
commits into
master
Choose a base branch
from
v3/feature-2998-musl-static-linking
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5c64e18
feat: Add musl-gcc static linking support for Linux builds
leaanthony 3916554
Update v3/internal/commands/build_assets/linux/Taskfile.yml
leaanthony 6051b7c
Update v3/internal/commands/build_assets/linux/Taskfile.yml
leaanthony 7b31e4d
fix: Address CodeRabbit feedback for YAML syntax and functionality
leaanthony a211910
fix: Only set CC=musl-gcc when static linking is enabled
leaanthony a200d3b
fix: Remove newlines from BUILD_FLAGS template to prevent command par…
leaanthony 26a3bba
Merge branch 'v3-alpha' into v3/feature-2998-musl-static-linking
leaanthony d4217b9
Merge branch 'v3-alpha' into v3/feature-2998-musl-static-linking
leaanthony 35794b1
Merge branch 'v3-alpha' into v3/feature-2998-musl-static-linking
leaanthony File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,12 +7,42 @@ import ( | |
| "github.com/wailsapp/wails/v3/internal/flags" | ||
| ) | ||
|
|
||
| func Build(_ *flags.Build) error { | ||
| return wrapTask("build") | ||
| func Build(options *flags.Build) error { | ||
| taskName := "build" | ||
|
|
||
| // If static flag is enabled, use the static build task | ||
| if options.Static { | ||
| taskName = "build:static" | ||
| } | ||
|
|
||
| // Set up environment variables for the task | ||
| if options.Static { | ||
| os.Setenv("STATIC", "true") | ||
| } | ||
| if options.Compiler != "" { | ||
| os.Setenv("CC", options.Compiler) | ||
| } | ||
|
Comment on lines
+22
to
+24
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Unset Once if options.Compiler != "" {
os.Setenv("CC", options.Compiler)
+ } else {
+ _ = os.Unsetenv("CC")
}Also applies to: 41-43 🤖 Prompt for AI Agents |
||
|
|
||
| return wrapTask(taskName) | ||
| } | ||
|
|
||
| func Package(_ *flags.Package) error { | ||
| return wrapTask("package") | ||
| func Package(options *flags.Package) error { | ||
| taskName := "package" | ||
|
|
||
| // If static flag is enabled, use the static package task | ||
| if options.Static { | ||
| taskName = "package:static" | ||
| } | ||
|
|
||
| // Set up environment variables for the task | ||
| if options.Static { | ||
| os.Setenv("STATIC", "true") | ||
| } | ||
| if options.Compiler != "" { | ||
| os.Setenv("CC", options.Compiler) | ||
| } | ||
|
|
||
| return wrapTask(taskName) | ||
| } | ||
|
|
||
| func wrapTask(command string) error { | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
YAML syntax error – quoting breaks the Taskfile
yamllintflags line 21. Single quotes can’t contain back-slash-escaped single quotes. Switch the outer quotes to double quotes or double the inner single quotes.Replicate the same quoting fix for the
CCenv on line 27 and for thebuild:statictask (line 42).📝 Committable suggestion
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 21-21: syntax error: expected , but found ''
(syntax)
🤖 Prompt for AI Agents