Skip to content

Add ODIN_BUILD_FLAGS environment variable #5184

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Feoramund
Copy link
Contributor

This change appends each space-separated flag in the ODIN_BUILD_FLAGS environment variable to build-mode commands, allowing users to have default flags for the build/test/run actions.

Note that it will complain if you explicitly use a flag that is already in your environment variable, just as if you typed it. This doesn't do anything too magical.

If there's a need for an ODIN_CHECK_FLAGS, I can add that too.

This change appends each space-separated flag in the `ODIN_BUILD_FLAGS`
environment variable to build-mode commands, allowing users to have
default flags for the build/test/run actions.
@Kelimion
Copy link
Member

Kelimion commented May 20, 2025

I've been thinking on and off to add a -flags:<filename> option for the same purpose, so you can express your common flags in one go. Obviously the -flags option would be disallowed if encountered in a file, or this could go ad infinitum.

Let's see what @gingerBill makes of it.

@gingerBill
Copy link
Member

It is a good question whether an environment variable or a file is better. I know many people want this but I do worry it'll make things a little more complicated.

@Feoramund
Copy link
Contributor Author

I know many people want this but I do worry it'll make things a little more complicated.

I can see that happening now that I think about it, whether it's a file or an environment variable.

I'm okay with dropping this PR. Most shells I've used have some support for aliases, and failing that, people can put an executable script in their PATH as a shortcut that adds certain flags they use often.

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