bitwalker / bitwalker/distillery

Dependency order seems wrong in the .rel file

Open
#638 3 comments 0 reactions 0 assignees View on GitHub
bug:unexpected behaviour help-wanted investigating
Dominant language
Elixir
Stars
3k
Forks
398
PR merge metrics
No merged PRs in 30d

Description

### Steps to reproduce

I've created a repo at https://github.com/jschniper/distillery_order_ex with a sample application to reproduce the error. You might need to compile lager manually once in order for exometer to build.

### Description of issue

This occurs with version 2.0.12 on Linux with Elixir 1.6.6.

The rel/config.exs is the generated version with no modifications except for adding exometer to the applications list.

Basically the core of the issue is that if I add the config flag for hackney to export metrics via exometer and build the release, the application won't start because hackney is starting prior to exometer. I've toyed with the order of the applications in the mix file as well as in the rel/config.exs file and nothing seems to fix the issue.

From the systools docs, "the applications are sorted according to the dependencies between the applications. Where there are no dependencies, the order in the .rel file is kept."

Basically, I would expect exometer to be higher in the .rel file because of either the rel/config.exs file or the mix.exs file but it's consistently lower.

I'm wondering if the reverse sort that occurs at https://github.com/bitwalker/distillery/blob/master/lib/mix/lib/releases/models/release.ex#L483 might be causing this issue. I wasn't sure why the reverse sorting was happening and looking back at the commit (https://github.com/bitwalker/distillery/commit/ab8d308abfbfcd07a5df5ede2bebbf05ae2e65a0) it looked as though it might be code that was left over. This is all speculative, of course, and I can't wait to find out why I'm wrong but I've tried everything I could think of at this point to no avail.

Let me know if you need more information.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the startup failure with the linked distillery_order_ex sample repository on Distillery 2.0.12, Linux, and Elixir 1.6.6. Then inspect lib/mix/lib/releases/models/release.ex around line 483 and compare the application order from rel/config.exs and mix.exs. Done means the generated .rel file honors the expected dependency order and the release starts with exometer before hackney.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
build-system, release
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.