-
Notifications
You must be signed in to change notification settings - Fork 91
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
FreeBSDFileStat broken under FreeBSD 12 #126
Comments
We'll need to detect which FreeBSD we're on (or some other way to know which struct to use) and have two definitions, I believe. |
I added a simple version check in acc1d9d, which I guess is better than nothing. A proper fix would, I suppose, involve knowing which ABI we're running under. The above will break in, say, my 11.2 jail env under 12.0, because os.version is still 12.0 :/ |
The ideal way to detect the ABI would be to read the __FreeBSD_version value. Values of 1200031 and later have the 64 bit inodes, as shown here: That said, simply detecting it is FreeBSD 12 should be enough for it to work on official releases. |
Does the FFI layer expose symbol information in any way? Could we tell if we've linked to, for instance, |
This leaves, among other things, Puppet(server) broken on FreeBSD 12. I assume it needs fixing here before a new Puppet version can be rolled; what would it take to fast forward this? The change in acc1d9d seems to match for 12.0 only; anything >=12.0 should be matched (until the next change..) |
It's a lexicographic comparison, anything that sorts after 12.0 should be matched too. If a version check is to be used, it's probably marginally better to use I suspect the best fix is to add |
For prior art, this is basically what Rust's libc crate does:
Pinning them to to FreeBSD's compatibility shims for now. |
Yes, sorry, misread that part.
Not just marginally better, it's absolutely crucial to use the userspace version vs kernel version as long as you're not reading kernel structures directly. Otherwise it'd "mysteriously" break in the case of, say, a 11.2 jail running on a 12.0 kernel - which we're currently doing to keep puppetserver running. Which is, incidentally, also a very common practice "out there". |
I say marginal because I wasn't sure it'd actually work with an 11 package on a 12 userspace, which is also a common practice. Looks like it should, but it's still a fragile-looking band-aid and not what I'd consider a long-term solution. |
This is not supported by FreeBSD. It may happen to work, but we really don't care.
Basically:
This allows you to have jails with a previous version of FreeBSD (userland) with packages for that previous version of FreeBSD. Only the kernel is newer, and that is supported. |
BTW, regarding Java, the .jar file we get at the end should be the same regardless of the environment we build on, right? (I am not used to Java) So detecting the version of the symbol and using one implementation or the other seems the right way to go, as suggested by @Freaky here #126 (comment) |
I'd suggest this isn't really a credible position, because it's a major component of almost any system upgrade - you install the new world, reboot, rebuild and reinstall packages, then delete the old libraries they were depending on. That's a documented process, and it doesn't say "btw all your packages will probably break while you're waiting for it all to rebuild". And it's just as well because it's workflow I've depended on for nearly 20 years. |
Updated against master. Any chance of some movement? Be nice to be able to use JRuby outside a jail again. |
@Freaky I just managed to update this WIP: If you can provide feedback / advises / recommendation about the Java part (and also the rest), please do so! |
Sorry this got left behind a bit...I'll look into mergingnow. |
@Freaky Is this in a PR somewhere? I'm having trouble finding it. Once we have a PR we can review and get it merged! |
Thanks for submitting this quickfix @Freaky! In the meantime, I think I reached a point where the right thing is done in all layers of the stack for using versioned symbols:
Reviews and feedback on these pull requests is heavily appreciated: I am not used to Java at all and while this seems to do the right thing™ on my computer, it probably needs some adjustments to match the quality standards one might expect from such projects 😉 |
I'll merge in #132 today. Since various of you are helping us out a lot here, perhaps one or more of you would like to be added as maintainers? We need help! |
FreeBSD 12 has a new stat structure, complete with 64-bit inode numbers, link counts, and some field reorderings.
The text was updated successfully, but these errors were encountered: