Cannot build flake with broken /etc/gitconfig #1086
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
awaiting
author
awaiting
contributors
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
Feature/S3
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
ux
No milestone
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lix-project/lix#1086
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Describe the bug
If
/etc/gitconfigis invalid,nixwill refuse to build any flake outputs, including a nixos system which would fix the gitconfig.Steps To Reproduce
/etc/gitconfig(I accidentially added invalid git aliases by forgetting!, but other invalid configs should cause the same issue)Expected behavior
Nix/Lix should not consider
/etc/gitconfigat all.gitconfigis a source for impurity, as aliases can drastically change the semantics of commands. This basically makes all ofgit.ccimpure, as it just shells out to system git:"git", true, {"-C", cacheDir, "--git-dir", ".", "symbolic-ref", "--", "HEAD", headRef}Ignoring functional impurities, i wouldn't expect my system to fail rebuilds because of a malformed
gitconfig.nix --versionoutputAdditional context
NixOS/nixpkgs should probably also validate the
/etc/gitconfigto be valid, but that does not address the impurity concerns.this is a bit tricky. the global and per-user git configs may contain things like credentials or credential helpers that can be mandatory to fetch some inputs at all, e.g. in closed environments that force authentication for all fetches. we also can't easily detect whether git failed due to a configuration error or something else because git doesn't communicate this in a machine-readable form. the best we could do here is to disable the global/per-user config via a setting, but without a user-local setting mechanism that is completely at odds with how the git config system works. maybe once the flake fissure is done we can come up with something good to do about this.
(we also do not consider this an impurity because it's not run during builds, but during eval. if we restricted all eval to be "fully pure" we'd lose the ability to fetch almost anything in settings that require authenticated fetches, which would be a bit of a disaster)
i kinda agree with both sides; and imo a broken config should be a warning not an error (as the latter results in an un-fixable machine)
also fetcher issue, not exclusively flakes (hence not blocked(?))