bitwalker / bitwalker/distillery

RFC: Do not dereference symlinks when archiving release

Open
#533 2 comments 0 reactions 1 assignee Claimed by @bitwalker View on GitHub
deployment:packaging feature:requested overlays
Dominant language
Elixir
Stars
3k
Forks
398
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce

A config provider configured like this:

```elixir
set config_providers: [
{Mix.Releases.Config.Providers.Elixir, ["${RELEASE_ROOT_DIR}/config.exs"]}
]
set overlays: [
{:link, "/etc/appconfig/config", "config.exs"}
]
```
I would expect that the unpacked release has a symlink `config.exs->/etc/appconfig/config`

Alas, I end up with a normal file (no symlink) at `config.exs`

### Verbose Logs

Paste the output of the release command you ran with the `--verbose` flag
below in the summary tags (this helps keep the issue easy to navigate):

```
...
==> Applying link overlay
src: /etc/appconfig/config.exs
dst: config.exs
...
```

### Description of issue

It seems that along the way of building/packaging the symlink information gets lost? Probably somewhere down `:systools.make_tar` it dereferences all symlinks it includes in that tarball?

For an overlay `:link` I think it also should not matter if the file the link points to is present at build time or not. But maybe this is intentionally enforced by the mighty erlang release tools. With the current behaviour, I can see no difference between `:copy` or `:link` overlays.

### Disclaimer

I probably did not understand correctly how the overlay link stuff is supposed to work, documentation seems a bit sparse on that matter. So apologies for any blindness on my part. Distillery is exceptional work!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.