-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Rust: Replace rust_crate_type with rust_abi #11714
Conversation
I'm wondering if we should even deprecate |
That sounds like an option, just means that things don't map 1:1 to rustc (or cargo) terminology anymore and more documentation would be needed. |
d9aa019
to
d32e99a
Compare
While at it, I fixed usage of both_libraries and default_library=both, and added unittest.
Yes, but the alternative is everyone is going to write |
74149ed
to
0bd6659
Compare
I guess that makes sense, just make sure the deprecation warning makes it clear what should be done instead :) |
a9a4446
to
bd9f871
Compare
@sdroege any idea what could be causing that CI failure? https://github.com/mesonbuild/meson/actions/runs/4789026887/jobs/8516401795?pr=11714#step:4:2263 |
Exciting. I have no idea :) Can you reproduce it locally? |
no, works fine here, maybe more recent gcc and/or rustc. Maybe rust-lang/cargo#8239. There is also that failure: https://github.com/mesonbuild/meson/actions/runs/4789026887/jobs/8516402494?pr=11714#step:4:2166. I guess we need -pthread, but it does not seems to be needed locally, so maybe also caused by a different rustc version. |
You could try with a newer version, I guess. There's some code in ninjabackend.py that is only enabled with 1.66 and before that it's luck if things work correctly in certain configurations or not (and you're running here with 1.65) |
And finally on Windows there are other issues too: https://dev.azure.com/jussi0947/jussi/_build/results?buildId=17314&view=logs&j=5015ea34-1c35-577b-b206-c8bea8465a58&t=00c5cf7c-b41c-5970-0bf5-8751e484378e&l=3289 |
On Windows that's missing to link to |
I had thought about this too... Instead of Then we could move Just throwing out ideas that I've pondered about this. |
@dcbaker while I like the idea of having something more generic, I don't think we are there yet. We can rethink then when/if we actually do zig and/or D. |
bd9f871
to
e926b98
Compare
975b2f2
to
3be2e0e
Compare
There will very likely be more in the future |
e5a4e17
to
3b4e80d
Compare
3b4e80d
to
4b58290
Compare
cdb7f71
to
f4c7c26
Compare
f4c7c26
to
62b1be7
Compare
Meson already knows if it's a shared or static library, user only need to specify the ABI (Rust or C).
Force BUILD machine and allow to link with HOST machine.
Rustc does not produce object files we can reuse to build both libraries. Ideally this should be done with a single target that has both `--crate-type` arguments instead of having 2 different build rules. As temporary workaround, build twice and ensure they don't get conflicts in intermediary files created by rustc by passing target's private directory as --out-dir. See rust-lang/rust#111083.
62b1be7
to
bb67639
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this, and thank you for bearing with me on the keyword argument name. This looks great
The https://github.com/nvinson/refivar project no longer builds in meson from git master:
The failing code: lib_refivar = static_library(
'efivar',
[...]
rust_crate_type: 'lib',
[...]
)
rust.test('unit tests', lib_refivar, rust_args:[]) Bisecting points to here:
/cc @nvinson |
Rust: Use Popen_safe_logged in sanity checks
Rust: Fix proc-macro usage when cross compiling
Rust: Prevent linking Rust ABI with C library/executable
Rust: Remove unit test already covered in "rust/4 polyglot"
Rust: Replace rust_crate_type with rust_abi
Rust: Add a rust.proc_macro() method
interpreter: Use common definition for sources type
interpreter: Allow regex matching in expect_error()