-
Notifications
You must be signed in to change notification settings - Fork 90
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
OpenBSD structure layout wrong after recent OpenBSD changes #15
Comments
I am also having difficulty with jnr-posix, albeit with the jar that is distributed with jython. It seems that FileStat sometimes reports paths which are not a symlink as a symlink. Looking at OpenBSDFileStat.java I think the interface needs to be reviewed. For example:
You may find that these types vary from arch to arch(?) In other words, OpenBSD support needs some love. |
I confirm that the patch Jeremy posted, when applied to jnr-posix-2.4 (the version jython uses) fixes the problems I am seeing with symlinks/stat. |
@wmeissner Talking to @jeremyevans on irc he pointed out this only works OpenBSD >5.4, We should be able to conditionalize loading a second OpenBSD Libc right? Have you thought about this particular issue past 32/64 bit differences? |
We don't have to load a different lib, just define different structures, correct? Worst case, when we detect OpenBSD, we can just look at the output from i.e. I'd rename the existing OpenBSD structs to OldOpenBSDFoo, and use them when |
yeah that seems reasonable. thanks @wmeissner. |
Are you able to do something equivalent to sizeof on C?
|
No - we don't call the compiler at all during runtime linking. That will probably change in future versions of jnr-ffi (using clang), but it isn't an option right now (other than shelling out to the C compiler to compile a small C program that prints out all the sizes). jnr-ffi does contain a table of common types, but the OpenBSD table was built for an older version of OpenBSD. |
Has there been any work done in this direction? The new puppetserver project is utilising jnr-posix and it fails to run, most likely due to this very issue. |
Fixed by #36. |
Recently, OpenBSD moved from a 32-bit time_t to a 64-bit time_t, with some other changes as well:
Commit message: http://marc.info/?l=openbsd-cvs&m=137637321205010&w=2)
Changes to sys/_types.h: http://www.openbsd.org/cgi-bin/cvsweb/src/sys/sys/_types.h.diff?r1=1.5;r2=1.6
Changes to sys/stat.h: http://www.openbsd.org/cgi-bin/cvsweb/src/sys/sys/stat.h.diff?r1=1.22;r2=1.23
After this change in OpenBSD, JRuby will not fully install, as it fails when trying to install rake (http://pbot.rmdir.de/JDuDNBBfrpVBb_EQKuJSVA).
I believe I have a diff that brings the jnr-posix structure layouts in-line with OpenBSD-current, but I haven't tested it yet (http://pastie.org/pastes/8260655/text). However, a straight patch approach may be unacceptable as it would mean that jnr-posix would then not work correctly on older OpenBSD versions. Would that be a problem?
If it would be a problem, do you have a recommendation on the best way to fix this such that both older and newer OpenBSD would run correctly? Should we have code for both OpenBSD layouts, and pick which one to use at runtime? If so, should such a check go in POSIXFactory.java, and do you have an idea about how to check (such as using the operating system version)?
The text was updated successfully, but these errors were encountered: