linux: add system call bindings#2820
Conversation
|
Thanks for your pull request and interest in making D better, @carun! We are looking forward to reviewing it, and you should be hearing from a maintainer soon.
Please see CONTRIBUTING.md for more information. If you have addressed all reviews or aren't sure how to proceed, don't hesitate to ping us with a simple comment. Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub run digger -- build "master + druntime#2820" |
e27be49 to
3f8172c
Compare
|
Remaining style issues: |
|
@ZombineDev not sure why some checks are failing. Do you mind explaining? Thanks. |
Try |
|
@thewilsonator I'm not sure why it still fails. The errors seem to indicate unittest failure. Apparently, I don't see the errors explaining where/why it failed. |
|
The Windows failures look unrelated, maybe the additional files trigger some compiler bug. The win32-ldc failure looks like the compiler silently exits while compiling the unittest executable. I haven't been able to reproduce locally, though. |
9dabdd1 to
55e09fa
Compare
|
@ZombineDev @thewilsonator help pls! |
|
As I pointed out in my PR, the mir-kernel package is far superior. It's all Boost, so the least we could do here would be to do a proper copy/paste as otherwise soon users on ARM etc. will have to add their bindings as well. |
|
@wilzbach I can redo this PR with a copy paste from https://github.com/libmir/mir-linux-kernel. Honestly, the copy-paste makes me cringe. But we can't have Phobos to depend on libmir. I see no other solution at the moment! |
|
@carun libmir/mir-linux-kernel exists for 2 reasons:
We can fix 1 and then after all compilers catch up in a couple of releases I suggest we move forward by adding all the functionality to druntime so that everyone (not only those using In long term, I believe that we should split druntime into packages that implement compiler functionality (directly tied to the version of the compiler) and bindings for the system libraries, which can be used by any compiler version. The latter should be put on code.dlang.org. |
55e09fa to
f02e8fd
Compare
|
@PetarKirov @Geod24 @maxhaton I rebased this. Should we get this on or should we make sure we are properly copy pasting from libmir? |
src/core/sys/linux/unistd.d
Outdated
| public import core.sys.linux.syscalls : SYS; | ||
| import core.stdc.config : c_long; |
There was a problem hiding this comment.
| public import core.sys.linux.syscalls : SYS; | |
| import core.stdc.config : c_long; | |
| public import core.sys.linux.syscalls : SystemCall; |
| statx = 332, | ||
| } | ||
| } | ||
| else version (X86) |
There was a problem hiding this comment.
Would be nice to also add support for ARMv7, Aarch64, but that can be done in a separate PR of course.
|
@RazvanN7 Thank you for the reminder, this PR completely fell off my radar. Should be good to go modulo the above comments. Perhaps if one want to go the extra mile, we could add a unittest that actually verifies that the |
e2f9fad to
7c57cce
Compare
|
@PetarKirov I have applied the review. Regarding the unittest, where you thinking of just doing a random syscall and check for success or test that all the defined syscalls work? If it's the latter, I would rather have it in a different PR as it seems to be a fairly large addition. |
We shouldn't be doing IO / non-pure operations in unittests. Syscall is definitely not something we should be unittesting. |
|
Agreed, we should only be unit testing code that we write, not the bindings. |
|
The autotester failure is a spurious one and I am tempted to think that the stdcpp test is also a spurious one as it does not have any information about why it is failing. |
7c57cce to
a0df877
Compare
|
Why was this merged?!?! |
Reviving #1984