Bug report: nix build succeeded in December 2024; now crashes. The upgrade to Vivado 2024 might have broken old builds. #356

Closed
opened 2025-02-04 23:53:41 +08:00 by Dimitris · 2 comments

Bug report

On 9 January 2025, I successfully compiled 2025_01_09_system_description.json based on artiq-zynq commit a0281e498927d5c8467dd18f28aa497cb75150fd (from 23 December 2024) on Vivado 2022.2 with terminal output 2025_01_09_vivado_build.log.

Now, I try to compile exactly the same .json-file with exactly the same artiq-zynq commit on exactly the same computer with exactly the same Vivado version (2022.2) and it crashes with terminal output:

firmware> FileNotFoundError: [Errno 2] No such file or directory: '/home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json'
firmware> make: *** [Makefile:21: ../build/pl.rs] Error 1
error: builder for '/nix/store/gcca7z0r35mlar5ck7pfiway7dbvw1cl-firmware.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/24lg5na5fcd1rqla3j4mvpjhz29ij1jw-kasli_soc-satellite-sd.drv' failed to build

(See further below for the full output.)

The FileNotFoundError is complete bullshit because cat [FILE_PATH_FROM_NIX_ERROR] successfully prints out the contents of the system description file. (Again, see further below for the full output.)

The relevant line from the old terminal output 2025_01_09_vivado_build.log reads:

firmware> python gateware/kasli_soc.py -r ../build/pl.rs -c ../build/rustc-cfg -m ../build/mem.rs /nix/store/ladp6b9s4zh1c546qdpxd78h2k3qp27j-kasli_soc_artiq_master_20250109_drtio_master_wrpll_true_sed_lanes_32_peripherals_12_DIO_SMA.json

Clearly, nix used to copy the .json-file somewhere into /nix/store/... but now it doesn't anymore and instead complains that it cannot find the file.

Which leads me to my question:

Has the nix environment of artiq-zynq commit a0281e498927d5c8467dd18f28aa497cb75150fd changed between 9 January 2025 and now (4 February 2025)?

I ask because you use --impure in your nix build command, so there is no guarantee that the nix environment is exactly the same...

Maybe your changes to flake.nix and to the packages on the M-Labs server for the upgrade to Vivado 2024.2 caused unwanted changes to the nix environment of older commits, which require Vivado 2022.2?

Full error log (today)

~/workspace/sinara-firmware-compiler/examples   main !59 ?7 ❯ python run_compilation.py
firmware> Running phase: unpackPhase
firmware> unpacking source archive /nix/store/v37x6xfj6p9hwibcg35957s7bhasfn0j-src
firmware> source root is src
firmware> Executing cargoSetupPostUnpackHook
firmware> Finished cargoSetupPostUnpackHook
firmware> Running phase: patchPhase
firmware> Executing cargoSetupPostPatchHook
firmware> Validating consistency between /build/src/Cargo.lock and /build/cargo-vendor-dir/Cargo.lock
firmware> Finished cargoSetupPostPatchHook
firmware> Running phase: updateAutotoolsGnuConfigScriptsPhase
firmware> Running phase: configurePhase
firmware> Running phase: buildPhase
firmware> mkdir -p ../build
firmware> python gateware/kasli_soc.py -r ../build/pl.rs -c ../build/rustc-cfg -m ../build/mem.rs /home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json
firmware> Traceback (most recent call last):
firmware>   File "/build/src/gateware/kasli_soc.py", line 672, in <module>
firmware>     main()
firmware>   File "/build/src/gateware/kasli_soc.py", line 644, in main
firmware>     description = jsondesc.load(args.description)
firmware>                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
firmware>   File "/nix/store/010zdis9cc39rjjcvq7w5v2lrks6vkv6-python3-3.12.7-env/lib/python3.12/site-packages/artiq/coredevice/jsondesc.py", line 29, in load
firmware>     with open(description_path, "r") as f:
firmware>          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
firmware> FileNotFoundError: [Errno 2] No such file or directory: '/home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json'
firmware> make: *** [Makefile:21: ../build/pl.rs] Error 1
error: builder for '/nix/store/gcca7z0r35mlar5ck7pfiway7dbvw1cl-firmware.drv' failed with exit code 2
error: 1 dependencies of derivation '/nix/store/24lg5na5fcd1rqla3j4mvpjhz29ij1jw-kasli_soc-satellite-sd.drv' failed to build
Traceback (most recent call last):
  File "/home/m1/workspace/sinara-firmware-compiler/examples/run_compilation.py", line 22, in <module>
    sinara.run_firmware_compilation(artiq_zynq_path, json_file_path)
  File "/home/m1/workspace/sinara-firmware-compiler/sinara_firmware_compiler/compile_firmware_kasli_soc.py", line 77, in run_firmware_compilation
    shell_wrapper(f"nix develop --command nix build --print-build-logs {nix_build_expression}",
  File "/home/m1/workspace/sinara-firmware-compiler/sinara_firmware_compiler/shell_handling.py", line 31, in shell_wrapper
    raise Exception(message)
Exception: Error when running the following shell command with sinara.shell_wrapper() -> subprocess.run():
cd "/home/m1/workspace/artiq-zynq" && nix develop --command nix build --print-build-logs --impure --expr '
    let
        fl = builtins.getFlake "/home/m1/workspace/artiq-zynq";
    in
        (fl.makeArtiqZynqPackage {
            target  = "kasli_soc";
            variant = "satellite";
            json    = "/home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json";
        }).kasli_soc-satellite-sd
'
returncode: 1
stdout: None
stderr: None

The FileNotFoundError is complete bullshit because the file is obviously there:

~/workspace/sinara-firmware-compiler/examples   main !59 ?7 ❯ cat /home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json                    
{
    "target": "kasli_soc",
    "hw_rev": "v1.1",
    "base": "use_drtio_role",
    "drtio_role": "satellite",
    "enable_wrpll": false,
    "sed_lanes": 32,
    "min_artiq_version": "8.0",
    "core_addr": "10.0.0.50",
    "variant": "crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50",
    "peripherals": [
        {
            "type": "fastino",
            "hw_rev": "v1.3",
            "ports": [
                0
            ]
        },
        {
            "type": "fastino",
            "hw_rev": "v1.3",
            "ports": [
                2
            ]
        }
    ]
}

Small note: I also tried to compile artiq-zynq commit a0281e498927d5c8467dd18f28aa497cb75150fd with Vivado 2024.2, but it crashed of course because it was looking for Vivado 2022.2's files.

# Bug report On 9 January 2025, I successfully compiled [2025_01_09_system_description.json](/attachments/c867252f-0f6d-4c92-911c-cc7f42afad97) based on artiq-zynq commit [a0281e498927d5c8467dd18f28aa497cb75150fd](https://git.m-labs.hk/M-Labs/artiq-zynq/commit/a0281e498927d5c8467dd18f28aa497cb75150fd) (from 23 December 2024) on **Vivado 2022.2** with terminal output [2025_01_09_vivado_build.log](/attachments/7e57ea3c-3933-4904-8a59-0551eb502456). Now, I try to compile exactly the same `.json`-file with exactly the same artiq-zynq commit on exactly the same computer with exactly the same Vivado version (2022.2) and it crashes with terminal output: ``` firmware> FileNotFoundError: [Errno 2] No such file or directory: '/home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json' firmware> make: *** [Makefile:21: ../build/pl.rs] Error 1 error: builder for '/nix/store/gcca7z0r35mlar5ck7pfiway7dbvw1cl-firmware.drv' failed with exit code 2 error: 1 dependencies of derivation '/nix/store/24lg5na5fcd1rqla3j4mvpjhz29ij1jw-kasli_soc-satellite-sd.drv' failed to build ``` (See further below for the full output.) The `FileNotFoundError` is complete bullshit because `cat [FILE_PATH_FROM_NIX_ERROR]` successfully prints out the contents of the system description file. (Again, see further below for the full output.) The relevant line from the old terminal output [2025_01_09_vivado_build.log](/attachments/7e57ea3c-3933-4904-8a59-0551eb502456) reads: ``` firmware> python gateware/kasli_soc.py -r ../build/pl.rs -c ../build/rustc-cfg -m ../build/mem.rs /nix/store/ladp6b9s4zh1c546qdpxd78h2k3qp27j-kasli_soc_artiq_master_20250109_drtio_master_wrpll_true_sed_lanes_32_peripherals_12_DIO_SMA.json ``` Clearly, `nix` used to copy the `.json`-file somewhere into `/nix/store/...` but now it doesn't anymore and instead complains that it cannot find the file. ## Which leads me to my question: Has the nix environment of [artiq-zynq commit a0281e498927d5c8467dd18f28aa497cb75150fd](https://git.m-labs.hk/M-Labs/artiq-zynq/commit/a0281e498927d5c8467dd18f28aa497cb75150fd) changed between 9 January 2025 and now (4 February 2025)? I ask because you use `--impure` in your nix build command, so there is no guarantee that the nix environment is exactly the same... Maybe your changes to `flake.nix` and to the packages on the M-Labs server for the upgrade to **Vivado 2024.2** caused unwanted changes to the nix environment of older commits, which require **Vivado 2022.2**? ## Full error log (today) ``` ~/workspace/sinara-firmware-compiler/examples   main !59 ?7 ❯ python run_compilation.py firmware> Running phase: unpackPhase firmware> unpacking source archive /nix/store/v37x6xfj6p9hwibcg35957s7bhasfn0j-src firmware> source root is src firmware> Executing cargoSetupPostUnpackHook firmware> Finished cargoSetupPostUnpackHook firmware> Running phase: patchPhase firmware> Executing cargoSetupPostPatchHook firmware> Validating consistency between /build/src/Cargo.lock and /build/cargo-vendor-dir/Cargo.lock firmware> Finished cargoSetupPostPatchHook firmware> Running phase: updateAutotoolsGnuConfigScriptsPhase firmware> Running phase: configurePhase firmware> Running phase: buildPhase firmware> mkdir -p ../build firmware> python gateware/kasli_soc.py -r ../build/pl.rs -c ../build/rustc-cfg -m ../build/mem.rs /home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json firmware> Traceback (most recent call last): firmware> File "/build/src/gateware/kasli_soc.py", line 672, in <module> firmware> main() firmware> File "/build/src/gateware/kasli_soc.py", line 644, in main firmware> description = jsondesc.load(args.description) firmware> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ firmware> File "/nix/store/010zdis9cc39rjjcvq7w5v2lrks6vkv6-python3-3.12.7-env/lib/python3.12/site-packages/artiq/coredevice/jsondesc.py", line 29, in load firmware> with open(description_path, "r") as f: firmware> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ firmware> FileNotFoundError: [Errno 2] No such file or directory: '/home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json' firmware> make: *** [Makefile:21: ../build/pl.rs] Error 1 error: builder for '/nix/store/gcca7z0r35mlar5ck7pfiway7dbvw1cl-firmware.drv' failed with exit code 2 error: 1 dependencies of derivation '/nix/store/24lg5na5fcd1rqla3j4mvpjhz29ij1jw-kasli_soc-satellite-sd.drv' failed to build Traceback (most recent call last): File "/home/m1/workspace/sinara-firmware-compiler/examples/run_compilation.py", line 22, in <module> sinara.run_firmware_compilation(artiq_zynq_path, json_file_path) File "/home/m1/workspace/sinara-firmware-compiler/sinara_firmware_compiler/compile_firmware_kasli_soc.py", line 77, in run_firmware_compilation shell_wrapper(f"nix develop --command nix build --print-build-logs {nix_build_expression}", File "/home/m1/workspace/sinara-firmware-compiler/sinara_firmware_compiler/shell_handling.py", line 31, in shell_wrapper raise Exception(message) Exception: Error when running the following shell command with sinara.shell_wrapper() -> subprocess.run(): cd "/home/m1/workspace/artiq-zynq" && nix develop --command nix build --print-build-logs --impure --expr ' let fl = builtins.getFlake "/home/m1/workspace/artiq-zynq"; in (fl.makeArtiqZynqPackage { target = "kasli_soc"; variant = "satellite"; json = "/home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json"; }).kasli_soc-satellite-sd ' returncode: 1 stdout: None stderr: None ``` The `FileNotFoundError` is complete bullshit because the file is obviously there: ``` ~/workspace/sinara-firmware-compiler/examples   main !59 ?7 ❯ cat /home/m1/workspace/sinara-firmware-compiler/examples/system_description_files/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50/crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50.json { "target": "kasli_soc", "hw_rev": "v1.1", "base": "use_drtio_role", "drtio_role": "satellite", "enable_wrpll": false, "sed_lanes": 32, "min_artiq_version": "8.0", "core_addr": "10.0.0.50", "variant": "crate_mqva_ao_kasli_soc_v1.1_artiq_zynq_master_a0281e498927d5c8467dd18f28aa497cb75150fd_drtio_satellite_wrpll_False_sed_32_periph_fastino_2_addr_10.0.0.50", "peripherals": [ { "type": "fastino", "hw_rev": "v1.3", "ports": [ 0 ] }, { "type": "fastino", "hw_rev": "v1.3", "ports": [ 2 ] } ] } ``` Small note: I also tried to compile artiq-zynq commit [a0281e498927d5c8467dd18f28aa497cb75150fd](https://git.m-labs.hk/M-Labs/artiq-zynq/commit/a0281e498927d5c8467dd18f28aa497cb75150fd) with Vivado 2024.2, but it crashed of course because it was looking for Vivado 2022.2's files.
Owner

Unless you modified/deleted flake.lock file from sources root, there shouldn't be any new changes affecting your setup.

Another (probably irrelevant) question, did you happen to commit anything via git? Specifically the json file. Also looking at the variant name I have a feeling it is pushing the naming constraints.

Unless you modified/deleted flake.lock file from sources root, there shouldn't be any new changes affecting your setup. Another (probably irrelevant) question, did you happen to commit anything via git? Specifically the json file. Also looking at the variant name I have a feeling it is pushing the naming constraints.
Owner

firmware> FileNotFoundError: [Errno 2] No such file or directory: '/home/m1

/home/m1 is clearly outside the Nix sandbox and this is why it doesn't find the file. Clearly user error.

> ``firmware> FileNotFoundError: [Errno 2] No such file or directory: '/home/m1`` ``/home/m1`` is clearly outside the Nix sandbox and this is why it doesn't find the file. Clearly user error.
sb10q closed this issue 2025-02-05 15:45:35 +08:00
Sign in to join this conversation.
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: M-Labs/artiq-zynq#356
No description provided.