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
--default-library specified in crossfile and command line works inconsistently once reconfigured #11294
Comments
I wonder what the intended behavior is supposed to be. Are you of any docs that talk about this precedence? |
@tristan957 This is what the docs say the precedence should be
|
Issue persists in meson 1.1.0. |
@xclaesse you said you might know this issue right? |
The problem is on reconfigure we reload machine files and override options with what it contains. Meson should remember the source of every option (command line, machine file, env, etc) and only override if it got changed in a higher priority source. That means when reloading machine file we should override the option if the value we got was from env but not if it was from command line. That's also the reason why we don't update options when changing This is something I got told that muon does correctly. |
This keeps ruining my debugging sessions. upstream report: mesonbuild/meson#11294
Describe the bug
Situation: Your cross file specifies libraries to build as static, but you configure a certain project to build as shared.
You configure, build, get a shared library and all is fine.
Then you edit your cross file in any way. The next time you build meson will automatically reconfigure, the shared setting gets "lost" and you suddenly get a static library.
To Reproduce
meson.build:
hello.c:
crossfile.txt
meson build --cross-file crossfile.txt --default-library shared
meson compile -C build
->[2/2] Linking target libhello.so
touch crossfile.txt
meson compile -C build
-> a reconfigure runs and you get[2/2] Linking static target libhello.a
Expected behavior
Step 4 still links a shared library.
system parameters
meson --version
: 1.0.0ninja --version
: 1.11.1The text was updated successfully, but these errors were encountered: