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

parse_trans package fails to compile #140

Closed
cmkarlsson opened this issue Feb 12, 2015 · 5 comments
Closed

parse_trans package fails to compile #140

cmkarlsson opened this issue Feb 12, 2015 · 5 comments

Comments

@cmkarlsson
Copy link
Contributor

I spoke to Tristran in #erlang channel about this. Just adding issue for completeness.

The parse_trans package (git://github.com/uwiger/parse_trans.git) fails to compile with:

undefined parse transform 'parse_trans_codegen'

This is because the rebar configuration option erl_first_files is not working as it should so should affect any package where erl_first_files is needed.

Quick fix is to modify rebar_erlc_compiler.erl L151:

{ErlFirstFiles, RestErls} =
        lists:partition(
          fun(Source) ->
                  lists:member(list_to_atom(filename:basename(Source, ".erl")), ErlFirstFilesConf)
          end, AllErlFiles),

to

{ErlFirstFiles, RestErls} =
        lists:partition(
          fun(Source) ->
                  lists:member(list_to_atom(filename:basename(Source, ".erl")),
                  [ list_to_atom(filename:basename(X, ".erl")) || X <- ErlFirstFilesConf])
          end, AllErlFiles),

Obviously a very ugly solution. I spoke to Tristran who wanted to rewrite this properly.

@ferd
Copy link
Collaborator

ferd commented Feb 12, 2015

I believe we had something similar in rebar2 patched lately in rebar/rebar#445 -- could this be related?

@tsloughter
Copy link
Collaborator

Yes and no. Here the important bug is it actually drops all "erl first" files because the paths don't match, rebar3 using absolute paths so it doesn't have to care what dir it is and rebar2 had assumed relative.

@tsloughter
Copy link
Collaborator

@cmkarlsson I suck, this is going to be a pain to make nice, so we should get your fix in now since it is an important fix.

Can you make a PR and add yourself to the THANKS file if you aren't already in it?

@tsloughter
Copy link
Collaborator

@cmkarlsson oh, but also take a look at that patch Fred linked to, looks like it needs to be part of this. Ignore the inttests in rebar2 though, just the little bit in rebar_erlc_compiler is needed.

@cmkarlsson
Copy link
Contributor Author

Sure I'll prepare a PR including the #445 from rebar.

tsloughter added a commit that referenced this issue Feb 13, 2015
Fix #140 and preserve erl_first_files order
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

3 participants