Merge changes Ifcb0d310,I664366b8,Ibe7cf546 into main

* changes:
  gitignore: delete 90% of it
  build-time: remove 20% more by PCH'ing C++ stdlib
  shellHook: make it actually run
This commit is contained in:
jade 2024-05-31 19:19:29 +00:00 committed by Gerrit Code Review
commit adedac70fa
12 changed files with 22 additions and 135 deletions

129
.gitignore vendored
View file

@ -1,128 +1,5 @@
Makefile.config
perl/Makefile.config
# /
/aclocal.m4
/autom4te.cache
/precompiled-headers.h.gch
/config.*
/configure
/stamp-h1
/svn-revision
/libtool
/config
# /doc/manual/
/doc/manual/*.1
/doc/manual/*.5
/doc/manual/*.8
/doc/manual/generated/*
/doc/manual/nix.json
/doc/manual/conf-file.json
/doc/manual/language.json
/doc/manual/xp-features.json
/doc/manual/src/command-ref/experimental-features-shortlist.md
/doc/manual/src/contributing/experimental-feature-descriptions.md
/doc/manual/src/release-notes/rl-next-generated.md
# /scripts/
/scripts/nix-profile.sh
/scripts/nix-profile-daemon.sh
/scripts/nix-profile.fish
/scripts/nix-profile-daemon.fish
# /src/libexpr/
/src/libexpr/lexer-tab.cc
/src/libexpr/lexer-tab.hh
/src/libexpr/parser-tab.cc
/src/libexpr/parser-tab.hh
/src/libexpr/parser-tab.output
/src/libexpr/nix.tbl
/src/libexpr/tests
/tests/unit/libexpr/libnixexpr-tests
# /src/libstore/
*.gen.*
/src/libstore/tests
/tests/unit/libstore/libnixstore-tests
# /src/libutil/
/src/libutil/tests
/tests/unit/libutil/libnixutil-tests
/src/nix/nix
/src/nix/doc
# /src/nix-env/
/src/nix-env/nix-env
# /src/nix-instantiate/
/src/nix-instantiate/nix-instantiate
# /src/nix-store/
/src/nix-store/nix-store
/src/nix-prefetch-url/nix-prefetch-url
/src/nix-collect-garbage/nix-collect-garbage
# /src/nix-channel/
/src/nix-channel/nix-channel
# /src/nix-build/
/src/nix-build/nix-build
/src/nix-copy-closure/nix-copy-closure
/src/error-demo/error-demo
/src/build-remote/build-remote
# /tests/functional/
/tests/functional/test-tmp
/tests/functional/common/vars-and-functions.sh
/tests/functional/result*
/tests/functional/restricted-innocent
/tests/functional/shell
/tests/functional/shell.drv
/tests/functional/config.nix
/tests/functional/ca/config.nix
/tests/functional/dyn-drv/config.nix
/tests/functional/repl-result-out
/tests/functional/debugger-test-out
/tests/functional/test-libstoreconsumer/test-libstoreconsumer
# /tests/functional/lang/
/tests/functional/lang/*.out
/tests/functional/lang/*.out.xml
/tests/functional/lang/*.err
/tests/functional/lang/*.ast
/perl/lib/Nix/Config.pm
/perl/lib/Nix/Store.cc
/misc/systemd/nix-daemon.service
/misc/systemd/nix-daemon.socket
/misc/systemd/nix-daemon.conf
/misc/upstart/nix-daemon.conf
/src/resolve-system-dependencies/resolve-system-dependencies
outputs/ outputs/
*.a
*.o
*.o.tmp
*.so
*.dylib
*.dll
*.exe
*.dep
*~
*.pc
*.plist
# GNU Global # GNU Global
GPATH GPATH
GRTAGS GRTAGS
@ -132,17 +9,11 @@ GTAGS
# ccls # ccls
/.ccls-cache /.ccls-cache
# auto-generated compilation database
compile_commands.json
nix-rust/target
result result
result-* result-*
.vscode/ .vscode/
.direnv/ .direnv/
.envrc.local
# clangd and possibly more # clangd and possibly more
.cache/ .cache/

View file

@ -87,11 +87,12 @@ pre-commit-run {
"file" "file"
"header" "header"
]; ];
excludes = [
''^src/pch/.*$''
# generated files; these will never actually be seen by this # generated files; these will never actually be seen by this
# check, and are left here as documentation # check, and are left here as documentation
excludes = [ ''(parser|lexer)-tab\.hh$''
"(parser|lexer)-tab\\.hh$" ''\.gen\.hh$''
"\\.gen\\.hh$"
]; ];
entry = lib.getExe pkgs.check-headers; entry = lib.getExe pkgs.check-headers;
}; };

View file

@ -169,7 +169,6 @@ stdenv.mkDerivation (finalAttrs: {
./boehmgc-coroutine-sp-fallback.diff ./boehmgc-coroutine-sp-fallback.diff
./doc ./doc
./misc ./misc
./precompiled-headers.h
./src ./src
./COPYING ./COPYING
] ]
@ -449,7 +448,10 @@ stdenv.mkDerivation (finalAttrs: {
shellHook = '' shellHook = ''
# don't re-run the hook in (other) nested nix-shells # don't re-run the hook in (other) nested nix-shells
function lixShellHook() { function lixShellHook() {
if [[ $name != lix-shell-env ]]; then # n.b. how the heck does this become -env-env? well, `nix develop` does it:
# https://git.lix.systems/lix-project/lix/src/commit/7575db522e9008685c4009423398f6900a16bcce/src/nix/develop.cc#L240-L241
# this is, of course, absurd.
if [[ $name != lix-shell-env && $name != lix-shell-env-env ]]; then
return; return;
fi fi

View file

@ -54,6 +54,7 @@ libcmd = library(
nlohmann_json, nlohmann_json,
lix_doc lix_doc
], ],
cpp_pch : ['../pch/precompiled-headers.hh'],
install : true, install : true,
# FIXME(Qyriad): is this right? # FIXME(Qyriad): is this right?
install_rpath : libdir, install_rpath : libdir,

View file

@ -145,6 +145,7 @@ libexpr = library(
include_directories : [ include_directories : [
'../libmain', '../libmain',
], ],
cpp_pch : ['../pch/precompiled-headers.hh'],
install : true, install : true,
# FIXME(Qyriad): is this right? # FIXME(Qyriad): is this right?
install_rpath : libdir, install_rpath : libdir,

View file

@ -30,6 +30,7 @@ libfetchers = library(
liblixutil, liblixutil,
nlohmann_json, nlohmann_json,
], ],
cpp_pch : ['../pch/precompiled-headers.hh'],
install : true, install : true,
# FIXME(Qyriad): is this right? # FIXME(Qyriad): is this right?
install_rpath : libdir, install_rpath : libdir,

View file

@ -20,6 +20,7 @@ libmain = library(
liblixutil, liblixutil,
liblixstore, liblixstore,
], ],
cpp_pch : ['../pch/precompiled-headers.hh'],
install : true, install : true,
# FIXME(Qyriad): is this right? # FIXME(Qyriad): is this right?
install_rpath : libdir, install_rpath : libdir,

View file

@ -220,6 +220,7 @@ libstore = library(
nlohmann_json, nlohmann_json,
], ],
cpp_args : cpp_args, cpp_args : cpp_args,
cpp_pch : ['../pch/precompiled-headers.hh'],
install : true, install : true,
# FIXME(Qyriad): is this right? # FIXME(Qyriad): is this right?
install_rpath : libdir, install_rpath : libdir,

View file

@ -129,6 +129,7 @@ libutil = library(
openssl, openssl,
nlohmann_json, nlohmann_json,
], ],
cpp_pch : ['../pch/precompiled-headers.hh'],
implicit_include_directories : true, implicit_include_directories : true,
install : true, install : true,
) )

View file

@ -89,6 +89,7 @@ nix = executable(
boehm, boehm,
nlohmann_json, nlohmann_json,
], ],
cpp_pch : ['../pch/precompiled-headers.hh'],
install : true, install : true,
# FIXME(Qyriad): is this right? # FIXME(Qyriad): is this right?
install_rpath : libdir, install_rpath : libdir,

View file

@ -68,6 +68,7 @@ libutil_tester = executable(
liblixutil_test_support, liblixutil_test_support,
nlohmann_json, nlohmann_json,
], ],
cpp_pch : ['../../src/pch/precompiled-headers.hh'],
) )
test( test(
@ -102,6 +103,7 @@ libstore_test_support = library(
include_directories : include_directories( include_directories : include_directories(
'libstore-support', 'libstore-support',
), ),
cpp_pch : ['../../src/pch/precompiled-headers.hh'],
) )
liblixstore_test_support = declare_dependency( liblixstore_test_support = declare_dependency(
include_directories : include_directories('libstore-support'), include_directories : include_directories('libstore-support'),
@ -135,6 +137,7 @@ libstore_tester = executable(
gtest, gtest,
nlohmann_json, nlohmann_json,
], ],
cpp_pch : ['../../src/pch/precompiled-headers.hh'],
) )
test( test(
@ -166,6 +169,7 @@ libexpr_test_support = library(
include_directories : include_directories( include_directories : include_directories(
'libexpr-support', 'libexpr-support',
), ),
cpp_pch : ['../../src/pch/precompiled-headers.hh'],
) )
liblixexpr_test_support = declare_dependency( liblixexpr_test_support = declare_dependency(
include_directories : include_directories('libexpr-support'), include_directories : include_directories('libexpr-support'),
@ -199,6 +203,7 @@ libexpr_tester = executable(
gtest, gtest,
nlohmann_json, nlohmann_json,
], ],
cpp_pch : ['../../src/pch/precompiled-headers.hh'],
) )
test( test(
@ -225,6 +230,7 @@ libcmd_tester = executable(
gtest, gtest,
boost, boost,
], ],
cpp_pch : ['../../src/pch/precompiled-headers.hh'],
) )
test( test(