aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2023-03-23ci: Try to install something with Nix in the installer testThéophane Hufschmitt
2023-03-23Merge pull request #8095 from fricklerhandwerk/operators-formattingEelco Dolstra
doc: force line breaks where needed
2023-03-22Merge pull request #8078 from obsidiansystems/profile-mdJohn Ericson
Fix `nix profile --help`
2023-03-23Merge pull request #6865 from zuzuleinen/manual-nix-path-emptyValentin Gagarin
document what happens when NIX_PATH is empty
2023-03-22add linksValentin Gagarin
2023-03-22doc: force line breaks where neededValentin Gagarin
2023-03-22docker.nix: add an option to include flake-registry inside docker image (#6750)Alex Wied
Co-authored-by: Alex Wied <centromere@users.noreply.github.com> Co-authored-by: Rok Garbas <rok@floxdev.com>
2023-03-22Merge pull request #8082 from edolstra/add-linksEelco Dolstra
Add links to API docs / coverage analysis to the hacking section
2023-03-21Merge pull request #8085 from edolstra/fetchGit-mdEelco Dolstra
Fix rendering of fetchGit documentation
2023-03-21Fix rendering of fetchGit documentationEelco Dolstra
stripIndentation() doesn't support tabs, so the entire markdown ended up indented and thus rendered as a code block.
2023-03-21Merge pull request #8083 from edolstra/fix-nix-store-renderingEelco Dolstra
Fix misrendering of 'nix store --help'
2023-03-21generate-manpage.nix: Make more readableEelco Dolstra
2023-03-21Fix misrendering of 'nix store --help'Eelco Dolstra
There are no categories underneath 'nix store', so having 'nix store copy-log' in a category rendered as ':'.
2023-03-21Add links to API docs / coverage analysis to the hacking sectionEelco Dolstra
2023-03-20Merge pull request #8077 from edolstra/pts-hangEelco Dolstra
Open slave pseudoterminal before CLONE_NEWUSER
2023-03-20Fix `nix profile --help`John Ericson
The documentation hadn't be updated to reflect the new default profile location.
2023-03-20CleanupEelco Dolstra
2023-03-20Open slave pseudoterminal before CLONE_NEWUSEREelco Dolstra
Otherwise, when running as root and user namespaces are enabled, opening the slave fails with EPERM. Fixes "opening pseudoterminal slave: Permission denied" followed by a hang (https://hydra.nixos.org/build/213104244), and "error: getting sandbox mount namespace: No such file or directory" (#8072), which happens when the child fails very quickly and consequently reading /proc/<child>/ns fails.
2023-03-20Merge pull request #8075 from edolstra/api-docsEelco Dolstra
Fix internal-api rendering in Hydra
2023-03-20Fix internal-api rendering in HydraEelco Dolstra
Currently it gives a 500 error with "Do not know how to serve path '/nix/store/bym5sm8z2wpavnvzancb9gjdlgyzs1l8-nix-internal-api-docs-2.15.0pre20230320_e37f436/share/doc/nix/internal-api'."
2023-03-20Merge pull request #7968 from bobvanderlinden/pr-contributingThéophane Hufschmitt
Add CONTRIBUTING.md
2023-03-20Merge pull request #8070 from figsoda/quoteEelco Dolstra
docs: quote URL literals
2023-03-20Merge pull request #8068 from DieracDelta/jr/compile_darwinEelco Dolstra
Fix build aarch64-darwin for static library
2023-03-19docs: quote URL literalsfigsoda
2023-03-18fix: build aarch64-darwinJustin Restivo
2023-03-18Merge pull request #8064 from knedlsepp/flake-in-submoduleRobert Hensing
Add a test with flake.nix in a git submodule
2023-03-18tests/flake-in-submodule: Remove unnecessary rm -rfRobert Hensing
2023-03-17Add a test with flake.nix in a submoduleJosef Kemetmüller
I noticed a regression in the lazy-trees branch, which I'm trying to capture with this test. While the tests succeeds in master, the lazy-trees branch gives the following error message: error: access to path '/build/nix-test/tests/flakes/flake-in-submodule/rootRepo/submodule/flake.nix' is forbidden because it is not under Git control; maybe you should 'git add' it to the repository '/build/nix-test/tests/flakes/flake-in-submodule/rootRepo'?
2023-03-17Merge pull request #7891 from mupdt/shared-fs-out-linksJohn Ericson
no-op refactor: extract outLink generation into a function
2023-03-16Merge pull request #8057 from obsidiansystems/slight-test-cleanupJohn Ericson
Cleanup test skipping
2023-03-16Cleanup test skippingJohn Ericson
- Try not to put cryptic "99" in many places Factor out `exit 99` into `skipTest` function - Alows make sure skipping a test is done with a reason `skipTest` takes a mandatory argument - Separate pure conditionals vs side-effectful test skipping. "require daemon" already had this, but "sandbox support" did not.
2023-03-16Merge pull request #8049 from edolstra/unexpected-eofEelco Dolstra
Fix "unexpected EOF" errors on macOS
2023-03-16Merge pull request #8053 from DeterminateSystems/fix-structuredattrs-sandboxEelco Dolstra
LocalDerivationGoal: set NIX_ATTRS_*_FILE correctly for sandboxed builds
2023-03-16LocalDerivationGoal: set NIX_ATTRS_*_FILE correctly for sandboxed buildsLinus Heckemann
2023-03-15Merge pull request #7750 from obsidiansystems/no-args-prepareJohn Ericson
Make command infra less stateful and more regular
2023-03-15Make command infra less stateful and more regularJohn Ericson
Already, we had classes like `BuiltPathsCommand` and `StorePathsCommand` which provided alternative `run` virtual functions providing the implementation with more arguments. This was a very nice and easy way to make writing command; just fill in the virtual functions and it is fairly clear what to do. However, exception to this pattern were `Installable{,s}Command`. These two classes instead just had a field where the installables would be stored, and various side-effecting `prepare` and `load` machinery too fill them in. Command would wish out those fields. This isn't so clear to use. What this commit does is make those command classes like the others, with richer `run` functions. Not only does this restore the pattern making commands easier to write, it has a number of other benefits: - `prepare` and `load` are gone entirely! One command just hands just hands off to the next. - `useDefaultInstallables` because `defaultInstallables`. This takes over `prepare` for the one case that needs it, and provides enough flexiblity to handle `nix repl`'s idiosyncratic migration. - We can use `ref` instead of `std::shared_ptr`. The former must be initialized (so it is like Rust's `Box` rather than `Option<Box>`, This expresses the invariant that the installable are in fact initialized much better. This is possible because since we just have local variables not fields, we can stop worrying about the not-yet-initialized case. - Fewer lines of code! (Finally I have a large refactor that makes the number go down not up...) - `nix repl` is now implemented in a clearer way. The last item deserves further mention. `nix repl` is not like the other installable commands because instead working from once-loaded installables, it needs to be able to load them again and again. To properly support this, we make a new superclass `RawInstallablesCommand`. This class has the argument parsing and completion logic, but does *not* hand off parsed installables but instead just the raw string arguments. This is exactly what `nix repl` needs, and allows us to instead of having the logic awkwardly split between `prepare`, `useDefaultInstallables,` and `load`, have everything right next to each other. I think this will enable future simplifications of that argument defaulting logic, but I am saving those for a future PR --- best to keep code motion and more complicated boolean expression rewriting separate steps. The "diagnostic ignored `-Woverloaded-virtual`" pragma helps because C++ doesn't like our many `run` methods. In our case, we don't mind the shadowing it all --- it is *intentional* that the derived class only provides a `run` method, and doesn't call any of the overridden `run` methods. Helps with https://github.com/NixOS/rfcs/pull/134
2023-03-15Merge pull request #7690 from ShamrockLee/nix-hash-sriJohn Ericson
nix-hash: support base-64 and SRI format
2023-03-16nix-hash: support base-64 and SRI formatYueh-Shun Li
Add the --base64 and --sri flags for the Base64 and SRI format output. Add the --base16 flag to explicitly specify the hexadecimal format. Add the --to-base64 and --to-sri flag to convert a hash to the above mentioned format.
2023-03-15Merge pull request #8050 from figsoda/allrefsEelco Dolstra
respect allRefs=1 when using `nix flake prefetch`
2023-03-16test/hash.sh: add to-base32 test for nix hashYueh-Shun Li
2023-03-16tests/hash.sh: try: Use FORMAT_FLAG instead of EXTRAYueh-Shun Li
Do not rely on the "multiple format flag specified" behavior. Explicitly test without the format flag / with the --base16 flag.
2023-03-15respect allRefs=1 when using `nix flake prefetch`figsoda
2023-03-15Remove a variable in LocalDerivationGoalEelco Dolstra
2023-03-15Change builderOut from Pipe to AutoCloseFDEelco Dolstra
2023-03-15Remove "unexpected EOF" retry hackEelco Dolstra
2023-03-15Move pseudoterminal slave open to childEelco Dolstra
Hopefully this fixes "unexpected EOF" failures on macOS (#3137, #3605, #7242, #7702). The problem appears to be that under some circumstances, macOS discards the output written to the slave side of the pseudoterminal. Hence the parent never sees the "sandbox initialized" message from the child, even though it succeeded. The conditions are: * The child finishes very quickly. That's why this bug is likely to trigger in nix-env tests, since that uses a builtin builder. Adding a short sleep before the child exits makes the problem go away. * The parent has closed its duplicate of the slave file descriptor. This shouldn't matter, since the child has a duplicate as well, but it does. E.g. moving the close to the bottom of startBuilder() makes the problem go away. However, that's not a solution because it would make Nix hang if the child dies before sending the "sandbox initialized" message. * The system is under high load. E.g. "make installcheck -j16" makes the issue pretty reproducible, while it's very rare under "make installcheck -j1". As a fix/workaround, we now open the pseudoterminal slave in the child, rather than the parent. This removes the second condition (i.e. the parent no longer needs to close the slave fd) and I haven't been able to reproduce the "unexpected EOF" with this.
2023-03-14Simplify commonChildInit()Eelco Dolstra
2023-03-14Merge pull request #7989 from sysedwinistrator/flake-compat-sha256-mrThéophane Hufschmitt
add flake-compat to flake.nix and use sha256 in default.nix
2023-03-13Merge pull request #8033 from lbodor/stop-adding-dot-to-nix-dev-env-pathRobert Hensing
`print-dev-env`: stop inadvertently adding `.` to `PATH`
2023-03-13Merge pull request #6338 from Artturin/labelerValentin Gagarin
add labeler workflow