Hex.pm package doesn't include Makefile
surik opened this issue · comments
Makefile is required on build step for post_hooks
.
This is strange. As I understand it, "Makefile" is part of the default list of files picked up by hex.
https://github.com/inaka/hexer/blob/master/src/hexer_package.erl#L110
Ah, not in rebar3_hex:
https://github.com/hexpm/rebar3_hex/blob/master/src/rebar3_hex.hrl#L3
@uwiger will you re-publish it?
I have verified visually that rebar3 hex publish
will include the same files as before + Makefile
.
Version 1.8.3 published in hex.
Thank you. I'm testing it now:
$ mix compile
===> Compiling setup
src/setup.erl:166: Warning: export_all flag enabled - all functions will be exported
===> Unable to run post hooks for 'compile', command 'escriptize' not found.
** (Mix) Could not compile dependency :setup, "/Users/surik/.mix/rebar3 bare compile --paths "/Users/surik/Documents/prog/tube_streamer/_build/dev/lib/*/ebin"" command failed. You can recompile this dependency with "mix deps.compile setup", update it with "mix deps.update setup" or clean it with "mix deps.clean setup"
Ah, looks that in case of rebar3
we don't need Makefile because https://github.com/uwiger/setup/blob/master/rebar.config.script#L26-L32
But it fails with mix
I checked that setup itself compiles with rebar2 and rebar3.
Creating a bare-bones mix project with setup-1.8.3 as dependency:
uwpro-2:p1 uwiger$ mix deps.get
Resolving Hex dependencies...
Dependency resolution completed:
setup 1.8.3
* Getting setup (Hex package)
Checking package (https://repo.hex.pm/tarballs/setup-1.8.3.tar)
Fetched package
uwpro-2:p1 uwiger$ mix compile
==> setup (compile)
Compiled src/setup_lib.erl
Compiled src/setup_sup.erl
Compiled src/setup_srv.erl
Compiled src/setup_app.erl
Compiled src/setup_gen.erl
Compiled src/setup.erl
/Users/uwiger/lib/otp/18.3/bin/rebar skip_deps=true escriptize
==> setup (escriptize)
Compiled lib/p1.ex
Generated p1 app
Consolidated List.Chars
Consolidated Collectable
Consolidated String.Chars
Consolidated Enumerable
Consolidated IEx.Info
Consolidated Inspect
Can you show mix.lock
and your Elixir version? I use 1.4.5.
mix.lock:
%{"setup": {:hex, :setup, "1.8.3", "039c51ad715ead4682d63e6462b3e89efa812f02668ac08bcedfb2360d67282c", [], [], "hexpm"}}
$ mix -v
Mix 1.2.5
(that was the version installed by Homebrew)
I could reproduce the problem with version 1.5.1. Analyzing now.
In your case setup
is built by using rebar2
. On Elixir >= 1.4 it usesrebar3
by default, see https://github.com/elixir-lang/elixir/blob/v1.4/lib/mix/lib/mix/dep/loader.ex#L190
Also, with Elixir 1.4.5 setup
in mix.lock
looks like:
...
"setup": {:hex, :setup, "1.8.3", "039c51ad715ead4682d63e6462b3e89efa812f02668ac08bcedfb2360d67282c", [:rebar3], [], "hexpm"},
...
I can change :rebar3
to :rebar
manually here but don't think that it is a proper way.
So far, it seems as if this advice is the best way forward.
The problem seems related to the rebar3 'bare' mode.
Maybe temporary comment these lines or add some checks for mix?
Addressing this in rebar3 would feel much better. ;-)
I've commented on a related issue in rebar3:
erlang/rebar3#1568 (comment)
Pushed 1.8.4 to hex
Works for me. Thank you.
Very good. Thanks!