NobbZ

NobbZ

I’m currently looking into nix (the package manager) to eventually replace asdf-vm in my local development workflow and perhaps even to replace docker in my current CI…

Basically, the question is, if I use distillery or mix release in a derivation to build a release anywhere on a linux with nix available, can I safely use nix-copy-closure (or any other means of transfering the closure) to a host that might run ubuntu, redhat or anything else that I might not necessarily know in advance (though I know for sure those systems will have nix available).

Please lets not discuss about not knowing the system in advance, I know that this rarely happens, and it is not even true for me (it will be a ubuntu host), though I like to discuss the idea.

Showing Posts 1 to 4

Ankhers

Ankhers

I do not think you could just blindly do this. The two things that come to mind are

  1. Make sure you are not building on linux and deploying on mac (or vice versa)
  2. I think CPU architecture plays a roll in this? So do not build on x86_64 and deploy to ARM. (But maybe if you don’t include ERTS, it isn’t a problem? I’m really not sure.)

I have also heard that you will want to use the same OS down to the patch level for building and running. Though, I am not really sure how much that is actually required.

I would truly love to hear from people that have actual knowledge in releases to be able to break down when and why the suggestions are so strong to run on exact same versions of things.

NobbZ

NobbZ OP

In this setup I can guarantuee, its always some linux flavor, never macOS. Also Processor architecture will always be the same.

So in other words, I have to test it on my own? I hope I can spare some time for that during the month…

webuhu

webuhu

I haven’t thought of using nix-copy-closure - good idea.

But I’m already building my releases with Nix and deploy the result via rsync to my Alpine Linux (musl) server.
Currently I’m only successful as long as I build the release without ERTS and make sure Erlang (same version as for building) is installed on the target server (nix-env -iA nixpkgs.erlangR22).
Overwise the release doesn’t find the native libraries (NIFs).

As nix-copy-closure will possibly copy the Erlang dependency anyway to the server it might work immediately - but I’m not sure about that.

For the future I hope I can build my release with a cross compiled Erlang within Nix, so even a build with ERTS included for a different target (musl, ARM, …) is doable very easy…

Edit:
I’ve just updated my elixir_nix_seed Repo regarding the releases.

Ankhers

Ankhers

I quickly asked about a scenario like this on the Erlang slack last night. Here are a couple quotes.

this is true if you use at least one of:

  • include ERTS into your release
  • use NIFs or ports
    In other cases you do not need to build and run release on the same OS version

only if you include erts or crypto, which are both compiled for particular versions of dynamicly linked libraries that if they different on the host they can’t run

probably different versions of libc and OpenSSL

These quotes actually came from @hauleth and @tristan.

With that said, I think those kinds of things would come along with your package in your scenario.

— All posts loaded —

Where Next? Top

Trending in Questions Top

RSP87
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
nseaSeb
Hello, I know there is an approach for handling lists that allows for optimized traversal, but I can’t recall the specific method (somet...
New
brecabral
Documentation While reading the Scoped Routes section, I noticed that the documentation currently refers to a problem without explainin...
New
velrest
So my question is quite simple and i have found no conclusive answer on forum, google or AI. Should we use :erlang.float for Integer to ...
New
asweet-confluent
I recently noticed that Elixir’s Logger defaults its primary log level to :debug when no :logger, :level application configuration is pre...
New
apz
I’m new to elixir and just tried to install the elixirLS extension for VScode(ium) and it is throwing some errors that I would like help ...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
marciok
Hi there! We created Gust: A task orchestrator inspired by Airflow. For those who have never heard about Aiflow, it’s a Python-based wor...
New
mhanberg
Hi everyone! The first release candidate for the Expert language server project is now available! We’ve published a press release detai...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews