Change request: add triple target to default mix release output folder

46 views
Skip to first unread message

Patrick Glind

unread,
Feb 27, 2024, 6:17:19 AMFeb 27
to elixir-lang-core
Hi team,

I'm developing on a Mac and deploying/running in production on Linux.

Because cross compilation currently doesn't work, I've added a simple Docker run
script that does a mix release in order to create a Linux runnable output.

Currently it's not clear that this mix release is targeting Linux and sometimes I 'mix'
the releases when I want to do a quick test on the Mac (which fails to execute)
and on occasion I remove the _build folder to ensure I'm not messing up compilation/releases.

Currently I'm solving this problem by using `mix release --path ...` in the Docker script to add /linux/ as a sub path in the _build folder and stay clear of the Mac output.

I was dabbling a little bit into Rust the other day and saw that their `cargo build --release`
when cross compiling adds the triple target in the path like so:
`/target/x86_64-pc-windows-gnu/debug/`

It would be handy to have a triple target folder in the path as well for Elixir
either as a default or as a mix.exs -> releases: option
(I know a default would likely break things, so a releases option might be better)

Especially if Elixir ever supports cross compilation being able to distinguish between
the _build sub folders would be a benefit.

Thank you for consideration


José Valim

unread,
Feb 27, 2024, 6:34:19 AMFeb 27
to elixir-l...@googlegroups.com
Doing this now would certainly be a breaking change as it would break all usages of mix release today.

The easiest way to go about this is to add a "path: " key to your release configuration in your mix.exs, in which you can employ any triple target that you want. :erlang.system_info(:system_architecture) may be a good starting point.

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/da2cd65f-1008-45dd-b85f-26e627a3f6cbn%40googlegroups.com.

Patrick Glind

unread,
Feb 27, 2024, 7:48:37 AMFeb 27
to elixir-lang-core
Hi José,

I was looking for something like this, however the mix release page only shows `runtime_config_path: ...`
here:

and on the bottom of the page I see CLI options, which don't mention the runtime_config_path, so I assumed
I had to use the CLI --path option (which I currently do)

Is there some docs I'm missing with more information about the mix.exs releases configuration/options?
- I was also looking for a way to change the default release using the mix.exs file, but couldn't really find anything about that either
in the docs.

Thank you for your ongoing development of the language!

Patrick Glind

unread,
Feb 27, 2024, 7:51:19 AMFeb 27
to elixir-lang-core

José Valim

unread,
Feb 27, 2024, 7:59:00 AMFeb 27
to elixir-l...@googlegroups.com
We can likely improve the docs. The configuration is about configuring your app. For configuring the release, there is the options section above: https://hexdocs.pm/mix/1.16.1/Mix.Tasks.Release.html#module-options

Reply all
Reply to author
Forward
0 new messages