Skip to content

Conversation

@timofey-barmin
Copy link

@timofey-barmin timofey-barmin commented Nov 5, 2025

Problem:
Say we have the following project structure:

/root_project
  rebar.config
  /apps
    /app1
      /rebar.config <- uses pc

and app1 needs to build a NIF library.

First trigger of rebar3 compile from /root_project builds NIF library correctly.

When rebar3 compile is triggered the second time, the NIF library will not be re-compiled even if its source files change, because the paths to the NIF sources and NIF objects are relative to /app1, while actual cwd is /root_project in this case.
The same error leads to incorrect behavior when cleaning the project (nothing gets cleaned up).

Solution:
Append project root to source and object paths before checking their last modification times.

Problem:
Say we have the followign project structure:

/root_project
  rebar.config
  /apps
    /app1
      /rebar.config <- uses pc

and app1 needs to build a NIF library.

First trigger of `rebar3 compile` from /root_project builds NIF library
correctly.

When `rebar3 compile` is triggered the second time, the NIF library
will not be re-compiled even if its source files change, because
the paths to the NIF sources and NIF objects are relative to /app1,
while actual cwd is /root_project in this case.
The same error leads to incorrect behavior when cleaning the project
(nothing gets cleaned up).

Solution:
Append project root to source and object paths before checking
their last modification times.
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

Successfully merging this pull request may close these issues.

1 participant