blt / port_compiler

A rebar3 port compiler
MIT License
65 stars 38 forks source link

v1.10.1 breaks cecho #55

Closed djnym closed 3 years ago

djnym commented 6 years ago

Hi, I was going through and attempting to update dependencies on a project and ran into an issue with the port_compiler v1.10.1.

Here's my test rebar.config

{ overrides, [
   { override, cecho, [
     { plugins, [
       { pc, { git, "git@github.com:blt/port_compiler.git", { tag, "v1.10.1" } } } ] } ] }
  ]
}.
{ deps, [
  { entop, {git, "git@github.com:mazenharake/entop.git", {tag, "0.4.0"} } }
  ]
}.

Then if I compile this

% rebar3 compile
===> Verifying dependencies...
===> Fetching entop ({git,"git@github.com:mazenharake/entop.git",
                                 {tag,"0.4.0"}})
===> Fetching cecho ({git,"https://github.com/mazenharake/cecho.git",
                                 {tag,"0.5.2"}})
===> Fetching pc ({git,"git@github.com:blt/port_compiler.git",
                              {tag,"v1.10.1"}})
===> Compiling pc
===> Compiling cecho
===> Found no source files for:
"c_src/cecho.c"
===> Missing artifact priv/cecho.so

However, if I switch back to v1.9.1 everything works as expected.

% rebar3 compile
===> Verifying dependencies...
===> Fetching entop ({git,"git@github.com:mazenharake/entop.git",
                                 {tag,"0.4.0"}})
===> Fetching cecho ({git,"https://github.com/mazenharake/cecho.git",
                                 {tag,"0.5.2"}})
===> Fetching pc ({git,"git@github.com:blt/port_compiler.git",
                              {tag,"v1.9.1"}})
===> Compiling pc
===> Compiling cecho
===> Compiling /home/molinaro/foo/_build/default/lib/cecho/c_src/cecho.c
===> Linking /home/molinaro/foo/_build/default/lib/cecho/priv/cecho.so
===> Compiling entop

Since there were only a few commits between v1.9.1 and v1.10.1 I check them all, and found this commit will cause the breakage https://github.com/blt/port_compiler/commit/94f0327672ab263e8e2e3d80826a0981046742e4 I'm not sure why as it seems innocuous enough, but maybe the filename:join/1 call is necessary?

igorclark commented 5 years ago

Hi, I just stumbled across the same issue. I have an OTP app with c_src files which builds just fine in its own app directory using any pc version. When I include it as a remote source dependency in deps in another OTP app's rebar.config, it builds fine using pc version <= 1.9.1, but with 1.10.1 I get the same error ===> Found no source files for:. Looks like 94f0327 might be the reason, as @djnym says, but I don't know enough about pc to try to fix it confidently. Will stick to 1.9.1 for now but wonder if other people are seeing it too.

tolbrino commented 5 years ago

@igorclark @djnym Does #56 solve your issue? I experience a similar problem.

djnym commented 5 years ago

@tolbrino sorry for the lateness, this does fix the issue, we should get this patch merged in and cut a new version of the plugin. @tuncer what do you think?