-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Separate headers from source files (backport #12764) #12820
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
Merged
mergify
merged 2 commits into
2.28-maintenance
from
mergify/bp/2.28-maintenance/pr-12764
Mar 31, 2025
Merged
Separate headers from source files (backport #12764) #12820
mergify
merged 2 commits into
2.28-maintenance
from
mergify/bp/2.28-maintenance/pr-12764
Mar 31, 2025
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
This comment was marked as resolved.
This comment was marked as resolved.
ba54d9c
to
4026128
Compare
I fixed the conflicts, so this can be queued (but not "Enable auto-merged"). When the merge queue branch is made (from a rebase) the extra commits in here will disappear. |
@mergify queue |
✅ The pull request has been merged automaticallyThe pull request has been merged automatically at b36f6ea |
4026128
to
6479108
Compare
🎉 All dependencies have been resolved ! |
- Since it's now private, give it a rename. Note that I want to switch the word order on the public ones too. - Since it is only needed by two files, just include there rather than the nasty blanket-forced thing. (cherry picked from commit 326548b)
The short answer for why we need to do this is so we can consistently do `#include "nix/..."`. Without this change, there are ways to still make that work, but they are hacky, and they have downsides such as making it harder to make sure headers from the wrong Nix library (e..g. `libnixexpr` headers in `libnixutil`) aren't being used. The C API alraedy used `nix_api_*`, so its headers are *not* put in subdirectories accordingly. Progress on #7876 We resisted doing this for a while because it would be annoying to not have the header source file pairs close by / easy to change file path/name from one to the other. But I am ameliorating that with symlinks in the next commit. (cherry picked from commit f3e1c47)
6479108
to
15658b2
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
automatic backport
This PR is a backport produced by automation (does not trigger backporting)
c api
Nix as a C library with a stable interface
conflicts
documentation
fetching
Networking with the outside (non-Nix) world, input locking
merge-queue
new-cli
Relating to the "nix" command
repl
The Read Eval Print Loop, "nix repl" command and debugger
store
Issues and pull requests concerning the Nix store
with-tests
Issues related to testing. PRs with tests have some priority
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.
Motivation
The short answer for why we need to do this is so we can consistently do
#include "nix/..."
. Without this change, there are ways to still make that work, but they are hacky, and they have downsides such as making it harder to make sure headers from the wrong Nix library (e..g.libnixexpr
headers inlibnixutil
) aren't being used.The C API alraedy used
nix_api_*
, so its headers are not put in subdirectories accordingly.See comments on the script; this is supposed to avoid breaking muscle memory without complicating the build system (which proved harder than I thought too) or not doing the header hygiene change at all.
Context
Progress on #7876
We resisted doing this for a while because it would be annoying to not have the header source file pairs close by / easy to change file path/name from one to the other. But I am ameliorating that with symlinks in the final commit.
depends on #12831
depends on #12830
depends on #12833
Add 👍 to pull requests you find important.
The Nix maintainer team uses a GitHub project board to schedule and track reviews.
This is an automatic backport of pull request #12764 done by [Mergify](https://mergify.com).