-
-
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
5c64e18
3916554
6051b7c
7b31e4d
a211910
a200d3b
26a3bba
d4217b9
35794b1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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) | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+18
to
+26
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. 🛠️ Refactor suggestion Environment variables linger between successive calls
- if options.Static {
- os.Setenv("STATIC", "true")
- }
+ if options.Static {
+ os.Setenv("STATIC", "true")
+ } else {
+ _ = os.Unsetenv("STATIC")
+ }Apply the same pattern for 📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents
Member
Author
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. Is that true though? The cli will have exited and been restarted. Aren't environment variables only active for the duration of the process?
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. @leaanthony The only time the “lingering” could bite us is if, inside one single process, we called both So the extra |
||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| 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 { | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
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