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

Add build-dir setting #10312

Merged
merged 3 commits into from
Mar 26, 2024
Merged

Add build-dir setting #10312

merged 3 commits into from
Mar 26, 2024

Conversation

roberth
Copy link
Member

@roberth roberth commented Mar 24, 2024

Motivation

  • Give the system admin fine grained control of the location where much build-related I/O happens.
  • Control access to the --keep-failed output a bit better.

Context

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Mar 24, 2024
@roberth roberth changed the title Add build dir Add build-dir setting Mar 24, 2024
@roberth roberth added the derivation-build The process of building an individual derivation (see also sandbox label) label Mar 24, 2024
Copy link

dpulls bot commented Mar 25, 2024

🎉 All dependencies have been resolved !

@thufschmitt
Copy link
Member

What's the motivation for that?

@edolstra
Copy link
Member

Indeed it seems that we generally want uniformity in the sandbox, so it's better not to be able to change /build. I guess it might be useful for testing whether /build leaks into the output.

@roberth
Copy link
Member Author

roberth commented Mar 25, 2024

What's the motivation for that?

Added:

  • Give the system admin fine grained control of the location where much build-related I/O happens.

  • Control access to the --keep-failed output a bit better.

Indeed it seems that we generally want uniformity in the sandbox, so it's better not to be able to change /build. I guess it might be useful for testing whether /build leaks into the output.

@edolstra That's the sandbox-build-dir option, which already exists. I'm only adding an option to control the physical location, not the mount point in the sandbox namespace.
I think you're right about the old option, although it could be improved for that use case.

@roberth roberth marked this pull request as ready for review March 25, 2024 19:18
@thufschmitt thufschmitt merged commit 6c10cc0 into NixOS:master Mar 26, 2024
8 checks passed
tebowy pushed a commit to tebowy/nix that referenced this pull request Jul 11, 2024
This is a squash of upstream PRs NixOS#10303, NixOS#10312 and NixOS#10883.

fix: Treat empty TMPDIR as unset

Fixes an instance of

    nix: src/libutil/util.cc:139: nix::Path nix::canonPath(PathView, bool): Assertion `path != ""' failed.

... which I've been getting in one of my shells for some reason.
I have yet to find out why TMPDIR was empty, but it's no reason for
Nix to break.

(cherry picked from commit c3fb2aa)

fix: Treat empty XDG_RUNTIME_DIR as unset

See preceding commit. Not observed in the wild, but is sensible
and consistent with TMPDIR behavior.

(cherry picked from commit b9e7f5a)

local-derivation-goal.cc: Reuse defaultTempDir()

(cherry picked from commit fd31945)

fix: remove usage of XDG_RUNTIME_DIR for TMP

(cherry picked from commit 1363f51)

tests/functional: Add count()

(cherry picked from commit 6221770)

Remove uncalled for message

(cherry picked from commit b1fe388)

Add build-dir setting

(cherry picked from commit 8b16cce)
Change-Id: Ic7b75ff0b6a3b19e50a4ac8ff2d70f15c683c16a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
derivation-build The process of building an individual derivation (see also sandbox label) with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants