-
Notifications
You must be signed in to change notification settings - Fork 4
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): include directory using -iquote
instead of -I
#34
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
On macos, the compiler is doing a case-insensitive search for a `version` header file, included with `#include <version>` in the macos sdk. Using `-I` causes `vendor/libnatpmp-upstream` to be included in the system header search path, so the compiler picks up `vendor/libnatpmp-upstream/VERSION`, causing a compilation error: ``` vendor/nim-nat-traversal/vendor/libnatpmp-upstream/version:1:1: error: expected unqualified-id 20120821 ``` The gcc 14.2 docs describe how `-iquote` alleviates this issue (https://gcc.gnu.org/onlinedocs/gcc-14.2.0/cpp/Invocation.html#index-I): "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." An alternative option is put files needed to be included in an `/include` directory, and use `-I` with that directory. An example of this is explained in https://stackoverflow.com/a/53155014. More info can be found in similar issues: - the-tcpdump-group/libpcap#1331 - the-tcpdump-group/libpcap#1100 - the-tcpdump-group/libpcap#1043 - nmap/nmap#2747
92d0154
to
cf3481c
Compare
emizzle
added a commit
to codex-storage/nim-codex
that referenced
this pull request
Jan 22, 2025
- 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.
tersec
approved these changes
Jan 26, 2025
emizzle
added a commit
to codex-storage/nim-codex
that referenced
this pull request
Jan 28, 2025
- 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.
emizzle
added a commit
to codex-storage/nim-codex
that referenced
this pull request
Jan 28, 2025
Now that status-im/nim-nat-traversal#34 has been merged, change back to master commit
emizzle
added a commit
to codex-storage/nim-codex
that referenced
this pull request
Feb 6, 2025
- 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.
emizzle
added a commit
to codex-storage/nim-codex
that referenced
this pull request
Feb 7, 2025
- 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.
github-merge-queue bot
pushed a commit
to codex-storage/nim-codex
that referenced
this pull request
Feb 7, 2025
) * fix(build): compilation on macos when including nim-nat-traversal - 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. * bump nim-nat-traversal Now that status-im/nim-nat-traversal#34 has been merged, change back to master commit
emizzle
added a commit
to codex-storage/nim-codex
that referenced
this pull request
Feb 7, 2025
- 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.
emizzle
added a commit
to codex-storage/nim-codex
that referenced
this pull request
Feb 7, 2025
Now that status-im/nim-nat-traversal#34 has been merged, change back to master commit
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
On macos, the compiler is doing a case-insensitive search for a
version
header file, included with#include <version>
in the macos sdk. Using-I
causesvendor/libnatpmp-upstream
to be included in the system header search path, so the compiler picks upvendor/libnatpmp-upstream/VERSION
, causing a compilation error:The gcc 14.2 docs describe how
-iquote
alleviates this issue:An alternative option is put files needed to be included in an
/include
directory, and use-I
with that directory. An example of this is explained in https://stackoverflow.com/a/53155014.More info can be found in similar issues: