Merge pull request #87182 from edolstra/no-experimental

Don't use the 'nix' command
This commit is contained in:
Eelco Dolstra 2020-05-07 15:47:06 +02:00 committed by GitHub
commit 06b9302baa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 27 deletions

View File

@ -24,16 +24,6 @@
</arg> </arg>
</group> </group>
</arg> </arg>
<arg>
<group choice='req'>
<arg choice='plain'>
<option>--print-build-logs</option>
</arg>
<arg choice='plain'>
<option>-L</option>
</arg>
</group>
</arg>
<arg> <arg>
<arg choice='plain'> <arg choice='plain'>
<option>-I</option> <option>-I</option>
@ -178,12 +168,6 @@
<para>Please note that this option may be specified repeatedly.</para> <para>Please note that this option may be specified repeatedly.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><option>--print-build-logs</option> / <option>-L</option></term>
<listitem>
<para>Print the full build logs of <command>nix build</command> to stderr.</para>
</listitem>
</varlistentry>
<varlistentry> <varlistentry>
<term> <term>
<option>--root</option> <option>--root</option>

View File

@ -143,7 +143,7 @@ class Logger:
self.logfile = os.environ.get("LOGFILE", "/dev/null") self.logfile = os.environ.get("LOGFILE", "/dev/null")
self.logfile_handle = codecs.open(self.logfile, "wb") self.logfile_handle = codecs.open(self.logfile, "wb")
self.xml = XMLGenerator(self.logfile_handle, encoding="utf-8") self.xml = XMLGenerator(self.logfile_handle, encoding="utf-8")
self.queue: "Queue[Dict[str, str]]" = Queue(1000) self.queue: "Queue[Dict[str, str]]" = Queue()
self.xml.startDocument() self.xml.startDocument()
self.xml.startElement("logfile", attrs={}) self.xml.startElement("logfile", attrs={})
@ -391,11 +391,11 @@ class Machine:
def execute(self, command: str) -> Tuple[int, str]: def execute(self, command: str) -> Tuple[int, str]:
self.connect() self.connect()
out_command = "( {} ); echo '|!EOF' $?\n".format(command) out_command = "( {} ); echo '|!=EOF' $?\n".format(command)
self.shell.send(out_command.encode()) self.shell.send(out_command.encode())
output = "" output = ""
status_code_pattern = re.compile(r"(.*)\|\!EOF\s+(\d+)") status_code_pattern = re.compile(r"(.*)\|\!=EOF\s+(\d+)")
while True: while True:
chunk = self.shell.recv(4096).decode(errors="ignore") chunk = self.shell.recv(4096).decode(errors="ignore")

View File

@ -15,7 +15,6 @@ mountPoint=/mnt
channelPath= channelPath=
system= system=
verbosity=() verbosity=()
buildLogs=
while [ "$#" -gt 0 ]; do while [ "$#" -gt 0 ]; do
i="$1"; shift 1 i="$1"; shift 1
@ -60,9 +59,6 @@ while [ "$#" -gt 0 ]; do
-v*|--verbose) -v*|--verbose)
verbosity+=("$i") verbosity+=("$i")
;; ;;
-L|--print-build-logs)
buildLogs="$i"
;;
*) *)
echo "$0: unknown option \`$i'" echo "$0: unknown option \`$i'"
exit 1 exit 1
@ -100,9 +96,9 @@ sub="auto?trusted=1"
if [[ -z $system ]]; then if [[ -z $system ]]; then
echo "building the configuration in $NIXOS_CONFIG..." echo "building the configuration in $NIXOS_CONFIG..."
outLink="$tmpdir/system" outLink="$tmpdir/system"
nix build --out-link "$outLink" --store "$mountPoint" "${extraBuildFlags[@]}" \ nix-build --out-link "$outLink" --store "$mountPoint" "${extraBuildFlags[@]}" \
--extra-substituters "$sub" \ --extra-substituters "$sub" \
-f '<nixpkgs/nixos>' system -I "nixos-config=$NIXOS_CONFIG" ${verbosity[@]} ${buildLogs} '<nixpkgs/nixos>' -A system -I "nixos-config=$NIXOS_CONFIG" ${verbosity[@]}
system=$(readlink -f $outLink) system=$(readlink -f $outLink)
fi fi

View File

@ -510,8 +510,7 @@ in
system.activationScripts.nix = stringAfter [ "etc" "users" ] system.activationScripts.nix = stringAfter [ "etc" "users" ]
'' ''
# Create directories in /nix. install -m 0755 -d /nix/var/nix/{gcroots,profiles}/per-user
${nix}/bin/nix ping-store --no-net
# Subscribe the root user to the NixOS channel by default. # Subscribe the root user to the NixOS channel by default.
if [ ! -e "/root/.nix-channels" ]; then if [ ! -e "/root/.nix-channels" ]; then