-
Notifications
You must be signed in to change notification settings - Fork 20
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
Various Unix, Apple, and Windows fixes #16
Open
MisterDA
wants to merge
5
commits into
janestreet:master
Choose a base branch
from
MisterDA:fixes
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- OCaml 4.13 ships realpath on Unix and Windows. Offload core_unix_realpath to caml_unix_realpath if OCaml >= 4.13 is used. - realpath(..., NULL) allocating a buffer is POSIX 2008. There are no more common systems that don't implement this feature. The OCaml 4.13 implementation uses it inconditonaly. It shouldn't be restricted to glibc (musl, BSDs, macOS support it). - add a fallback if realpath isn't implemented (e.g., on Windows, before OCaml 4.13). This also fixes the following warning: filename_unix_stubs.c:31:9: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] 31 | char *path = String_val(v_path); | ^ ~~~~~~~~~~~~~~~~~~ 1 warning generated. and makes realpath available on Windows (the following was reported by MinGW-w64): In file included from C:\Users\opam\AppData\Local\opam\5.3\lib\jane-street-headers/ocaml_utils.h:6, from filename_unix_stubs.c:5: filename_unix_stubs.c: In function 'core_unix_realpath': C:/Users/opam/AppData/Local/opam/5.3/lib/ocaml/caml/mlvalues.h:365:23: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 365 | #define String_val(x) ((const char *) Bp_val(x)) | ^ filename_unix_stubs.c:31:16: note: in expansion of macro 'String_val' 31 | char *path = String_val(v_path); | ^~~~~~~~~~ filename_unix_stubs.c:36:7: warning: implicit declaration of function 'realpath' [-Wimplicit-function-declaration] 36 | if (realpath(path, resolved_path) == NULL) | ^~~~~~~~ filename_unix_stubs.c:36:37: warning: comparison between pointer and integer 36 | if (realpath(path, resolved_path) == NULL) | ^~ Signed-off-by: Antonin Décimo <antonin@tarides.com>
error_checking_mutex_stubs.c: In function 'caml_pthread_check': error_checking_mutex_stubs.c:23:7: warning: implicit declaration of function 'strerror_r'; did you mean 'strerror_s'? [-Wimplicit-function-declaration] 23 | if (strerror_r(retcode, err_buf, err_buf_len) == -1) | ^~~~~~~~~~ | strerror_s Signed-off-by: Antonin Décimo <antonin@tarides.com>
Signed-off-by: Antonin Décimo <antonin@tarides.com>
# core_unix_stubs.c:1055:47: warning: passing 'gid_t *' (aka 'unsigned int *') to parameter of type 'int *' converts between pointers to integer types with different sign [-Wpointer-sign] # n = getgrouplist(c_user, Long_val(v_group), groups, &ngroups); # ^~~~~~ # /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/unistd.h:654:43: note: passing argument to parameter here # int getgrouplist(const char *, int, int *, int *); # ^ Signed-off-by: Antonin Décimo <antonin@tarides.com>
Signed-off-by: Antonin Décimo <antonin@tarides.com>
This errors still on macOS 15.3 arm64 on OCaml 5.3 with:
|
@MisterDA Did you find a way to fix the |
No, I didn't... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.