!sBfrWMVsLoSyFTCkNv:nixos.org

OfBorg

181 Members
Number of builds and evals in queue: <TBD>62 Servers

Load older messages


SenderMessageTime
16 Jun 2021
@rosariopulella:matrix.orgRosario Pulella joined the room.18:52:15
@sandro:supersandro.deSandroonly 15 seconds. I don't like my providers routing...21:45:32
@hexa:lossy.networkhexamaintainer review requests for teams are not working, are they? https://github.com/NixOS/nixpkgs/pull/125770/files22:54:42
@hexa:lossy.networkhexaor is this also about tests/modules in general?22:55:00
17 Jun 2021
@blaggacao:matrix.orgDavid Arnold (blaggacao) joined the room.18:28:11
@blaggacao:matrix.orgDavid Arnold (blaggacao)
def assemble_qemu_flags():
    flags = "-cpu max"
    flags += " -m 1024"
    return flags


qemu_flags = {"qemuFlags": assemble_qemu_flags()}

hd_flags = {
    "hdaInterface": "virtio",
    "hda": "vm-state-machine/machine.qcow2",
}

default_flags = {**hd_flags, **qemu_flags}


def create_machine_named(name):
    return create_machine({**default_flags, "name": name})


machine.start()

with subtest("Assert readiness of login prompt"):
    machine.succeed("echo hello")

with subtest("Wait for hard disks to appear in /dev"):
    machine.succeed("udevadm settle")

machine.succeed(
    "sgdisk -Z /dev/vda",
    "sgdisk -n 1:0:+1M -n 2:0:+1G -N 3 -t 1:ef02 -t 2:8200 -t 3:8300 -c 3:root /dev/vda",
    "mkswap /dev/vda2 -L swap",
    "swapon -L swap",
    "mkfs.btrfs -L root /dev/vda3",
    "btrfs device scan",
    "mount LABEL=root /mnt",
    "btrfs subvol create /mnt/boot",
    "btrfs subvol create /mnt/nixos",
    "btrfs subvol create /mnt/nixos/default",
    "umount /mnt",
    "mount -o defaults,subvol=nixos/default LABEL=root /mnt",
    "mkdir /mnt/boot",
    "mount -o defaults,subvol=boot LABEL=root /mnt/boot",
)


with subtest("Create the NixOS configuration"):
    machine.succeed("nixos-generate-config --root /mnt")
    machine.succeed("cat /mnt/etc/nixos/hardware-configuration.nix >&2")
    machine.copy_from_host(
        "/nix/store/jmypyz7q2ffcqg0dfa9xydz4wap04wsp-configuration.nix",
        "/mnt/etc/nixos/configuration.nix",
    )

with subtest("Perform the installation"):
    machine.succeed("nixos-install < /dev/null >&2")

with subtest("Do it again to make sure it's idempotent"):
    machine.succeed("nixos-install < /dev/null >&2")

with subtest("Shutdown system after installation"):
    machine.succeed("umount /mnt/boot || true")
    machine.succeed("umount /mnt")
    machine.succeed("sync")
    machine.shutdown()
# Now see if we can boot the installation.
machine = create_machine_named("boot-after-install")

# For example to enter LUKS passphrase.


with subtest("Assert that /boot get mounted"):
    machine.wait_for_unit("local-fs.target")
    machine.succeed("test -e /boot/grub")

with subtest("Check whether /root has correct permissions"):
    assert "700" in machine.succeed("stat -c '%a' /root")

with subtest("Assert swap device got activated"):
    # uncomment once https://bugs.freedesktop.org/show_bug.cgi?id=86930 is resolved
    machine.wait_for_unit("swap.target")
    machine.succeed("cat /proc/swaps | grep -q /dev")

with subtest("Check that the store is in good shape"):
    machine.succeed("nix-store --verify --check-contents >&2")

with subtest("Check whether the channel works"):
    machine.succeed("nix-env -iA nixos.procps >&2")
    assert ".nix-profile" in machine.succeed("type -tP ps | tee /dev/stderr")

with subtest(
    "Check that the daemon works, and that non-root users can run builds "
    "(this will build a new profile generation through the daemon)"
):
    machine.succeed("su alice -l -c 'nix-env -iA nixos.procps' >&2")

with subtest("Configure system with writable Nix store on next boot"):
    # we're not using copy_from_host here because the installer image
    # doesn't know about the host-guest sharing mechanism.
    machine.copy_from_host_via_shell(
        "/nix/store/6jcfa0im2sjsyhzbqgz51w6hwqhgd7x4-configuration.nix",
        "/etc/nixos/configuration.nix",
    )

with subtest("Check whether nixos-rebuild works"):
    machine.succeed("nixos-rebuild switch >&2")

with subtest("Test nixos-option"):
    kernel_modules = machine.succeed("nixos-option boot.initrd.kernelModules")
    assert "virtio_console" in kernel_modules
    assert "List of modules" in kernel_modules
    assert "qemu-guest.nix" in kernel_modules

machine.shutdown()

# Check whether a writable store build works
machine = create_machine_named("rebuild-switch")

machine.wait_for_unit("multi-user.target")

# we're not using copy_from_host here because the installer image
# doesn't know about the host-guest sharing mechanism.
machine.copy_from_host_via_shell(
    "/nix/store/v25vc36mamldkz4f067nyfy1z15r12g1-configuration.nix",
    "/etc/nixos/configuration.nix",
)
machine.succeed("nixos-rebuild boot >&2")
machine.shutdown()

# And just to be sure, check that the machine still boots after
# "nixos-rebuild switch".
machine = create_machine_named("boot-after-rebuild-switch")

machine.wait_for_unit("network.target")

machine.shutdown()

# Tests for validating clone configuration entries in grub menu


18:50:37
@blaggacao:matrix.orgDavid Arnold (blaggacao)

gives:

Traceback (most recent call last):
  File "/nix/store/rbdw7qvz9bga3k4h0p3awh5xkkh5p7ax-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 1050, in <module>
    run_tests(args.interactive)
  File "/nix/store/rbdw7qvz9bga3k4h0p3awh5xkkh5p7ax-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 931, in run_tests
    test_script()
  File "/nix/store/rbdw7qvz9bga3k4h0p3awh5xkkh5p7ax-nixos-test-driver/bin/.nixos-test-driver-wrapped", line 1020, in test_script
    exec(pathlib.Path(args.testscript).read_text())
  File "<string>", line 68, in <module>
  File "<string>", line 18, in create_machine_named
NameError: name 'default_flags' is not defined
18:50:55
@blaggacao:matrix.orgDavid Arnold (blaggacao)on https://logs.nix.ci/?key=nixos/nixpkgs.125979&attempt_id=c88f3cf3-3457-4138-9251-130b47ce178818:51:04
@blaggacao:matrix.orgDavid Arnold (blaggacao) NameError: name 'default_flags' is not defined -> File "<string>", line 18, in create_machine_named
But in line 14 of the script you clearly see default_flags.
18:51:50
@blaggacao:matrix.orgDavid Arnold (blaggacao)What's going on here?18:51:57
@blaggacao:matrix.orgDavid Arnold (blaggacao)

and print(default_flags) on my local machine just before with subtest("Create the NixOS configuration"): gives:

{'hdaInterface': 'virtio', 'hda': 'vm-state-machine/machine.qcow2', 'qemuFlags': '-cpu max -m 1024'}
18:55:27
@blaggacao:matrix.orgDavid Arnold (blaggacao)(I can't beleive this would have to do with ofborg)18:58:32
@blaggacao:matrix.orgDavid Arnold (blaggacao)Here is a debugging variant with quite a few print statments: https://logs.nix.ci/?key=nixos/nixpkgs.125979&attempt_id=91f8642a-c409-4e2a-8097-ad6125be9a19 (hope that could help)19:19:01
@blaggacao:matrix.orgDavid Arnold (blaggacao)This is a mircale, I set up a face PR to compare to the previous state of the world: https://github.com/NixOS/nixpkgs/pull/127259/19:45:07
@blaggacao:matrix.orgDavid Arnold (blaggacao) * This is a mircale, I set up a fake PR to compare to the previous state of the world: https://github.com/NixOS/nixpkgs/pull/127259/19:45:26
@blaggacao:matrix.orgDavid Arnold (blaggacao)

It looks like python would be configured to reset the locals() dict within the scope of a function:

{'hdaInterface': 'virtio', 'hda': 'vm-state-machine/machine.qcow2', 'qemuFlags': '-cpu max -m 1024'}
# within create_machine_named(name):
===locals===: {'name': 'boot-after-install'}
19:47:11
@blaggacao:matrix.orgDavid Arnold (blaggacao)I have a feeling these tests are failing since some time, already... Let's see what https://github.com/NixOS/nixpkgs/pull/127259/checks?check_run_id=2852425621 will show us.19:48:21
@blaggacao:matrix.orgDavid Arnold (blaggacao)OK, looks like my PR caused this python behaviour... https://github.com/NixOS/nixpkgs/pull/127259/checks?check_run_id=285256709520:02:45
@blaggacao:matrix.orgDavid Arnold (blaggacao)Nothing to do with ofborg, uff!20:02:56
@blaggacao:matrix.orgDavid Arnold (blaggacao)

Solution:

  • exec(x) -- globals initialized at the moment exec function is initialized
  • exec(x, globals()) -- globals initialized at the moment the function is called
  • default_flags was a global symbol
20:27:07
@blaggacao:matrix.orgDavid Arnold (blaggacao) *

Solution:

  • exec(x) -- globals initialized at the moment exec function object is initialized
  • exec(x, globals()) -- globals initialized at the moment the function object is called
  • default_flags was a global symbol
20:27:44
@blaggacao:matrix.orgDavid Arnold (blaggacao) *

Solution:

  • exec(x) -- globals initialized at the moment exec function object is initialized
  • exec(x, globals()) -- globals initialized at the moment the function object is called
  • default_flags was a global symbol
20:27:52
@blaggacao:matrix.orgDavid Arnold (blaggacao)* **Solution:** - `exec(x)` -- globals initialized at the moment exec function object is _initialized_ - `exec(x, globals())` -- globals initialized at the moment A globals is accessored (?) - late enough in any case - `default_flags` was a global symbol20:54:29
22 Jun 2021
@blaggacao:matrix.orgDavid Arnold (blaggacao)l.m.k.w.y.t. https://demo.hedgedoc.org/s/RO9YawHcY18:23:43
26 Jun 2021
@grahamc:nixos.org@grahamc:nixos.org invited @mjolnir:nixos.orgNixOS Moderation Bot.01:36:39
@mjolnir:nixos.orgNixOS Moderation Bot joined the room.01:36:41
@grahamc:nixos.org@grahamc:nixos.orgchanged room power levels.01:36:43
27 Jun 2021
@piegames:matrix.orgpiegames joined the room.13:38:36
@piegames:matrix.orgpiegames left the room.13:40:04
@piegames:matrix.orgpiegames joined the room.13:40:21

Show newer messages


Back to Room ListRoom Version: 6