Skip to content
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

Janet 1.8.0 fails to build on FreeBSD #327

Closed
ghost opened this issue Mar 30, 2020 · 4 comments
Closed

Janet 1.8.0 fails to build on FreeBSD #327

ghost opened this issue Mar 30, 2020 · 4 comments

Comments

@ghost
Copy link

ghost commented Mar 30, 2020

_XOPEN_SOURCE 500 seems to hide several required things on FreeBSD. Removing it from features.h and boot.janet lets the build pass. I'm not sure what the correct value should be here?

Apparently the OpenBSD build is similarly broken.

https://builds.sr.ht/~bakpakin/job/177583
https://builds.sr.ht/~bakpakin/job/177584

../src/core/os.c:492:9: warning: implicit declaration of function 'unsetenv' is invalid in C99 [-Wimplicit-function-declaration]
        UNSETENV(ks);
        ^
../src/core/os.c:485:21: note: expanded from macro 'UNSETENV'
#define UNSETENV(K) unsetenv(K)
                    ^
../src/core/os.c:494:9: warning: implicit declaration of function 'setenv' is invalid in C99 [-Wimplicit-function-declaration]
        SETENV(ks, vs);
        ^
../src/core/os.c:484:21: note: expanded from macro 'SETENV'
#define SETENV(K,V) setenv(K, V, 1)
                    ^
../src/core/os.c:539:9: error: use of undeclared identifier 'CLOCK_MONOTONIC'
    if (gettime(&tv)) janet_panic("could not get time");
        ^
../src/core/os.c:532:35: note: expanded from macro 'gettime'
#define gettime(TV) clock_gettime(CLOCK_MONOTONIC, (TV))
                                  ^
../src/core/os.c:973:14: warning: implicit declaration of function 'S_ISSOCK' is invalid in C99 [-Wimplicit-function-declaration]
    else if (S_ISSOCK(m)) str = "socket";
             ^
../src/core/os.c:974:14: warning: implicit declaration of function 'S_ISLNK' is invalid in C99 [-Wimplicit-function-declaration]
    else if (S_ISLNK(m)) str = "link";
             ^
../src/core/os.c:1087:15: warning: implicit declaration of function 'lstat' is invalid in C99 [-Wimplicit-function-declaration]
        res = lstat(path, &st);
              ^
../src/core/math.c:256:28: warning: implicitly declaring library function 'trunc' with type 'double (double)' [-Wimplicit-function-declaration]
JANET_DEFINE_MATHOP(trunc, trunc)
                           ^
../src/core/math.c:256:28: note: include the header <math.h> or explicitly provide a declaration for 'trunc'
../src/core/math.c:257:28: warning: implicitly declaring library function 'round' with type 'double (double)' [-Wimplicit-function-declaration]
JANET_DEFINE_MATHOP(round, round)
                           ^
../src/core/math.c:257:28: note: include the header <math.h> or explicitly provide a declaration for 'round'
../src/core/math.c:468:50: error: use of undeclared identifier 'INFINITY'
    janet_def(env, "math/inf", janet_wrap_number(INFINITY),
                                                 ^
../src/core/math.c:470:52: error: use of undeclared identifier 'INFINITY'
    janet_def(env, "math/-inf", janet_wrap_number(-INFINITY),
                                                   ^
@bakpakin
Copy link
Member

bakpakin commented Mar 30, 2020

It was required to get os/realpath on Linux, otherwise it should not be needed. We may be able to increase the value here and revise this.

@bakpakin
Copy link
Member

bakpakin commented Mar 30, 2020

Addressed in e4ea8bc. I should have caught this, the bsd builds have been failing for a little bit but they either never sent me an email or I missed it so I didn't check. This will be merged into the 1.8 branch and added to a patch release.

@ghost
Copy link
Author

ghost commented Mar 31, 2020

Thanks. Unfortunately it still fails to build because of the unconditional _XOPEN_SOURCE in https://github.com/janet-lang/janet/blob/master/src/boot/boot.janet#L2588.

@bakpakin
Copy link
Member

Yeesh, not on my game. Fixed for real in 244566c, passing build here: https://builds.sr.ht/~bakpakin/job/178612

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant