Skip to content
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

common/environment/build-style/go.sh: allow setting CGO_ENABLED #41167

Merged
merged 1 commit into from
Jan 13, 2023

Conversation

sug0
Copy link
Contributor

@sug0 sug0 commented Dec 18, 2022

Change hard-coded value of CGO_ENABLED to allow reading a user configured value from a template file. This is required to fix a segmentation fault in #40919, derived from some kind of linking error. The default behavior is kept, i.e. cgo is still enabled by default, which shouldn't break any packages.

Testing the changes

  • I tested the changes in this PR: briefly

@Vaelatern
Copy link
Member

Why :-?

@sug0
Copy link
Contributor Author

sug0 commented Jan 13, 2023

I found it the most practical way to maintain the old value, if CGO_ENABLED was not set in the env
@Vaelatern is there any issue with using ${VAR:-$DEFAULT_VALUE}?

@Vaelatern
Copy link
Member

makes it look like you mean negative instead of :=

@classabbyamp
Copy link
Member

classabbyamp commented Jan 13, 2023

:- and := do different things, :- wil substitute the default if null or unset, := will assign the default if null or unset. which is the desired behaviour?

In all cases shown with "substitute", the expression is replaced with the value shown. In all cases shown with "assign", parameter is assigned that value, which also replaces the expression.

@sug0
Copy link
Contributor Author

sug0 commented Jan 13, 2023

:- seems like the best option here. := will do two assignments, since CGO_ENABLED is set again and exported on the left. either way, both would work here. can you tell me which of the two you prefer?

:- and := do different things, :- wil substitute the default if null or unset, := will assign the default if null or unset. which is the desired behaviour?

In all cases shown with "substitute", the expression is replaced with the value shown. In all cases shown with "assign", parameter is assigned that value, which also replaces the expression.

@Vaelatern
Copy link
Member

@classabbyamp I'm ok either way, you want to merge?

@classabbyamp classabbyamp merged commit 6bbd416 into void-linux:master Jan 13, 2023
@sug0
Copy link
Contributor Author

sug0 commented Jan 14, 2023

cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants