Skip to content
This repository has been archived by the owner on Apr 7, 2018. It is now read-only.

exrm unable to run release.clean after dependencies are independently compiled (prod only) #196

Closed
goneflyin opened this issue Sep 3, 2015 · 4 comments

Comments

@goneflyin
Copy link

I'm not quite sure what the cause of this is -- some dependency checking for files in the wrong place, perhaps? But it's easy to reproduce:

~/d/w/t/exrm_test ❯❯❯ mix new exrm_test
~/d/w/t/exrm_test ❯❯❯ cd exrm_test

<add exrm as a dependency to mix.exs>

~/d/w/t/exrm_test ❯❯❯ MIX_ENV=prod mix do deps.clean --all, deps.get, deps.compile
~/d/w/t/exrm_test ❯❯❯ MIX_ENV=prod mix release.clean --implode --no-confirm
Compiled lib/exrm_test.ex
Generated exrm_test app
Consolidated Access
Consolidated Collectable
Consolidated Enumerable
Consolidated Inspect
Consolidated List.Chars
Consolidated Range.Iterator
Consolidated String.Chars
Consolidated protocols written to _build/prod/consolidated
==> Removing release files for exrm_test-0.0.1...
** (UndefinedFunctionError) undefined function: ReleaseManager.Plugin.load_all/0 (module ReleaseManager.Plugin is not available)
    ReleaseManager.Plugin.load_all()
    lib/mix/tasks/release.clean.ex:91: Mix.Tasks.Release.Clean.execute_after_hooks/1
    lib/mix/tasks/release.clean.ex:41: Mix.Tasks.Release.Clean.do_run/1
    (mix) lib/mix/cli.ex:55: Mix.CLI.run_task/2
    (elixir) lib/code.ex:307: Code.require_file/2

I am only including the output from the last command -- the others are exactly as you would expect.

One more interesting note. Something critical does happen when the mix release.clean --implode --no-confirm is run, because if you run it a second time it compiles the dependencies first enabling the command to complete normally:

~/d/w/t/exrm_test ❯❯❯ MIX_ENV=prod mix release.clean --implode --no-confirm
WARN:  Missing plugins: [rebar3_hex]
==> neotoma (compile)
==> erlware_commons (compile)
WARN:  Missing plugins: [rebar3_hex]
==> bbmustache (compile)
==> conform
Compiled src/conf_parse.erl
Compiled lib/conform/parse.ex
Compiled lib/conform/type.ex
Compiled lib/conform/config.ex
Compiled lib/conform/utils/utils.ex
Compiled lib/mix/tasks/conform.archive.ex
Compiled lib/conform/types/enum.ex
Compiled lib/mix/tasks/conform.configure.ex
Compiled lib/conform.ex
Compiled lib/mix/tasks/conform.new.ex
Compiled lib/mix/tasks/conform.release.ex
Compiled lib/mix/tasks/conform.effective.ex
Compiled lib/conform/schema.ex
Compiled lib/conform/utils/code.ex
Compiled lib/conform/translate.ex
Generated conform app
==> getopt (compile)
==> providers (compile)
WARN:  Missing plugins: [rebar3_hex]
==> relx (compile)
==> exrm
Compiled lib/exrm/config.ex
Compiled lib/exrm/plugin.ex
Compiled lib/exrm/utils.ex
Compiled lib/exrm/plugins/consolidation.ex
Compiled lib/mix/tasks/release.plugins.ex
Compiled lib/exrm/appups.ex
Compiled lib/exrm/plugins/appups.ex
Compiled lib/exrm/plugins/conform.ex
Compiled lib/mix/tasks/release.clean.ex
Compiled lib/mix/tasks/release.ex
Generated exrm app
==> exrm_test
Compiled lib/exrm_test.ex
Generated exrm_test app
Consolidated Access
Consolidated Collectable
Consolidated Enumerable
Consolidated Inspect
Consolidated List.Chars
Consolidated Range.Iterator
Consolidated String.Chars
Consolidated protocols written to _build/prod/consolidated
==> Removing release files for exrm_test-0.0.1...
==> All release files for exrm_test-0.0.1 were removed successfully!
@bitwalker
Copy link
Owner

That's bizarre, I'll take a look.

@bitwalker
Copy link
Owner

You say prod only, so this only happens when running with MIX_ENV=prod?

@goneflyin
Copy link
Author

Yes, that's right. I tried to reproduce it without prefixing the commands with MIX_ENV=prod, and it didn't happen. My guess is that it has something to do with some compiled or generated files that it finds in prod, but some others that were never compiled/generated outside of prod that it's not looking for in the environment-specific location.

Or it could have nothing to do with that whatsoever, I'm really guessing out of the blue -- feel free to ignore me!

Thanks, BTW, for the very quick response -- sorry for the slow answer, I only just saw the notification now.

@goneflyin
Copy link
Author

Just tested and verified with exrm-0.19.5 -- works like a charm!

Thanks very much!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants