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

fix(build): compilation on macos when including nim-nat-traversal #1084

Merged
merged 2 commits into from
Feb 7, 2025

Conversation

emizzle
Copy link
Contributor

@emizzle emizzle commented Jan 22, 2025

Removes the VERSION rename to VERSION_temp in the Makefile, instead relying on a change in nim-nat-traversal.

The change in nim-nat-traversal uses -iqoute to include the nim-nat-traversal/vendor/libnatpmp-upstream directory in the search paths. -iquote will match the vendor/libnatpmp-upstream/VERSION file for #include "version" and not #include <version>, the latter being what is included by the macos sdk and was causing issues with -I. The gcc 14.2 docs describe how -iquote alleviates this issue:

Directories specified with -iquote apply only to the quote form of the directive, #include "file". Directories specified with -I, -isystem, or -idirafter apply to lookup for both the #include "file" and #include directives.

For more info, please see status-im/nim-nat-traversal#34.

NOTE: This PR relies on a branch of nim-nat-traversal due to status-im/nim-nat-traversal#34. It's probably best to wait for that to be merged first, before merging this PR.

@AuHau AuHau requested a review from munna0908 January 22, 2025 07:58
Copy link
Member

@AuHau AuHau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice solution! 🎉

- removes the `VERSION` rename to `VERSION_temp` in the Makefile
- instead, relies on `-iqoute` to include the `nim-nat-traversal/vendor/libnatpmp-upstream` directory in the search paths. `-iquote` will match the `vendor/libnatpmp-upstream/VERSION` file for `#include "version"` and not `#include <version>`, the latter being what is included by the macos sdk and was causing issues with `-I`. The [gcc 14.2 docs](https://gcc.gnu.org/onlinedocs/gcc-14.2.0/cpp/Invocation.html#index-I) describe how `-iquote` alleviates this issue:
> Directories specified with -iquote apply only to the quote form of the directive, #include "file". Directories specified with -I, -isystem, or -idirafter apply to lookup for both the #include "file" and #include <file> directives.

For more info, please see status-im/nim-nat-traversal#34.
Now that status-im/nim-nat-traversal#34 has been merged, change back to master commit
@emizzle emizzle force-pushed the fix/build/macos-compile-with-nat-traversal branch from 9c3c2dd to 3b79379 Compare January 28, 2025 04:50
@emizzle
Copy link
Contributor Author

emizzle commented Jan 28, 2025

@AuHau would you mind re-reviewing please 🙏

@dryajov dryajov added this pull request to the merge queue Feb 7, 2025
Merged via the queue into master with commit dfa90a9 Feb 7, 2025
19 checks passed
@dryajov dryajov deleted the fix/build/macos-compile-with-nat-traversal branch February 7, 2025 02:35
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.

3 participants