-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
intentional @compileError limits zig to a very narrow band of posix systems #13565
Comments
edit: see |
Also this compile error is only hit if someone calls |
I understand the code. The point is that they don't have it now, which means it doesn't build now. More to the point, there should be code to fallback on, not a compile error. What other projects have done in cases like this is return nothing, perhaps with some kind of emitted notice. Unless zig is intentionally supporting ONLY FreeBSD (and linux, macos, windows) the current state shouldn't be acceptable. |
I think this is very much a bad idea and contrary to Zig's values. If you're calling an API that doesn't exist on your platform, you should find out about that as soon as possible. If you really want it to fall back on returning null, you could branch on |
I'm not sure what your point is. The bottom is at least 2 platforms stopped building between zig 9 and zig 10. I cannot remember if our netbsd packages included zig yet or not, so that could be 3 platforms. so you are leaving me with 3 choices:
Obviously I'm not going to try to implement the missing functionality |
if you're on dragonfly and zig is detecting it as freebsd, that's a different issue, and a valid one for sure |
Unfortunately, it seems At a quick glance, perhaps on platforms where libc is used, the impl be changed to use libc's EDIT: err wait. It already does that! gonna have to dig a bit further and find out what is causing |
@nektro no it's not a case of dragonfly being identified as freebsd. I was just saying that I was building on Dragonfly, but I expect to hit the same issue on FreeBSD 12.2. |
My digging is it comes from realpathAlloc() call from src/Compilation.zig, which call |
I have setup quite a few VMs to work this issue and confirmed the following status re: obtaining a path via filehandle and ✅ Linux already has an adequate ✅ macOs already has a good getFdPath ✅ Solaris already appears to have a similar ✅ FreeBSD already has a getFdPath ✅ DragonFly BSD has ✅ OpenBSD has export "kvm" kvm_getfiles(...) ...;
export "kvm" kvm_openfiles(...) ...; ❌ NetBSD has Usage of MY CONCLUSION
cc: @andrewrk, @daurnimator |
Regarding OpenBSD and kvm, you should be able to get some informations about the descriptor (like inode |
Since I created this problem (re: FreeBSD impl.), I may be of help for the NetBSD fix. I remember a WIP patch on the FreeBSD phabricator that referenced implemented a NetBSD function that IIRC did what getFdPath does. Here it is: |
Now that I have patch to remove zig compiler dependency on Great news about netbsd 9.4 support! Probably about a year away. |
NetBSD 10.0 should be out soon, as far as I can guess hopefully not a year from now. |
The compiler is not supposed to call realpath under any circumstances. I apologize for not noticing this earlier. Problematic commit reverted in 9bcd48e. |
zig/lib/std/os.zig
Lines 5284 to 5300 in aea617c
so zig 10.0.0 will intentionally does not compile on < FreeBSD 13 and not at all on DragonFly or NetBSD?
There wouldn't be a reason to leave it in Ravenports if that's the case.
The text was updated successfully, but these errors were encountered: