-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
REGRESSION: Meson Incorrectly Determines that a Response File is Unnecessary #13414
Comments
I can't think of an obviously suspicious change that might have caused this off the top of my head. Would you be able to try |
cf0fecf is the first bad commit
mesonbuild/backend/ninjabackend.py | 15 +++++++-------- cc @dcbaker |
Okay, so after some debugging this appears to be "our bug was papering over another bug". On Linux we set the line limit to 65k characters, but wine has a limit of 32k characters. My patch fixes a bug where we would double count most of the characters that went into our calculation, so we effectively had half the character limit we actually wanted (+/- ~1000 characters). In the linked project, the final command has a line length of ~44k characters, but on 1.4.0 that gets counted as 88k characters, and we use an RSP file. I think the best solution is just to cap the line length at 32k for !Windows. We already cap Windows at 8k because that's the limit of cmd.exe, but it otherwise has a limit of 32k, just like Wine does. |
At an OS level, Unix-like OSes usually have very large or even unlimited sized command line limits. In practice, however, many applications do not handle this (intentionally or otherwise). Notably Wine has the same limits Windows does, 32,768 characters. Because we previously double counted most characters, we papered over most situations that we would need an RSP file on Unix-like OSes with Wine. To fix this issue I have set the command line limit to 32k, this is still a massive command line to pass without an RSP file, and will only cause the use of an RSP file where it is not strictly necessary in a small number of cases, but will fix Wine applications. Projects who wish to not use an RSP file can still set the MESON_RSP_THRESHOLD environment variable to a very large number instead. Fixes: mesonbuild#13414 Fixes: cf0fecf ("backend/ninja: Fix bug in NinjaRule.length_estimate")
Confirmed that #13473 fixes it. |
At an OS level, Unix-like OSes usually have very large or even unlimited sized command line limits. In practice, however, many applications do not handle this (intentionally or otherwise). Notably Wine has the same limits Windows does, 32,768 characters. Because we previously double counted most characters, we papered over most situations that we would need an RSP file on Unix-like OSes with Wine. To fix this issue I have set the command line limit to 32k, this is still a massive command line to pass without an RSP file, and will only cause the use of an RSP file where it is not strictly necessary in a small number of cases, but will fix Wine applications. Projects who wish to not use an RSP file can still set the MESON_RSP_THRESHOLD environment variable to a very large number instead. Fixes: #13414 Fixes: cf0fecf ("backend/ninja: Fix bug in NinjaRule.length_estimate") (cherry picked from commit a544c75)
Describe the bug
Meson seems to no longer correctly determine that a response file is necessary when using a compiler that runs under Wine. The identification routine worked as expected when building using Meson 1.4.1, but now fails in Meson 1.5.0 at the linking stage for our ELF.
The command that we use for our linking is
44_893
characters long; investigation into Wine's codebase suggests that their limit is32_767
characters.For further debugging under 1.5.0, I set
MESON_RSP_THRESHOLD
to16387
, and linking correctly identified that it should use a response file during project configuration.To Reproduce
Our entire project source is available here. Instructions for building the project (if desired) are included in
INSTALL.md
.Nothing extraordinary should be notable here other than:
Expected behavior
The linker should identify that it should use a response file for a command that exceeds the supported length if running against Wine.
system parameters
meson --version
1.5.0ninja --version
1.12.1The text was updated successfully, but these errors were encountered: