-
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
meson/rust: wrap bindgen
s wrap-static-fns
functionality
#12263
meson/rust: wrap bindgen
s wrap-static-fns
functionality
#12263
Conversation
491c2bf
to
0ec6ae0
Compare
I'll write and add a test later. Just wanted to see what's the general opinion on this first. |
2a40624
to
2e21bd0
Compare
ca9521b
to
be390b1
Compare
decided to bump the meson requirement to
So while technically it's a |
Okay, now the CI jobs fail because they don't have a new enough |
be390b1
to
e07572e
Compare
We'd need to rebuild the images, which I thought we had a weekly job to do... Let me follow up on that. It might also be worth checking the bindgen version and skipping the test if bindgen is too old. |
They are refreshed weekly, but that doesn't automatically mean they are successfully refreshed. I periodically try to nudge those if they are in a failing state. Currently e.g. arch has a broken refresh attempt due to:
|
e07572e
to
ecef812
Compare
To reiterate what I said on IRC in regards to the mypy error: We can't actually hit the So, I think it's fine to do something like: assert not isinstance(exe, Executable), 'Cannot do a version compare on Executable, implement the get_version() method'
<do version check> and move on. |
ecef812
to
25054c8
Compare
okay, I think I fixed the linter stuff, so now all we need are new images with a newer bindgen |
Do we have any images that have a new enough bindgen currently? |
at least the ones used in the test doesn't seem to have it. |
25054c8
to
5c221ff
Compare
anyway, anything which can be done to move this forward? |
I've been investigating CI errors yet again, still haven't figured out how to actually get any of them to fully complete.
I'd really love to know more about this llvm issue. :( |
5c221ff
to
5e4d96c
Compare
5e4d96c
to
c2d1893
Compare
I really like to get this in.. is there anything we can do about that CI stuff being broken? |
Ping. Ubuntu rolling currently has images that successfully update. Please yeet bindgen in. |
c2d1893
to
3714be7
Compare
You might need to skip tests on some platforms. Let's see how it plays out. |
mhh, still no luck it seems? Are some of the containers still outdated? Maybe CI should just use |
Well I think we need a separate PR to update the images to include the version of bindgen this PR requires. Haven't seen anything in the PR queue |
Looked in the ubuntu repositories: https://pkgs.org/download/bindgen. Doesn't look like much hope for an updated image, so to me, installing it via cargo (at least temporarily) seems like a great solution. |
If it's updated in this PR then the ciimage test run would pass with the changes included.
What on earth is "pkgs.org". |
pkgs.org is usually good about saying what repos have what versions of software. I can see it isn't accurate here though! I see in the image files, we already have bindgen, so how can we kick the images to be regenerated to pickup the version you just posted. |
@@ -90,6 +90,32 @@ rust_bin2 = executable( | |||
|
|||
test('generated header', rust_bin2) | |||
|
|||
# Test generating a static inline wrapper |
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.
I would suggest making this use an option + a matrix in test.json, so that the tests can specifically check for new-bindgen-stuff.
074d816
to
63797a4
Compare
ci/ciimage/arch/install.sh
Outdated
@@ -14,7 +14,7 @@ pkgs=( | |||
itstool gtk3 java-environment=8 gtk-doc llvm clang sdl2 graphviz | |||
doxygen vulkan-validation-layers openssh mercurial gtk-sharp-2 qt5-tools | |||
libwmf cmake netcdf-fortran openmpi nasm gnustep-base gettext | |||
python-lxml hotdoc rust-bindgen qt6-base qt6-tools wayland wayland-protocols | |||
python-lxml hotdoc qt6-base qt6-tools wayland wayland-protocols |
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.
Why?
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.
To clarify why I'm asking this...
Arch ships a new enough bindgen. There's no reason to switch to cargo for this.
The Arch CI fails for totally unrelated reasons, and as a result of that it doesn't help to switch to installing it with cargo because switching to cargo would require updating the image, and if the image could be updated then you wouldn't need cargo.
Fixing the Arch image requires figuring out what's going on with llvm, which is wonderfully wacky and I find llvm very confusing so 🤷. Hopefully someone will figure it out too because static detection is badly misbehaved there, it's not as simple as "it wasn't found".
uhh.. seems like building new CI images is broken and some of the ubuntu rolling jobs also are weird and don't get rebuilt or something? In any case, installing bindgen via cargo doesn't seem to work and at this point I have 0 motivation to continue working on this as I can't be bothered working around broken CI or broken distributions |
If anybody else still wants to see this land regardless, please fix those issue yourself. I'm either waiting for that or investigate other options. |
The Ubuntu rolling jobs are irrelevant as long as the "image builder" job for Ubuntu passes, which it does. The Arch "image builder" job fails with or without this PR... as I pointed out above. I'm not worried about that. As long as the non "image builder" variant of the Arch CI passes, which it doesn't (because bindgen is out of date). But. BUT. That's why I suggested in a review comment above that the testsuite case has to handle detecting whether bindgen is new enough, and raise a SKIP instead of failing with an error. I also suggested parameterizing that test case so we can test both independently, which is needed to test old bindgen with reduced meson features on older systems, and newer bindgen with full meson features on newer systems. And I'm sorry, but that review comment still stands. It's not about the CI, so even if the CI was passing right now I'd still be asking for that change. Once you make that change to the test case, I will be happy to do my part and
so that you don't have to worry about our CI issues. But. There is a reason I asked for the change I did, and it is because I feel it's a blocker for me to handle the CI for you. |
yeah, but as I said, I have 0 motivation in fixing those issues. If you think this change is important to get merged, please do so yourself as I can't be bothered with figuring out how to do all those things anymore. I literally don't care at all about installs/distributions with an outdated If nobody else wants to continue working on this, please just close it. |
I asked you to parameterize a test case so that instead of testing two things in one test, you test two things in two tests. |
To me the solution is simple: update CI images with bindgen-0.65 and make sure the tests pass. This is going on for months now and literally blocked by CI not able to rebuild images. If you think reworking the tests so it can be tested with older bindgen is a good strategy, please make those changes yourself as I said that I don't care myself anymore. I won't be discussing this any further and just unsubscribe from this PR. Do what you think is best. I'll just workaround meson not having this functionality for now. |
@karolherbst, @eli-schwartz I'll fix this up and send out an update in the next day or two, I'm trying to rebase some stuff that's very obnoxious right now, but I'll get to this. |
@karolherbst no, it is not blocked by CI not being able to rebuild images. It is being blocked by the testsuite being broken on operating systems with an older bindgen, which means that people who package meson for distros and run testsuites will not be able to update to a new meson version (including as a backport) without them, in turn, being blocked on bindgen. I am not willing to accept that. At minimum, your test case has a coding error inside of it. "I will not fix a coding error in my test case because I don't care about systems with older bindgen versions" is not a PR that I consider to be ready to merge. @dcbaker thanks, much appreciated. |
b89737d
to
afecfee
Compare
This way the `rust.bindgen` can generate a second output being a C file, which contains wrapper functions for static inline ones. This output file can then be compiled via C targets.
afecfee
to
96e9355
Compare
This way the
rust.bindgen
can generate a second output being a C file, which contains wrapper functions for static inline ones.This output file can then be compiled via C targets.