Andreas Rammhold
4fc4eb6c93
libexpr: remove unused attrError
...
The attrError variable is no longer used but still allocated on every
call to the findAlongAttrPath function.
2020-04-02 17:04:00 +02:00
Eelco Dolstra
a7540294cf
Merge pull request #3460 from NixOS/dev-shell
...
Backport 'nix dev-shell' from the flakes branch
2020-03-31 14:46:15 +02:00
Eelco Dolstra
3166b97174
nix shell -> nix dev-shell
2020-03-31 13:45:28 +02:00
mlatus
12556e5709
fix placeholder not substituted in passAsFile
2020-03-31 19:40:16 +08:00
Eelco Dolstra
e1a94ad852
Backport 'nix dev-shell' from the flakes branch
...
This also adds a '--profile' option to 'nix build' (replacing 'nix-env
--set').
2020-03-30 19:16:45 +02:00
Eelco Dolstra
367577d9a6
Fix macOS build
2020-03-30 17:00:40 +02:00
Eelco Dolstra
e322a16523
Remove global -I flags
...
(cherry picked from commit 2c692a3b14
)
2020-03-30 15:30:19 +02:00
Eelco Dolstra
0a10854f85
Misc changes from the flakes branch
2020-03-24 14:34:47 +01:00
Eelco Dolstra
c85097da7c
Fix --refresh with --no-net
...
https://hydra.nixos.org/build/110879699
(cherry picked from commit 5bbe793abf
)
2020-03-24 14:26:23 +01:00
Eelco Dolstra
6b824c78f1
nix: Add --refresh as an alias for --tarball-ttl 0
...
(cherry picked from commit e721f99817
)
2020-03-24 14:26:23 +01:00
Eelco Dolstra
777e21e596
nix path-info --json: Print hash in SRI format
...
(cherry picked from commit 442e665d6d
)
2020-03-24 14:26:23 +01:00
Eelco Dolstra
7a8de57d3e
Pretty-print 'nix why-depends' / 'nix-store -q --tree' output
...
Extracted from 678301072f
.
2020-03-24 14:26:23 +01:00
Eelco Dolstra
4260a22a55
absPath(): Use std::optional
...
(cherry picked from commit 1bf9eb21b7
)
2020-03-24 14:25:28 +01:00
Eelco Dolstra
f9611c7ae4
buildenv: Eliminate global variables, other cleanup
...
(cherry picked from commit b82f75464d
)
2020-03-24 14:06:47 +01:00
Eelco Dolstra
76e7d958ed
Fix coverage build
...
https://hydra.nixos.org/build/110757285
(cherry picked from commit b430a81a1f
)
2020-03-24 14:06:47 +01:00
Eelco Dolstra
231a8aa2c2
nix edit: Support non-derivation attributes
...
E.g.
$ nix edit .#nixosConfigurations.bla
now works.
(cherry picked from commit d2032edb2f
)
2020-03-24 14:06:47 +01:00
Eelco Dolstra
c1ca4f0acc
findAlongAttrPath(): Return position
...
(cherry picked from commit 0b013a54dc
)
2020-03-24 14:06:47 +01:00
Eelco Dolstra
1eb952d27a
findAlongAttrPath(): Throw AttrPathNotFound
...
(cherry picked from commit 6b0ca8e803
)
2020-03-24 14:06:47 +01:00
Eelco Dolstra
edc34cc1a2
Add function for quoting strings
...
(cherry picked from commit 7dcf5b011a
)
2020-03-24 13:44:04 +01:00
Eelco Dolstra
5a7e7fc35f
Use std::string_view
...
(cherry picked from commit 6529490cc1
)
2020-03-24 13:26:37 +01:00
Eelco Dolstra
c34a20e1f6
EvalState::allocAttr(): Add convenience method
...
(cherry picked from commit c02da99757
)
2020-03-24 13:26:37 +01:00
Eelco Dolstra
5885e20404
Merge pull request #3429 from LnL7/darwin-sandbox
...
darwin sandbox
2020-03-23 09:13:36 +01:00
Daiderd Jordan
2e9bc1245c
sandbox: fix /bin/sh on catalina
...
Sadly 10.15 changed /bin/sh to a shim which executes bash, this means it
can't be used anymore without also opening up the sandbox to allow bash.
Failed to exec /bin/bash as variant for /bin/sh (1: Operation not permitted).
2020-03-20 22:12:30 +01:00
Daiderd Jordan
f6c122aaeb
sandbox: allow pty devices
...
Nix now runs builds with a pseudo-terminal to enable colored build
output.
2020-03-20 21:58:45 +01:00
Daiderd Jordan
7f2df903d9
libstore: relax default sandbox-paths on darwin
2020-03-20 21:31:20 +01:00
Daiderd Jordan
afb78ebd34
libstore: disable resolve-system-dependencies hook
...
This is used to determine the dependency tree of impure libraries so nix
knows what paths to open in the sandbox. With the less restrictive
defaults it isn't needed anymore.
2020-03-20 21:21:56 +01:00
jakobrs
c5a488afc0
Remove the --delete option for --gc
...
Running `nix-store --gc --delete` will, as of Nix 2.3.3, simply fail
because the --delete option conflicts with the --delete operation.
$ nix-store --gc --delete
error: only one operation may be specified
Try 'nix-store --help' for more information.
Furthermore, it has been broken since at least Nix 0.16 (which was
released sometime in 2010), which means that any scripts which depend
on it should have been broken at least nine years ago. This commit
simply formally removes the option. There should be no actual difference
in behaviour as far as the user is concerned: it errors with the exact
same error message. The manual has been edited to remove any references
to the (now gone) --delete option.
Other information:
* Path for Nix 0.16 used:
/nix/store/rp3sgmskn0p0pj1ia2qwd5al6f6pinz4-nix-0.16
2020-03-19 19:41:23 +01:00
Eelco Dolstra
ef74fafc03
nix repl: Put EvalState on the heap
...
See 0629601da1
.
2020-03-19 13:52:28 +01:00
Eelco Dolstra
b244e65cdb
nix repl: Scan NixRepl for GC roots
...
Fixes #3175 .
2020-03-19 13:50:01 +01:00
John Ericson
68fe0d9809
Add missing #include <regex>
2020-03-13 21:24:35 -04:00
Eelco Dolstra
779ef8f5ef
Merge pull request #3380 from contrun/no-attr-path-for-installed
...
display attr-path only when queried available
2020-03-13 19:26:20 +01:00
YI
b6d794fb8d
display attr-path only when queried available
2020-03-14 00:36:26 +08:00
Eelco Dolstra
b816515f61
Fix ca-references feature check
...
Fixes #3406 .
2020-03-13 13:15:51 +01:00
Eelco Dolstra
d048577909
Merge pull request #3403 from hercules-ci/issue-3398-path-info-cache-ttls
...
pathInfoCache: Respect disk cache TTLs #3398
2020-03-12 11:43:31 +01:00
Robert Hensing
3f55f8a8fb
pathInfoCache: Respect disk cache TTLs #3398
2020-03-12 10:30:28 +01:00
Will Dietz
15edd2349e
local.mk: fix user-env.cc dep on buildenv.nix.gen.hh, resolve occasional build failure
2020-03-12 00:51:56 +01:00
Eelco Dolstra
9950cdec35
Move some corepkgs into the nix binary
2020-03-11 16:57:48 +01:00
Eelco Dolstra
e02481ded2
parseExprFromString(): Use std::string_view
2020-03-11 16:56:29 +01:00
Eelco Dolstra
8a1d8701f6
nix-store -q --graph: Fix edges
...
Fixes #3389 .
2020-03-10 11:11:46 +01:00
Eelco Dolstra
983fab7ea9
dotgraph.cc: Remove dead code
2020-03-10 11:06:55 +01:00
Eelco Dolstra
d37dc71e3c
nix-build: Fix !<output> handling
...
This was broken by 22a754c091
.
https://hydra.nixos.org/eval/1573669
2020-03-04 13:56:17 +01:00
Eelco Dolstra
75db069f92
Optimise Derivation::unparse()
...
In
nix-instantiate --dry-run '<nixpkgs/nixos/release-combined.nix>' -A nixos.tests.simple.x86_64-linux
this reduces time spent in unparse() from 9.15% to 4.31%. The main
culprit was appending characters one at a time to the destination
string. Even though the string has enough capacity, push_back() still
needs to check this on every call.
2020-03-04 11:44:45 +01:00
Eelco Dolstra
401b5bc541
builtins.cache: Cache regular expressions
...
The evaluator was spending about 1% of its time compiling a small
number of regexes over and over again.
2020-03-04 11:44:33 +01:00
Eelco Dolstra
22a754c091
Fix GC failures on bad store path names
...
It failed on names like '/nix/store/9ip48nkc9rfy0a4yaw98lp6gipqlib1a-'.
2020-02-28 18:07:10 +01:00
Eelco Dolstra
2e953b567e
Merge pull request #3325 from xzfc/clean-tmpdir
...
nix-shell: clean up the tmpDir and escape variables
2020-02-19 21:29:18 +01:00
Albert Safin
f2a03acf3f
nix-shell: clean up the tmpDir and escape variables
...
The problem fixed: each nix-shell invocation creates a new temporary
directory (`/tmp/nix-shell-*`) and never cleans up.
And while I'm here, shellescape all variables inlined into the rcfile.
See what might happen without escaping:
$ export TZ="';echo pwned'"
$ nix-shell -p hello --run hello
pwned
Hello, world!
2020-02-19 14:28:49 +00:00
Eelco Dolstra
2a14c28669
Merge pull request #3357 from carlosdagos/pure-nix-shell-proxy-env
...
Pass through http proxy env vars in pure shell
2020-02-19 13:02:02 +01:00
Eelco Dolstra
c4d3674de6
Merge pull request #3353 from tbsmoest/priv_tobias_pr_set_deathsig-1.4
...
Fix PR_SET_PDEATHSIG results in Broken pipe (#2395 )
2020-02-19 12:29:12 +01:00
Eelco Dolstra
553e584f92
LocalStore::checkDerivationOutputs(): Improve error message
2020-02-18 17:51:48 +01:00
Eelco Dolstra
d8fd31f50f
Disable the progress bar if $TERM == dumb or unset
...
Fixes #3363 .
2020-02-18 17:51:18 +01:00