Comments (7)
I don't think this change is worthwhile on its own, but in conjunction with other issues such as adding improved input hashing or a JSON-based derivation format, it may make sense to make such changes. Realistically, the opportunity cost of doing this before the CLI is greater than the cost of changing the derivation JSON on an otherwise stable CLI.
Perhaps the new format wouldn't be too dissimilar anyway.
from nix.
Derivations do not rely on env for scheduling attributes and such, because those are Nix-specific fields, not dict entries.
This seems orthogonal to the JSON representation, because this is just how Nix derivation attributes are passed from the language to the store (i.e. via the environment). The derivation
primop takes a more-or-less arbitrary attrset in which some attributes have a special meaning to Nix. Changing that seems infeasible without causing massive incompatibilities.
from nix.
#9846 and this are companions, but neither is about changing the very stable A-Term format and builtins.derivation
. Instead they are about changing unstable and/or private things that we are are allowed to change.
Moving away from the A-Term format and builtins.derivation
can still happen, but on much longer time scales. These anticipates it but are still useful on their own.
from nix.
I don't think this change is worthwhile on its own
It's actually not clear to me what is being proposed here. nix derivation show
just shows the contents of the .drv file, and in .drvs, attributes like preferLocalBuild
are part of the environment. Changing that is out of scope for nix derivation show
. It shouldn't try to be clever about whether some attributes have a special meaning.
from nix.
@edolstra Then think about this dependency order
- #9846 No more
ParsedDerivation
. Things which are not actually env vars are stored separately inDerivation
. The A-Term parser/printer becomes more complicated. Many other thing things become simpler. - This issue. If the JSON implementation is to continue to not be clever, and not become clever like the A-Term implementation did in step 1, then the JSON representation must change.
from nix.
Attributes like preferLocalBuild
are environment variables. That's how it has always worked.
What problem is being solved here?
from nix.
The environment variables map should be just that --- arbitrary environment variables. That we are smuggling in special meaning with some of them is clearly not a good design decision made in a vacuum, but way to try to shove in more functionality in the pre-existing non-extensible A-Term format.
When one sets preferLocalBuild = true
with builtins.derivation
, it's OK if that continues to set an environment variable too -- indeed, for backwards compat, it's important that it continue to do so. But we should store the special preferLocalBuild
state in Derivation
separately from the environment variable, because the environment variable itself should have no special special meaning.
The JSON format should match the new Derivation
struct and also separate the special flag from the regular environment variable.
from nix.
Related Issues (20)
- nix config check command results in error that nix cannot find a very old version of nix in nix store
- builtins.path hash changed on IA drv output, between 2.18 and 2.19 HOT 7
- Cannot update Xanmod kernel latest HOT 1
- Facing issues in installing nix HOT 1
- "experimental feature is disabled" error should point to its source
- installables are evaluated when CLI feature is disabled
- Suspected remote build incompatibility between Nix 2.20 (initiator) and Nix 2.13 (remote) HOT 3
- Show the first few and last few stack frames by default HOT 7
- `make OPTIMIZE=0` still builds with `-O2` HOT 3
- Installer fails on macOS Ventura 13.6.3 HOT 10
- Getting problem installing nix HOT 7
- nixos --daemon in popos HOT 2
- `~nix~case~hack~1` suffix in directory name on `aarch64-darwin` HOT 2
- macOS installation: Could not find service "org.nixos.darwin-store" in domain for system HOT 25
- rev not found when using default/unspecified git submodule ref HOT 2
- Support the sha256 git object format
- Updating nix resulted in downgrade HOT 1
- docker: Unable to pull nix image from ghcr.io HOT 9
- Shorten some subcommands of `nix` HOT 3
- incorrect error message on failed string antiquotation coercions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix.