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

Document how to deploy artifacts generated with Nix+Bazel #291

Open
aherrmann opened this issue Dec 8, 2022 · 2 comments
Open

Document how to deploy artifacts generated with Nix+Bazel #291

aherrmann opened this issue Dec 8, 2022 · 2 comments

Comments

@aherrmann
Copy link
Member

Is your feature request related to a problem? Please describe.
Artifacts generated with Nix+Bazel may have a number of runtime dependencies: E.g. shared libraries residing in the Nix store, shared libraries residing in the Bazel output base, runfiles dependencies. To produce a deployable self-contained deployable we must make sure that all these runfile dependencies are bundled. This is not typically the case when we just naively copy the output files after building a given Bazel target.

Describe the solution you'd like
Documentation on how to generate self-contained, ideally relocatable artifacts.

Additional context
There are existing solutions to this problem out there:

  • clodl can be used to produce some degree of self-contained artifacts.
  • The Daml project uses package_app(package-app.sh) to bundle shared library dependencies (including those from the Nix store) and produce a relocatable bundle.
    Investigate which of these (and perhaps others) make sense to reference in the documentation.
@dmadisetti
Copy link
Contributor

Oh weird this was opened 5 hours ago. I was just going to ask for ideas.
There's also the nix bundle command: https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-bundle.html

I have been building and running in a singularity container, which makes cross system a little less painful- but a workable solution would be great.

@aherrmann
Copy link
Member Author

@dmadisetti Nice, thank you for sharing! I had forgotten about that one. AFAIK it would still require extra care to bundle Bazel defined runtime dependencies.

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

No branches or pull requests

2 participants