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

Use nixpkgs crystal as base #23

Merged
merged 5 commits into from
Mar 28, 2024
Merged

Use nixpkgs crystal as base #23

merged 5 commits into from
Mar 28, 2024

Conversation

will
Copy link
Collaborator

@will will commented Mar 27, 2024

This gets rid of all the custom building of Crystal and just leaves the wrapping the complier into a more friendly distribution with all of the common libraries included and some of the helper functions and such.

Nixpkgs has gotten better at updating to new crystal releases faster lately, and also they maintain all 4 main platforms so there isn't a need to do our own bootstrapping of aarch64-linux anymore.

The only real loss is that nixpkgs crystal doesn't build with the beta interpreter enabled. However that seems like a good tradeoff for being able to just always fetch the base complier from the main nix caches.

This gets rid of all the custom building of Crystal and just leaves the
wrapping the complier into a more friendly distribution with all of the
common libraries included and some of the helper functions and such.

Nixpkgs has gotten better at updating to new crystal releases faster
lately, and also they maintain all 4 main platforms so there isn't a
need to do our own bootstrapping of aarch64-linux anymore.

The only real loss is that nixpkgs crystal doesn't build with the beta
interpreter enabled. However that seems like a good tradeoff for being
able to just always fetch the base complier from the main nix caches.
@will will requested a review from rbishop March 27, 2024 17:10
@will
Copy link
Collaborator Author

will commented Mar 27, 2024

Static compilation works for aarch64-darwin, but there is something wrong with aarch64-linux at least. I'm not sure if it's worth spending time tracking that down at the moment.

@will
Copy link
Collaborator Author

will commented Mar 27, 2024

I disabled checks for static builds, unless you have a quick idea of what is missing maybe @rbishop? I dont know why libevent would be unable to find symbols only when doing this static build and not the dynamic linking, since it's the same exact set of libraries.

[will@nixos:~]$ result/bin/crystal build a.cr
/nix/store/y00xcd5jqq6zlsqs24k8kxw94ppzmmwz-binutils-2.41/bin/ld: /nix/store/zpy6jb4zny70wfani7c2pfr0r5q1n3b3-libevent-static-aarch64-unknown-linux-musl-2.1.12/lib/libevent.a(evutil.o): in function `evutil_getenv_':
(.text+0x2cd0): undefined reference to `issetugid'

clang-15: error: linker command failed with exit code 1 (use -v to see invocation)

Error: execution of command failed with exit status 1: cc "${@}" -o /home/will/a
-rdynamic
-L/nix/store/fbd92bg0vgzlsvmzxhsgwqvgp0kl4k4i-boehm-gc-static-aarch64-unknown-linux-musl-8.2.4/lib
-L/nix/store/hmvsdnfi9s81bifahql3n6nxs7c0b7n7-gmp-with-cxx-static-aarch64-unknown-linux-musl-6.3.0/lib
-L/nix/store/zpy6jb4zny70wfani7c2pfr0r5q1n3b3-libevent-static-aarch64-unknown-linux-musl-2.1.12/lib
-L/nix/store/sff06r27nd3rjbs4v5g2476pnd0q17rc-libffi-static-aarch64-unknown-linux-musl-3.4.6/lib
-L/nix/store/iqn3id8fq7r1mfh72c9xdffvgwgps0sx-libxml2-static-aarch64-unknown-linux-musl-2.12.5/lib
-L/nix/store/vzqgd5r0znnmanqvsj9z6hlsyid70ny8-libyaml-static-aarch64-unknown-linux-musl-0.2.5/lib
-L/nix/store/qwzyn8qwvnf4g1nz13zm8926k1qai1c0-openssl-static-aarch64-unknown-linux-musl-3.0.13/lib
-L/nix/store/2v9x25iywsfsv7vh8j7hhbjkfw0d305b-pcre2-static-aarch64-unknown-linux-musl-10.43/lib 
-L/nix/store/hmcj23v98qxl9akviziqhcqhcvs0n8wf-zlib-static-aarch64-unknown-linux-musl-1.3.1/lib 
-L/nix/store/nqw7zkzp9mmi0avixxn0szlxxhvh3igx-boehm-gc-8.2.4/lib
 -L/nix/store/axgxx85mf3r5bcrg1w5i6fw143jx983y-pcre2-10.43/lib 
-L/nix/store/pdwx7snh84yxpxk1n2q4zzsczl5zwg9h-libevent-2.1.12/lib 
-L/nix/store/5wihi8hmnrirk6f7vg40p6kqivgi4z9j-libyaml-0.2.5/lib 
-L/nix/store/1ch4q190znxnxdbqy278f73fs7834b5g-zlib-1.3.1/lib 
-L/nix/store/8bj9m4jhq1193db8xxmfax5jnsg1i5f8-libxml2-2.12.5/lib 
-L/nix/store/n3m4sqchz4a45az2yb3xw1i1lrlzxh84-openssl-3.0.13/lib 
-lpcre2-8 -L/nix/store/nqw7zkzp9mmi0avixxn0szlxxhvh3igx-boehm-gc-8.2.4/lib 
-lgc -lpthread -ldl -lpthread 
-L/nix/store/pdwx7snh84yxpxk1n2q4zzsczl5zwg9h-libevent-2.1.12/lib 
-levent -lrt -lpthread -ldl

`

@will will merged commit cafe229 into main Mar 28, 2024
2 checks passed
@will will deleted the use-nixpkgs-more branch March 28, 2024 10:50
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

Successfully merging this pull request may close these issues.

1 participant