Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hex.pm package doesn't include Makefile #41

Closed
surik opened this issue Sep 14, 2017 · 19 comments
Closed

Hex.pm package doesn't include Makefile #41

surik opened this issue Sep 14, 2017 · 19 comments

Comments

@surik
Copy link
Contributor

surik commented Sep 14, 2017

Makefile is required on build step for post_hooks.

https://s3.amazonaws.com/s3.hex.pm/tarballs/setup-1.8.2.tar

@uwiger
Copy link
Owner

uwiger commented Sep 14, 2017

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

@uwiger
Copy link
Owner

uwiger commented Sep 14, 2017

@surik
Copy link
Contributor Author

surik commented Sep 15, 2017

@uwiger will you re-publish it?

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

I have verified visually that rebar3 hex publish will include the same files as before + Makefile.

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

Version 1.8.3 published in hex.

@surik
Copy link
Contributor Author

surik commented Sep 15, 2017

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"

@surik
Copy link
Contributor Author

surik commented Sep 15, 2017

Ah, looks that in case of rebar3we don't need Makefile because https://github.com/uwiger/setup/blob/master/rebar.config.script#L26-L32

But it fails with mix

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

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

@surik
Copy link
Contributor Author

surik commented Sep 15, 2017

Can you show mix.lock and your Elixir version? I use 1.4.5.

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

mix.lock:

%{"setup": {:hex, :setup, "1.8.3", "039c51ad715ead4682d63e6462b3e89efa812f02668ac08bcedfb2360d67282c", [], [], "hexpm"}}
$ mix -v
Mix 1.2.5

(that was the version installed by Homebrew)

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

I could reproduce the problem with version 1.5.1. Analyzing now.

@surik
Copy link
Contributor Author

surik commented Sep 15, 2017

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.

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

So far, it seems as if this advice is the best way forward.

The problem seems related to the rebar3 'bare' mode.

@surik
Copy link
Contributor Author

surik commented Sep 15, 2017

Maybe temporary comment these lines or add some checks for mix?

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

Addressing this in rebar3 would feel much better. ;-)

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

I've commented on a related issue in rebar3:
erlang/rebar3#1568 (comment)

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

Pushed 1.8.4 to hex

@surik
Copy link
Contributor Author

surik commented Sep 15, 2017

Works for me. Thank you.

@uwiger
Copy link
Owner

uwiger commented Sep 15, 2017

Very good. Thanks!

@uwiger uwiger closed this as completed Sep 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants