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

Use native files for saving the command line #4637

Open
dcbaker opened this issue Dec 14, 2018 · 14 comments
Open

Use native files for saving the command line #4637

dcbaker opened this issue Dec 14, 2018 · 14 comments
Assignees

Comments

@dcbaker
Copy link
Member

dcbaker commented Dec 14, 2018

Several people have asked for the ability to get their command line back in a form they can feed back into meson. Since we already store that in a nice form it should be pretty easy to print it back for them.

@dcbaker dcbaker self-assigned this Dec 14, 2018
@xclaesse
Copy link
Member

Do you have a use-cases for that? Since we have --wipe already I'm not sure why you would want the command line.

@dcbaker
Copy link
Member Author

dcbaker commented Dec 15, 2018

Yes, one of the mesa developers has a lot of different machines he works on (it's a hardware driver thing), and wants to be able to get the configuration back in a form he can copy to another machine. BTW, thanks for doing the --wipe thing.

@xclaesse
Copy link
Member

Sounds legit to me, shouldn't be too hard to implement.

@jpakkane
Copy link
Member

Alternatively, if the native file was a bit more fleshed out, we could make this output a native file for later usage. It has the additional niceness that it can be used in other projects directly.

@dcbaker
Copy link
Member Author

dcbaker commented Dec 17, 2018

I actually like the native file idea. We could just replace the internal cmd_line.txt with a native file, which has the added advantage of not allowing us to break the format accidentally

@xclaesse
Copy link
Member

We don't write configure options in the native/cross files, so that would be a whole new concept in itself.

@dcbaker
Copy link
Member Author

dcbaker commented Dec 17, 2018

@jpakkane suggested it in #4636

@marc-h38
Copy link
Contributor

marc-h38 commented Feb 6, 2020

https://github.com/keith-packard/picolibc/tree/80528c684 has a collection of do-xxx-configure scripts that seem to workaround the lack of this.

As pointed by @eli-schwartz on IRC, Autotools have CONFIG_SITE
https://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/Site-Defaults.html

options set shell variables that have the same names as the options, with any dashes turned into underscores

@xclaesse
Copy link
Member

xclaesse commented Feb 6, 2020

I think we should add something like this to native/cross files:

[options]
prefix = '/system'
libdir = 'lib'
some_subproject:some_option = 'some value'

Those would be default values that could still be overridden by -Dprefix=/something.

Should be easy to implement and that covers the picolibc use-case. It makes a lot of sense to me, it's really common when cross compiling to a given platform to have specific values for options.

@dcbaker
Copy link
Member Author

dcbaker commented Feb 6, 2020

you can already set paths via the [paths] section

for other things that's what #3001 is about, which I'm working on.

@dcbaker
Copy link
Member Author

dcbaker commented Feb 6, 2020

@marc-h38 I've been meaning to propose a "default" native file, but I was going to do that after #3001

@eli-schwartz
Copy link
Member

Yes, having meson automatically load /usr/share/meson/siteconfig as a native file would be very nice and a good analogue to autotools' $CONFIG_SITE file.

@germandiagogomez
Copy link
Contributor

I support this feature of having native files config things. I am having the need for this with so many permutations of configs. It seems that having something in default_options (such as C++ standard) cannot be overriden when using Meson from the command line at first invocation.

@dcbaker
Copy link
Member Author

dcbaker commented Mar 17, 2020

We already have native config files, https://mesonbuild.com/Native-environments.html, this proposal is about serializing all of the arguments on the command line to a native file instead of a one-off format.

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

No branches or pull requests

6 participants