Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push source into nix/ subdir to avoid annoying extra rebuilds #5589

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
149 changes: 75 additions & 74 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,105 +1,106 @@
Makefile.config
perl/Makefile.config
/nix/Makefile.config
/perl/Makefile.config

# /
/aclocal.m4
/autom4te.cache
/precompiled-headers.h.gch
/config.*
/configure
/nix/aclocal.m4
/nix/autom4te.cache
/nix/precompiled-headers.h.gch
/nix/config.*
/nix/configure
/stamp-h1
/svn-revision
/libtool

# /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/builtins.json
/doc/manual/src/SUMMARY.md
/doc/manual/src/command-ref/new-cli
/doc/manual/src/command-ref/conf-file.md
/doc/manual/src/language/builtins.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/libnixexpr-tests

# /src/libstore/
# /nix/doc/manual/
/nix/doc/manual/*.1
/nix/doc/manual/*.5
/nix/doc/manual/*.8
/nix/doc/manual/generated/*
/nix/doc/manual/nix.json
/nix/doc/manual/conf-file.json
/nix/doc/manual/builtins.json
/nix/doc/manual/src/SUMMARY.md
/nix/doc/manual/src/command-ref/new-cli
/nix/doc/manual/src/command-ref/conf-file.md
/nix/doc/manual/src/language/builtins.md

# /nix/scripts/
/nix/scripts/nix-profile.sh
/nix/scripts/nix-profile-daemon.sh
/nix/scripts/nix-profile.fish
/nix/scripts/nix-profile-daemon.fish

# /nix/src/libexpr/
/nix/src/libexpr/lexer-tab.cc
/nix/src/libexpr/lexer-tab.hh
/nix/src/libexpr/parser-tab.cc
/nix/src/libexpr/parser-tab.hh
/nix/src/libexpr/parser-tab.output
/nix/src/libexpr/nix.tbl
/nix/src/libexpr/tests/libnixexpr-tests

# /nix/src/libstore/
*.gen.*
/src/libstore/tests/libnixstore-tests
/nix/src/libstore/tests/libnixstore-tests

# /src/libutil/
/src/libutil/tests/libnixutil-tests
# /nix/src/libutil/
/nix/src/libutil/tests/libnixutil-tests

/src/nix/nix
/nix/src/nix/nix

# /src/nix-env/
/src/nix-env/nix-env
# /nix/src/nix-env/
/nix/src/nix-env/nix-env

# /src/nix-instantiate/
/src/nix-instantiate/nix-instantiate
# /nix/src/nix-instantiate/
/nix/src/nix-instantiate/nix-instantiate

# /src/nix-store/
/src/nix-store/nix-store
# /nix/src/nix-store/
/nix/src/nix-store/nix-store

/src/nix-prefetch-url/nix-prefetch-url
/nix/src/nix-prefetch-url/nix-prefetch-url

/src/nix-collect-garbage/nix-collect-garbage
/nix/src/nix-collect-garbage/nix-collect-garbage

# /src/nix-channel/
/src/nix-channel/nix-channel
# /nix/src/nix-channel/
/nix/src/nix-channel/nix-channel

# /src/nix-build/
/src/nix-build/nix-build
# /nix/src/nix-build/
/nix/src/nix-build/nix-build

/src/nix-copy-closure/nix-copy-closure
/nix/src/nix-copy-closure/nix-copy-closure

/src/error-demo/error-demo
/nix/src/error-demo/error-demo

/src/build-remote/build-remote
/nix/src/build-remote/build-remote

# /tests/
/tests/test-tmp
/tests/common.sh
/tests/result*
/tests/restricted-innocent
/tests/shell
/tests/shell.drv
/tests/config.nix
/tests/ca/config.nix
/tests/repl-result-out
# /nix/tests/
/nix/tests/test-tmp
/nix/tests/common.sh
/nix/tests/result*
/nix/tests/restricted-innocent
/nix/tests/shell
/nix/tests/shell.drv
/nix/tests/config.nix
/nix/tests/ca/config.nix
/nix/tests/repl-result-out

# /tests/lang/
/tests/lang/*.out
/tests/lang/*.out.xml
/tests/lang/*.ast
# /nix/tests/lang/
/nix/tests/lang/*.out
/nix/tests/lang/*.out.xml
/nix/tests/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
/nix/misc/systemd/nix-daemon.service
/nix/misc/systemd/nix-daemon.socket
/nix/misc/systemd/nix-daemon.conf
/nix/misc/upstart/nix-daemon.conf

/src/resolve-system-dependencies/resolve-system-dependencies
/nix/src/resolve-system-dependencies/resolve-system-dependencies

outputs/
/nix/outputs/

*.a
*.o
Expand Down
1 change: 1 addition & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#! /bin/sh -e
cd nix
rm -f aclocal.m4
mkdir -p config
exec autoreconf -vfi
25 changes: 18 additions & 7 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

officialRelease = false;

version = lib.fileContents ./.version + versionSuffix;
version = lib.fileContents ./nix/.version + versionSuffix;
versionSuffix =
if officialRelease
then ""
Expand Down Expand Up @@ -191,7 +191,7 @@
"-${client.version}-against-${daemon.version}";
inherit version;

src = self;
src = ./nix;

VERSION_SUFFIX = versionSuffix;

Expand Down Expand Up @@ -299,7 +299,7 @@
name = "nix-${version}";
inherit version;

src = self;
src = ./nix;

VERSION_SUFFIX = versionSuffix;

Expand Down Expand Up @@ -369,9 +369,20 @@
hardeningDisable = lib.optional stdenv.hostPlatform.isStatic "pie";

passthru.perl-bindings = with final; perl.pkgs.toPerlModule (currentStdenv.mkDerivation {
name = "nix-perl-${version}";

src = self;
pname = "nix-perl";
inherit version;

src = final.runCommand "nix-perl-src-${version}" {} ''
mkdir -p $out
cd $out
cp -r ${./perl} ./perl
cp -r ${./nix/config} ./config
mkdir -p nix
cp ${builtins.path { name = "version"; path = ./nix/.version; }} ./nix/.version
cp -r ${./nix/mk} ./nix/mk
mkdir -p nix/src
cp -r ${nix/src/nlohmann} ./nix/src/nlohmann
'';

nativeBuildInputs =
[ buildPackages.autoconf-archive
Expand Down Expand Up @@ -484,7 +495,7 @@
releaseTools.coverageAnalysis {
name = "nix-coverage-${version}";

src = self;
src = ./nix;

configureFlags = [
"CXXFLAGS=-I${lib.getDev pkgs.rapidcheck}/extras/gtest/include"
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion configure.ac → nix/configure.ac
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
AC_CONFIG_SRCDIR(.version)
AC_INIT([nix],[m4_esyscmd(bash -c "echo -n $(cat ./.version)$VERSION_SUFFIX")])
AC_CONFIG_MACRO_DIRS([m4])
AC_CONFIG_SRCDIR(README.md)
AC_CONFIG_AUX_DIR(config)

AC_PROG_SED
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
51 changes: 51 additions & 0 deletions nix/scripts/nix-http-export.cgi.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
#! /bin/sh

export HOME=/tmp
export NIX_REMOTE=daemon

TMP_DIR="${TMP_DIR:-/tmp/nix-export}"

@coreutils@/mkdir -p "$TMP_DIR" || true
@coreutils@/chmod a+r "$TMP_DIR"

needed_path="?$QUERY_STRING"
needed_path="${needed_path#*[?&]needed_path=}"
needed_path="${needed_path%%&*}"
#needed_path="$(echo $needed_path | ./unhttp)"
needed_path="${needed_path//%2B/+}"
needed_path="${needed_path//%3D/=}"

echo needed_path: "$needed_path" >&2

NIX_STORE="${NIX_STORE_DIR:-/nix/store}"

echo NIX_STORE: "${NIX_STORE}" >&2

full_path="${NIX_STORE}"/"$needed_path"

if [ "$needed_path" != "${needed_path%.drv}" ]; then
echo "Status: 403 You should create the derivation file yourself"
echo "Content-Type: text/plain"
echo
echo "Refusing to disclose derivation contents"
exit
fi

if @bindir@/nix-store --check-validity "$full_path"; then
if ! [ -e nix-export/"$needed_path".nar.gz ]; then
@bindir@/nix-store --export "$full_path" | @gzip@ > "$TMP_DIR"/"$needed_path".nar.gz
@coreutils@/ln -fs "$TMP_DIR"/"$needed_path".nar.gz nix-export/"$needed_path".nar.gz
fi;
echo "Status: 301 Moved"
echo "Location: nix-export/"$needed_path".nar.gz"
echo
else
echo "Status: 404 No such path found"
echo "Content-Type: text/plain"
echo
echo "Path not found:"
echo "$needed_path"
echo "checked:"
echo "$full_path"
fi

File renamed without changes.
Loading