diff options
author | Katharina Fey <kookie@spacekookie.de> | 2020-04-19 14:57:25 +0200 |
---|---|---|
committer | Katharina Fey <kookie@spacekookie.de> | 2020-04-19 14:57:25 +0200 |
commit | 0ca211d4ec600fa7b3cc701e4997cd1e8d38ebdc (patch) | |
tree | 4f9b09ca5d55e44710f020bcf6621daa4fd6b73a /nixpkgs/nixos/lib | |
parent | 1c2ef52230ed2c8b2529c47ce6a857bdde46c7c7 (diff) | |
parent | b61999e4ad60c351b4da63ae3ff43aae3c0bbdfb (diff) |
Merge commit 'b61999e4ad60c351b4da63ae3ff43aae3c0bbdfb'
Diffstat (limited to 'nixpkgs/nixos/lib')
-rw-r--r-- | nixpkgs/nixos/lib/eval-config.nix | 4 | ||||
-rw-r--r-- | nixpkgs/nixos/lib/make-iso9660-image.sh | 1 | ||||
-rw-r--r-- | nixpkgs/nixos/lib/make-options-doc/default.nix | 6 | ||||
-rw-r--r-- | nixpkgs/nixos/lib/test-driver/test-driver.py | 15 | ||||
-rw-r--r-- | nixpkgs/nixos/lib/testing/jquery-ui.nix | 2 | ||||
-rw-r--r-- | nixpkgs/nixos/lib/testing/jquery.nix | 2 |
6 files changed, 20 insertions, 10 deletions
diff --git a/nixpkgs/nixos/lib/eval-config.nix b/nixpkgs/nixos/lib/eval-config.nix index 9892d6f160f..c8824c2690d 100644 --- a/nixpkgs/nixos/lib/eval-config.nix +++ b/nixpkgs/nixos/lib/eval-config.nix @@ -61,7 +61,7 @@ in rec { args = extraArgs; specialArgs = { modulesPath = builtins.toString ../modules; } // specialArgs; - }) config options; + }) config options _module; # These are the extra arguments passed to every module. In # particular, Nixpkgs is passed through the "pkgs" argument. @@ -69,5 +69,5 @@ in rec { inherit baseModules extraModules modules; }; - inherit (config._module.args) pkgs; + inherit (_module.args) pkgs; } diff --git a/nixpkgs/nixos/lib/make-iso9660-image.sh b/nixpkgs/nixos/lib/make-iso9660-image.sh index b7b1ab52a63..d4633d2c8d1 100644 --- a/nixpkgs/nixos/lib/make-iso9660-image.sh +++ b/nixpkgs/nixos/lib/make-iso9660-image.sh @@ -107,6 +107,7 @@ xorriso="xorriso -publisher nixos -graft-points -full-iso9660-filenames + -joliet ${isoBootFlags} ${usbBootFlags} ${efiBootFlags} diff --git a/nixpkgs/nixos/lib/make-options-doc/default.nix b/nixpkgs/nixos/lib/make-options-doc/default.nix index eee8f612410..772b7d3add9 100644 --- a/nixpkgs/nixos/lib/make-options-doc/default.nix +++ b/nixpkgs/nixos/lib/make-options-doc/default.nix @@ -86,7 +86,7 @@ let optionsList = lib.sort optionLess optionsListDesc; # Convert the list of options into an XML file. - optionsXML = pkgs.writeText "options.xml" (builtins.toXML optionsList); + optionsXML = builtins.toFile "options.xml" (builtins.toXML optionsList); optionsNix = builtins.listToAttrs (map (o: { name = o.name; value = removeAttrs o ["name" "visible" "internal"]; }) optionsList); @@ -133,6 +133,7 @@ in { optionsJSON = pkgs.runCommand "options.json" { meta.description = "List of NixOS options in JSON format"; + buildInputs = [ pkgs.brotli ]; } '' # Export list of options in different format. @@ -141,8 +142,11 @@ in { cp ${builtins.toFile "options.json" (builtins.unsafeDiscardStringContext (builtins.toJSON optionsNix))} $dst/options.json + brotli -9 < $dst/options.json > $dst/options.json.br + mkdir -p $out/nix-support echo "file json $dst/options.json" >> $out/nix-support/hydra-build-products + echo "file json-br $dst/options.json.br" >> $out/nix-support/hydra-build-products ''; # */ optionsDocBook = pkgs.runCommand "options-docbook.xml" {} '' diff --git a/nixpkgs/nixos/lib/test-driver/test-driver.py b/nixpkgs/nixos/lib/test-driver/test-driver.py index c27947bc610..07f27515990 100644 --- a/nixpkgs/nixos/lib/test-driver/test-driver.py +++ b/nixpkgs/nixos/lib/test-driver/test-driver.py @@ -6,6 +6,7 @@ from xml.sax.saxutils import XMLGenerator import _thread import atexit import base64 +import codecs import os import pathlib import ptpython.repl @@ -101,10 +102,12 @@ def make_command(args: list) -> str: def create_vlan(vlan_nr: str) -> Tuple[str, str, "subprocess.Popen[bytes]", Any]: global log log.log("starting VDE switch for network {}".format(vlan_nr)) - vde_socket = os.path.abspath("./vde{}.ctl".format(vlan_nr)) + vde_socket = tempfile.mkdtemp( + prefix="nixos-test-vde-", suffix="-vde{}.ctl".format(vlan_nr) + ) pty_master, pty_slave = pty.openpty() vde_process = subprocess.Popen( - ["vde_switch", "-s", vde_socket, "--dirmode", "0777"], + ["vde_switch", "-s", vde_socket, "--dirmode", "0700"], bufsize=1, stdin=pty_slave, stdout=subprocess.PIPE, @@ -115,6 +118,7 @@ def create_vlan(vlan_nr: str) -> Tuple[str, str, "subprocess.Popen[bytes]", Any] fd.write("version\n") # TODO: perl version checks if this can be read from # an if not, dies. we could hang here forever. Fix it. + assert vde_process.stdout is not None vde_process.stdout.readline() if not os.path.exists(os.path.join(vde_socket, "ctl")): raise Exception("cannot start vde_switch") @@ -139,7 +143,7 @@ def retry(fn: Callable) -> None: class Logger: def __init__(self) -> None: self.logfile = os.environ.get("LOGFILE", "/dev/null") - self.logfile_handle = open(self.logfile, "wb") + self.logfile_handle = codecs.open(self.logfile, "wb") self.xml = XMLGenerator(self.logfile_handle, encoding="utf-8") self.queue: "Queue[Dict[str, str]]" = Queue(1000) @@ -383,7 +387,7 @@ class Machine: if state != require_state: raise Exception( "Expected unit ‘{}’ to to be in state ".format(unit) - + "'active' but it is in state ‘{}’".format(state) + + "'{}' but it is in state ‘{}’".format(require_state, state) ) def execute(self, command: str) -> Tuple[int, str]: @@ -739,6 +743,7 @@ class Machine: self.shell, _ = self.shell_socket.accept() def process_serial_output() -> None: + assert self.process.stdout is not None for _line in self.process.stdout: # Ignore undecodable bytes that may occur in boot menus line = _line.decode(errors="ignore").replace("\r", "").rstrip() @@ -936,7 +941,7 @@ if __name__ == "__main__": machine.process.kill() for _, _, process, _ in vde_sockets: - process.kill() + process.terminate() log.close() tic = time.time() diff --git a/nixpkgs/nixos/lib/testing/jquery-ui.nix b/nixpkgs/nixos/lib/testing/jquery-ui.nix index abd59da2d28..05bd8dc2f94 100644 --- a/nixpkgs/nixos/lib/testing/jquery-ui.nix +++ b/nixpkgs/nixos/lib/testing/jquery-ui.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { ''; meta = { - homepage = https://jqueryui.com/; + homepage = "https://jqueryui.com/"; description = "A library of JavaScript widgets and effects"; platforms = stdenv.lib.platforms.all; }; diff --git a/nixpkgs/nixos/lib/testing/jquery.nix b/nixpkgs/nixos/lib/testing/jquery.nix index e272f66a576..732fdb3ba87 100644 --- a/nixpkgs/nixos/lib/testing/jquery.nix +++ b/nixpkgs/nixos/lib/testing/jquery.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { meta = with stdenv.lib; { description = "JavaScript library designed to simplify the client-side scripting of HTML"; - homepage = http://jquery.com/; + homepage = "http://jquery.com/"; license = licenses.mit; platforms = platforms.all; }; |