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

Restore ability to build Vere while using NixOS #263

Merged
merged 2 commits into from Mar 1, 2023

Conversation

midlyx-hatrys
Copy link
Contributor

@midlyx-hatrys midlyx-hatrys commented Feb 27, 2023

(After the move to Bazel took it away)

Can build, can run tests (which all even pass), can create usable compile_commands.json, yay.

(To be clear: this makes it possible to use Bazel to build Vere under NixOS, it does not reintroduce the Nix-based build system or anything like that)

@matthew-levan
Copy link
Contributor

Cool, thanks for opening this. I'm sure some folks will be happy to use it.

libtoolize is glibtoolize on macOS, so running bazel build :urbit just fails (as it can't find libtoolize when running the patched secp256k1 script). Is there a way we can omit using libtoolize, only apply the patch on Linux, or somehow gate the libtoolize command in the script to only run on Linux?

Having "libtoolize --copy --force" first thing in "autogen.sh" is a
totally normal thing people do, it is supposedly harmless and
idempotent, no idea why lack thereof is apparently only problematic on
NixOS.

So: when running on NixOS, libtoolize.
Bazel on NixOS is problematic -- it's packaged, but not patched to
actually _work_ outside of FHS environments.

Vere build system presents an additional accidental hurdle: it expects
the musl-cross-make toolchain to be under /usr/local/<target> and uses
sudo to install it there, as one does.  Unfortunately NixOS nerfs sudo
in user namespaces (which are used to implement FHS environments) for
security reasons, making it impossible to install the toolchain the
normal way.

So in order to restore the ability to build Vere under NixOS without
resorting to containers (which is unsporting), this commit adds a
flake, which defines a devshell, which provides the toolchain and all
the other needed tools.  So one can "nix develop", go get
coffee (first invocation may take 15 minutes or so, subsequent ones
will be instant until next nix store GC), and then "bazel build
:urbit" etc.
@midlyx-hatrys
Copy link
Contributor Author

Is there a way we can omit using libtoolize, only apply the patch on Linux, or somehow gate the libtoolize command in the script to only run on Linux?

Did the proper conservative thing and confined this change specifically to NixOS, thanks!

Copy link
Contributor

@matthew-levan matthew-levan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks again.

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.

None yet

3 participants