Skip to content

Conversation

@dcbaker
Copy link
Member

@dcbaker dcbaker commented Nov 12, 2025

I think this is simply a case where the code that converted the executable arguments to shared_library arguments happened to work, but wasn't exactly correct. I've attempted to make the conversion robust, but I don't have an Android cross setup to test with.

Fixes: #15238

@dcbaker dcbaker requested a review from jpakkane as a code owner November 12, 2025 16:42
@dcbaker
Copy link
Member Author

dcbaker commented Nov 12, 2025

@sp1ritCS: I don't have a setup to test, but just by inspection I think I found the issue, but I'd appreciate if you could test that this works for you.

@dcbaker dcbaker added this to the 1.10 milestone Nov 12, 2025
@sp1ritCS
Copy link
Contributor

Negative, the error still occurs. I've done some basic printf debugging (logging what gets set in the sh_kwarg loop) and the problem is that the RUST_ABI arg isn't part of EXCLUSIVE_SHARED_LIB_KWS :)

@bonzini
Copy link
Collaborator

bonzini commented Nov 12, 2025

This should work but on top of this the rust_crate_type should be changed to 'cdylib' if it is None, otherwise the default will be Rust ABI.

@dcbaker dcbaker force-pushed the submit/fix-android-exe-type-regression branch from 7da70ec to 07c6629 Compare November 12, 2025 17:13
@dcbaker
Copy link
Member Author

dcbaker commented Nov 12, 2025

I would have thought it would have done what @bonzini said, but I've made it explicitly set the rust_abi and rust_crate_type as we would expect now.

@sp1ritCS
Copy link
Contributor

sp1ritCS commented Nov 12, 2025

This works now. Tho I guess it is less "robust" that the commit header makes it out to be, in case _EXCLUSIVE_LIB_KWS gets extended.

Perhaps @jpakkane can be nudged to build and upload a container providing a NDK toolchain. We have a setup script for our container which may be adopted (Tho we moved away from a Dockerfile to fdo-ci-templates to avoid dealing with building containers outself). Just seen that the container defs are just part of the meson repo itself, I guess I can just submit it myself 🙃

@dcbaker
Copy link
Member Author

dcbaker commented Nov 13, 2025

I looked into why it's doing what it's doing, and both @bonzini and I were off because the default for rust_abi and rust_crate_type is None, which will default to using rust_abi == 'rust, which turns into dylib`.

The robustness thing is true though, since it fills in all of the shared library fields that that are expected.

@dcbaker
Copy link
Member Author

dcbaker commented Nov 13, 2025

Maybe that should be broken into two patches?

@bonzini
Copy link
Collaborator

bonzini commented Nov 13, 2025

I think this PR is good as is, except for possibly adding a similar loop involving _EXCLUSIVE_LIB_KWS.

…rguments

This extends the code that strips executable keyword arguments to also
default populate shared_library exclusive arguments.

Fixes: mesonbuild#15238
@dcbaker dcbaker force-pushed the submit/fix-android-exe-type-regression branch from 07c6629 to c28fe88 Compare November 13, 2025 20:12
@dcbaker
Copy link
Member Author

dcbaker commented Nov 13, 2025

I had another idea, I think this is even a little better, @bonzini let me know what you think.

@bonzini
Copy link
Collaborator

bonzini commented Nov 13, 2025

Oh yeah, that makes a lot of sense!

@dcbaker dcbaker merged commit f5d81d0 into mesonbuild:master Nov 14, 2025
32 checks passed
@dcbaker dcbaker deleted the submit/fix-android-exe-type-regression branch November 14, 2025 16:17
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.

executable w. application android_exe_type triggers KeyError

3 participants