erlware / relx

Sane, simple release creation for Erlang
http://erlware.github.io/relx
Apache License 2.0
697 stars 232 forks source link

Don't assume current OS is target OS #533

Closed essen closed 7 years ago

essen commented 7 years ago

I have stumbled upon an issue while doing some trial and error that is worth noting but isn't a priority for me to fix at the moment.

There's at least one place where the current OS family is assumed to be the same on the one building the release and the one running it:

This is a blocker for cross-compilation/release building (unix -> windows or windows -> unix, specifically). In these cases users would be expected to specify the target OS in the configuration or when calling relx.

lrascao commented 7 years ago

The main difference between windows/linux releases is the start script, i suppose the way to provide cross-platform builds would be to always include both, the price to pay would be linux users carrying around .cmd files in their release and vice-versa

obi458 commented 7 years ago

See my pull request :-)

stchar commented 7 years ago

Hi @obi458, which one? i'm also interested in this feature)) I can see your change https://github.com/erlware/relx/commit/f80731ef6c9250f34dd1084c521495ea02dcf4f3

But I cannot realize how to set target OS?

obi458 commented 7 years ago

You can set the target OS in relx_jessie.config like, for example debian jessie:

%% debian {include_erts, "pathto/erlang_raspbian_jessie/erl8.2"}. {system_libs, "pathto/erlang_raspbian_jessie/erl8.2/lib"}. {output_dir, "./_rel/raspbian_jessie"}.

and run ./relx -c relx_jessie.config

For OS /= Windows there are no problems, but for OS = windows there are other startup commands, therefore we make the PR.

stchar commented 7 years ago

I'm actually interested in Windows =) Are you working on PR right now? Can you share anything I can look through?

stchar commented 7 years ago

Maybe I can help you

obi458 commented 7 years ago

The PR is ready to use, if you select, as explain above, an Erlang windows lib, the start commands will be for windows automatically.

lrascao commented 7 years ago

closing via #540