erlware / relx

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

Make tar structure compatible with plain `release_handler` upgrades #936

Open verbit opened 5 months ago

verbit commented 5 months ago

When creating a tar, relx produces the following structure (simplified for demonstration)

├── erts-13.1.5
│   └── ...
├── lib
│   └── ...
└── releases
    ├── 0.7.0
    │   ├── relup
    │   ├── start.boot
    │   ├── start.script
    │   ├── sys.config
    │   └── myrel.rel
    ├── RELEASES
    ├── start_erl.data
    └── myrel.rel

in a file named myrel-0.7.0.tar.gz.

Now, if I want to unpack that with release_handler, it expects the structure to look like this (note the name of the .rel files):

├── erts-13.1.5
│   └── ...
├── lib
│   └── ...
└── releases
    ├── 0.7.0
    │   ├── relup
    │   ├── start.boot
    │   ├── start.script
    │   ├── sys.config
    │   └── myrel-0.7.0.rel
    ├── RELEASES
    ├── start_erl.data
    └── myrel-0.7.0.rel

That is, when unpacking a release called RelPackageName.tar.gz, it expects the .rel files to be named RelPackageName.rel. The relx-generated script plays some tricks to make it work but that forces everyone to do the same when not using anything relx-specific for upgrades.

So my question is: Is there a reason relx uses RelName.rel for .rel files? Can this be changed to RelName-Vsn.rel to make the RelName-Vsn.tar.gz tar compatible with plain release_handler? Am I missing something?

tsloughter commented 5 months ago

Hm, I thought we fixed this in 4.0.0 but I see I had left an comment at the end https://github.com/erlware/relx/issues/729#issuecomment-520848982

I'm not sure yet about just changing this, there must have been a reason it wasn't simply changed.