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

Support for OpenBSD x86_64 #203

Open
anoduck opened this issue Dec 3, 2024 · 3 comments
Open

Support for OpenBSD x86_64 #203

anoduck opened this issue Dec 3, 2024 · 3 comments

Comments

@anoduck
Copy link

anoduck commented Dec 3, 2024

Was working on a schema for timelinejs, found the awesome tool that would help me do it, and would even help validate it. So I went to install it, which worked well. Went to validate the jsonschema, and recieved the error:

The JSON Schema CLI NPM package does not support openbsd for x86_64 yet Please open a GitHub issue at https://github.com/sourcemeta/jsonschema 😞

@jviotti
Copy link
Member

jviotti commented Dec 4, 2024

Hi @anoduck ,

Thanks for reaching out! I believe you should be able to build the JSON Schema CLI just fine on any BSD system already. For the NPM package and GitHub Releases, the only real "blocker" would be getting a i.e. OpenBSD runner on GitHub Actions to automatically produce the builds, which GitHub doesn't natively support.

Are you aware of any way of running an OpenBSD CI pipeline? If so, happy to set it up :)

@anoduck
Copy link
Author

anoduck commented Dec 4, 2024

The CI Pipeline

Ya, know? I probably need to figure that one out. I have never had to set up a CI pipeline, but I need to learn, other developers have done it with OpenBSD. So, I will have to get back with you on it in a few days.

Building from source

Compiling didn't go as well as one would hope. It seems there were some issues compiling curl for hydra, and it does not appear these errors can be easily resolved. I am assuming this is not the same hydra used in brute force login attacks.

This might be more than either of us want to chew on at the moment. Generally, in these situations, I leave it up to the developer to make the decision whether to continue down the road of troubleshooting compilation errors or place the effort in suspension until there is more call for supporting OpenBSD.

I keep a development box with Linux running on it, so I can just run jsonschema over on it for the time being.

Script started on Wed Dec  4 18:19:16 2024
[  1%] Built target sourcemeta_hydra_http
[  1%] Built target sourcemeta_jsonbinpack_numeric
[ 49%] Built target bearssl
[ 50%] Built target sourcemeta_jsontoolkit_json
[ 51%] Built target sourcemeta_hydra_crypto
[ 54%] Built target sourcemeta_jsonbinpack_runtime
[ 57%] Built target zlib
[ 57%] Built target sourcemeta_jsontoolkit_jsonl
[ 60%] Built target uriparser
[ 60%] �[32mBuilding C object vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/vquic/vquic-tls.c.o�[0m
[ 61%] �[32mBuilding C object vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/cw-out.c.o�[0m
[ 61%] �[32mBuilding C object vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/request.c.o�[0m
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/vquic/vquic-tls.c:25:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup.h:816:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:113:8: error: redefinition of 'timeval'
struct timeval {
       ^
/usr/include/sys/socket.h:131:8: note: previous definition is herewhat looks like "curl" of all things
struct timeval {
       ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/vquic/vquic-tls.c:25:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup.h:816:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:167:2: error: "Missing definition of macro sread!"
#error "Missing definition of macro sread!"
 ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:185:2: error: "Missing definition of macro swrite!"
#error "Missing definition of macro swrite!"
 ^
3 errors generated.
[ 61%] �[32mBuilding C object vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/vquic/curl_osslq.c.o�[0m
*** Error 1 in target 'vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/vquic/vquic-tls.c.o'
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/cw-out.c:25:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup.h:816:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:113:8: error: redefinition of 'timeval'
struct timeval {
       ^
/usr/include/sys/socket.h:131:8: note: previous definition is here
struct timeval {
       ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/cw-out.c:25:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup.h:816:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:167:2: error: "Missing definition of macro sread!"
#error "Missing definition of macro sread!"
 ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:185:2: error: "Missing definition of macro swrite!"
#error "Missing definition of macro swrite!"
 ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/request.c:25:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup.h:816:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:113:8: error: redefinition of 'timeval'
struct timeval {
       ^
/usr/include/sys/socket.h:131:8: note: previous definition is here
struct timeval {
       ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/request.c:25:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup.h:816:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:167:2: error: "Missing definition of macro sread!"
#error "Missing definition of macro sread!"
 ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:185:2: error: "Missing definition of macro swrite!"
#error "Missing definition of macro swrite!"
 ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/cw-out.c:29:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/urldata.h:160:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/hostip.h:29:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_addrinfo.h:75:25: warning: declaration of 'struct hostent' will not be visible outside of this function [-Wvisibility]
Curl_he2ai(const struct hostent *he, int port);
                        ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/cw-out.c:29:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/urldata.h:203:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/cf-socket.h:29:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/sockaddr.h:32:24: error: field has incomplete type 'struct sockaddr_in'
    struct sockaddr_in sa_in;
                       ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/sockaddr.h:32:12: note: forward declaration of 'struct sockaddr_in'
    struct sockaddr_in sa_in;
           ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/sockaddr.h:34:25: error: field has incomplete type 'struct sockaddr_in6'
    struct sockaddr_in6 sa_in6;
                        ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/sockaddr.h:34:12: note: forward declaration of 'struct sockaddr_in6'
    struct sockaddr_in6 sa_in6;
           ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/request.c:27:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/urldata.h:160:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/hostip.h:29:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_addrinfo.h:75:25: warning: declaration of 'struct hostent' will not be visible outside of this function [-Wvisibility]
Curl_he2ai(const struct hostent *he, int port);
                        ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/vquic/curl_osslq.c:25:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup.h:816:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:113:8: error: redefinition of 'timeval'
struct timeval {
       ^
/usr/include/sys/socket.h:131:8: note: previous definition is here
struct timeval {
       ^
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/vquic/curl_osslq.c:25:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup.h:816:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:167:2: error: "Missing definition of macro sread!"
#error "Missing definition of macro sread!"
 ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/curl_setup_once.h:185:2: error: "Missing definition of macro swrite!"
#error "Missing definition of macro swrite!"
 ^
3 errors generated.
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/request.c:27:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/urldata.h:203:
In file included from /home/user/jsonschema/vendor/hydra/vendor/curl/lib/cf-socket.h:29:
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/sockaddr.h:32:24: error: field has incomplete type 'struct sockaddr_in'
    struct sockaddr_in sa_in;
                       ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/sockaddr.h:32:12: note: forward declaration of 'struct sockaddr_in'
    struct sockaddr_in sa_in;
           ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/sockaddr.h:34:25: error: field has incomplete type 'struct sockaddr_in6'
    struct sockaddr_in6 sa_in6;
                        ^
/home/user/jsonschema/vendor/hydra/vendor/curl/lib/sockaddr.h:34:12: note: forward declaration of 'struct sockaddr_in6'
    struct sockaddr_in6 sa_in6;
           ^
1 warning and 5 errors generated.
*** Error 1 in target 'vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/vquic/curl_osslq.c.o'
*** Error 1 in target 'vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/cw-out.c.o'
1 warning and 5 errors generated.
*** Error 1 in . (vendor/hydra/CMakeFiles/curl.dir/build.make:2400 'vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/request.c.o': cd /home/...)
*** Error 1 (vendor/hydra/CMakeFiles/curl.dir/build.make:2386 'vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/cw-out.c.o': cd /home/vassil...)
*** Error 1 (vendor/hydra/CMakeFiles/curl.dir/build.make:2414 'vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/vquic/curl_osslq.c.o': cd /h...)
*** Error 1 (vendor/hydra/CMakeFiles/curl.dir/build.make:2428 'vendor/hydra/CMakeFiles/curl.dir/vendor/curl/lib/vquic/vquic-tls.c.o': cd /ho...)
*** Error 2 in . (CMakeFiles/Makefile2:872 'vendor/hydra/CMakeFiles/curl.dir/all')
*** Error 2 in /home/user/jsonschema/build (Makefile:156 'all': /usr/bin/make -s -f CMakeFiles/Makefile2 all)

Script done on Wed Dec  4 18:21:11 2024

@jviotti
Copy link
Member

jviotti commented Dec 5, 2024

Hi @anoduck ,

Thanks for the response!

Ya, know? I probably need to figure that one out. I have never had to set up a CI pipeline, but I need to learn, other developers have done it with OpenBSD. So, I will have to get back with you on it in a few days.

Let me know if you come across anything on GitHub Actions and we can give it a shot.

Compiling didn't go as well as one would hope. It seems there were some issues compiling curl for hydra, and it does not appear these errors can be easily resolved.

Ah, right. Sounds fixable with some CMake fiddling, as cURL should definitely be buildable in all BSDs. If we manage to have a draft PR for running OpenBSD on GitHub Actions (at least a failing one), resolving the latter shouldn't be that hard!

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

2 participants