lix/src/libstore
Matthew Bauer 693e68e09c Set maximum name length in Nix
Previously we allowed any length of name for Nix derivations. This is
bad because different file systems have different max lengths. To make
things predictable, I have picked a max. This was done by trying to
build this derivation:

  derivation {
    name = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
    builder = "/no-such-path";
    system = "x86_64-linux";
  }

Take off one a and it will not lead to file name too long. That ends
up being 212 a’s. An even smaller max could be picked if we want to
support more file systems.

Working backwards, this is why:

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa-${name}.drv.chroot

> 255 - 32 - 1 - 4 - 7 = 211
2019-08-28 12:32:54 -04:00
..
builtins Fix segfault in builtin fetchurl with hashed mirrors + SRI hashes 2019-06-01 15:27:43 +02:00
binary-cache-store.cc Revert "Fix 'error 9 while decompressing xz file'" 2019-07-10 19:46:15 +02:00
binary-cache-store.hh unsupported(): Show the name of the unsupported operation 2019-01-18 13:34:53 +01:00
build.cc Merge pull request #2995 from tweag/post-build-hook 2019-08-07 15:02:29 +02:00
builtins.hh Make <nix/buildenv.nix> a builtin builder 2018-03-20 17:28:09 +01:00
crypto.cc binary-cache-public-keys -> trusted-public-keys 2017-11-20 17:32:34 +01:00
crypto.hh Revert "Get rid of unicode quotes (#1140)" 2016-11-26 00:38:01 +01:00
derivations.cc Move structured attrs handling into a separate class 2018-09-28 14:32:46 +02:00
derivations.hh Move structured attrs handling into a separate class 2018-09-28 14:32:46 +02:00
download.cc conf: stalled-download-timeout: make tunable 2019-08-08 10:22:13 -04:00
download.hh conf: stalled-download-timeout: make tunable 2019-08-08 10:22:13 -04:00
export-import.cc Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00
fs-accessor.hh nix ls-{nar,store}: Return offset of files in the NAR if known 2017-12-07 01:07:07 +01:00
gc.cc Simplify 2019-08-02 18:39:16 +02:00
globals.cc config: use all of XDG_CONFIG_DIRS 2018-10-31 09:24:43 +01:00
globals.hh Merge pull request #2995 from tweag/post-build-hook 2019-08-07 15:02:29 +02:00
http-binary-cache-store.cc HttpBinaryCacheStore: Use default number of retries for NARs 2019-07-10 23:05:04 +02:00
legacy-ssh-store.cc unsupported(): Show the name of the unsupported operation 2019-01-18 13:34:53 +01:00
local-binary-cache-store.cc Make LocalBinaryCacheStore::narFromPath() run in constant memory 2018-05-30 13:34:57 +02:00
local-fs-store.cc Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00
local-store.cc nix-store --verify: Don't repair while holding the GC lock 2019-08-02 18:48:26 +02:00
local-store.hh Use BSD instead of POSIX file locks 2019-08-02 18:39:16 +02:00
local.mk Remove mentions of libformat, it no longer exists 2019-01-05 14:31:29 -05:00
machines.cc getMachines(): Cache result 2019-04-01 21:09:35 +02:00
machines.hh Replace $NIX_REMOTE_SYSTEMS with an option "builder-files" 2017-05-02 15:46:09 +02:00
misc.cc Simplify the callback mechanism 2018-05-30 13:34:37 +02:00
nar-accessor.cc Provide random access to cached NARs 2017-12-07 01:07:07 +01:00
nar-accessor.hh Fix build on gcc 7 2017-12-16 00:49:31 +01:00
nar-info-disk-cache.cc Fix assertion failure in NarInfoDiskCache 2018-12-12 17:13:22 +01:00
nar-info-disk-cache.hh HttpBinaryCacheStore: Fix caching of WantMassQuery 2016-06-01 16:24:17 +02:00
nar-info.cc Replace Unicode quotes in user-facing strings by ASCII 2017-07-30 12:32:45 +01:00
nar-info.hh Make the store directory a member variable of Store 2016-06-01 16:24:17 +02:00
nix-store.pc.in pkg-config files: Use c++17 2019-03-14 14:11:12 +01:00
optimise-store.cc Fix optimise-store.cc to skip more paths on macOS 2018-06-14 12:34:55 -04:00
parsed-derivations.cc experimental/optional -> optional 2019-03-14 14:10:52 +01:00
parsed-derivations.hh experimental/optional -> optional 2019-03-14 14:10:52 +01:00
pathlocks.cc pathlocks: add include to fcntl.h for O_CLOEXEC 2019-08-07 07:41:22 -05:00
pathlocks.hh Use BSD instead of POSIX file locks 2019-08-02 18:39:16 +02:00
profiles.cc only delete things older than current gen and update logic in doc as 2018-03-01 22:59:00 -05:00
profiles.hh this updates issues that were addressed by people in pr 2018-03-01 21:47:57 -05:00
references.cc Fix some random -Wconversion warnings 2018-05-02 13:56:34 +02:00
references.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
remote-fs-accessor.cc Provide random access to cached NARs 2017-12-07 01:07:07 +01:00
remote-fs-accessor.hh Provide random access to cached NARs 2017-12-07 01:07:07 +01:00
remote-store.cc findRoots(): Add 'censor' parameter 2019-03-14 13:53:34 +01:00
remote-store.hh experimental/optional -> optional 2019-03-14 14:10:52 +01:00
s3-binary-cache-store.cc Add a 5 seconds of timeouts to connect to S3. 2019-03-15 13:23:58 +01:00
s3-binary-cache-store.hh Fix getS3Stats() 2016-10-06 17:00:52 +02:00
s3.hh s3: make scheme configurable 2018-12-07 23:55:38 +01:00
sandbox-defaults.sb Remove extraneous comment 2017-11-08 16:17:32 +01:00
sandbox-minimal.sb Always use the Darwin sandbox 2017-06-06 18:44:49 +02:00
sandbox-network.sb OS X sandbox: Improve builtin sandbox profile 2017-05-31 17:25:51 +02:00
schema.sql Mark content-addressed paths in the Nix database and in .narinfo 2016-08-10 18:05:35 +02:00
serve-protocol.hh Make adding paths via nix-store --serve run in constant memory 2018-08-03 21:21:16 +02:00
sqlite.cc Use extended SQLite error codes 2018-05-30 13:25:03 +02:00
sqlite.hh Use boost::format from the boost package 2018-03-14 19:24:04 +01:00
ssh-store.cc Make 'nix copy --from ssh://...' run in constant memory 2018-03-21 23:10:40 +01:00
ssh.cc Revert "Restore parent mount namespace before executing a child process" 2019-02-05 10:49:19 +01:00
ssh.hh SSHMaster: Bypass SSH when connecting to localhost 2018-08-03 21:20:38 +02:00
store-api.cc Set maximum name length in Nix 2019-08-28 12:32:54 -04:00
store-api.hh nix-channel: Don't fetch binary-cache-url 2019-06-25 13:27:16 +02:00
worker-protocol.hh Make 'nix copy --to daemon' run in constant memory (daemon side) 2018-05-30 13:26:48 +02:00