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

NIF sources not found when used as a dependency #2

Open
jesperes opened this issue Mar 18, 2022 · 7 comments
Open

NIF sources not found when used as a dependency #2

jesperes opened this issue Mar 18, 2022 · 7 comments

Comments

@jesperes
Copy link

jesperes commented Mar 18, 2022

When crc32cer is used as a dependency, the NIF sources are not found, and the port compiler says:

===> Found no source files for:
"c_src/*.c"

This can be worked around by doing

{overrides,
 [{override, crc32cer,
   [{port_specs, [{"priv/crc32cer_nif.so", ["${REBAR_DEPS_DIR}/crc32cer/c_src/*.c"
                                           ]}
                 ]}
   ]}
 ]}.

in the parent project, but it would be nice if this worked out-of-the-box.

@zmstone
Copy link
Owner

zmstone commented Mar 18, 2022

crc32cer is used in many different rebar3 projects without such issue.
Which rebar3 version or pc plugin version is it in your parent project ?

@jesperes
Copy link
Author

Let me see if I can get you a minimal reproducible example of this.

@jesperes
Copy link
Author

To reproduce:

  1. Create an empty application:
$ rebar3 new app myapp
  1. Add a dependency to crc32cer:
{deps, [{crc32cer, {git, "[email protected]:zmstone/crc32cer.git", {tag, "0.1.10"}}}
       ]}.
  1. Try to build it:
09:35 $ rebar3 compile
===> Fetching rebar3_format v1.0.1
===> Fetching katana_code v1.1.1
===> Analyzing applications...
===> Compiling katana_code
===> Compiling rebar3_format
Not formatting the formatter. We're not on the regular compiling cycle
===> Verifying dependencies...
===> Fetching crc32cer (from {git,"[email protected]:zmstone/crc32cer.git",{tag,"0.1.10"}})
===> Fetching pc (from {git,"https://github.com/blt/port_compiler.git",{tag,"v1.10.2"}})
===> Analyzing applications...
===> Compiling pc
===> Found no source files for:
"c_src/*.c"
===> Analyzing applications...
===> Compiling crc32cer
===> Analyzing applications...
===> Compiling testapp

Note the error message.
4. Observe that there are no *.so files built

$ find _build | grep crc32.*so

@jesperes
Copy link
Author

Upgrading to latest port_compiler v1.14.0 does not have any effect.

@jesperes
Copy link
Author

$ rebar3 --version
rebar 3.18.0 on Erlang/OTP 23 Erts 11.2.2.2

@jesperes
Copy link
Author

Also, https://github.com/zmstone/snappyer suffers the same problem.

@rlipscombe
Copy link

I'm having the same problem (I'm on macOS). The workaround, er, works for me, too.

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