- nix build github:c2vi/nixos/f1bfb14668ffd601940459805be734df1aa3645c#qemu-espressif
err
../ui/meson.build:173:22: ERROR: Git program not found, cannot download keycodemapdb.wrap via git.
- this works though:
- nix build github:c2vi/nixos/f1bfb14668ffd601940459805be734df1aa3645c#inputs.nixpkgs-unstable.legacyPackages.x86_64-linux.qemu
solution
- nixpkgs downloads the tarball, which includes the subprojects…
- DON’T FORGET SUBPROJECT’S PATCHES
- as those patches from $qemu/subprojects/packagefiles/ are not applied
- rel: https://discourse.nixos.org/t/best-practices-for-meson-wrapped-subprojects-with-patches/26845
- also check my answers on this forum thread
another error
qemu> [803/9555] Generating target/hexagon/idef_parser_input.preprocessed.h.inc with a custom command
qemu> FAILED: target/hexagon/idef_parser_input.preprocessed.h.inc
qemu> /build/qemu-esp_develop_8.2.0_20240122-src/target/hexagon/idef-parser/prepare target/hexagon/idef_parser_input.h.inc -I/build/qemu-esp_develop_8.2.0_20240122-src/target/hexagon/idef-parser -o target/hexagon/idef_parser_input.preprocessed.h.inc
qemu> /bin/sh: /build/qemu-esp_develop_8.2.0_20240122-src/target/hexagon/idef-parser/prepare: not found
- a very well explained error: “not found” thank you whoever made it like that
- this error works outside the build sandbox, so whatever isn’t found in the sandbox is found on my system
trying to reproduce with nix develop in sandbox env
- chroot into a dir with only /nix
- and tell chroot the full /nix path to the shell to run
mkdir empty-system
mkdir empty-system/nix
mkdir empty-system/config
sudo mount -o bind /nix empty-system/nix
sudo mount -o bind ~/work/config empty-system/config
chroot system /nix/store/iyr9pki5x5snpqdwa2gmcnbfv3z9i28w-bash-interactive-5.2-p15/bin/bash
where ~/work/config is github:c2vi/nixos/cdf4a5f369c6303eb0a49249305293fc046d94a2
things that don’t work in there
- the nix command needs /proc/stat → so mount /proc into the chroot system
$ /nix/store/b9iwk28nd0h9z8gpyr3fcr1xjlwnavmc-nix-2.18.1/bin/nix
GC Warning: pthread_getattr_np or pthread_attr_getstack failed for main thread
GC Warning: Could not open /proc/stat
GC_push_all_stacks: pthread_getattr_np failed!
Aborted (core dumped)
- some other command needed /dev/null → mkdir empty-system/dev; sudo mount -o bind /dev empty-system/dev
- ssl just does not work, because not list of trusted CAs is found
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 329 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 573 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 1029 ms
warning: error: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35); retrying in 2388 ms
warning: unable to download 'https://cache.nixos.org/nix-cache-info': SSL connect error (35)
- nix also needed /dev/pts → sudo mount -o bind /dev/pts empty-sytem/dev/pts
error: opening pseudoterminal master: No such device
-
nix develop needs a “git” in the path
- so mkdir empty-system/bin and add that to the $PATH in the chroot env
cp $(which git) empty-system/bin
… works great for all programs you need in the chroot env
-
you need to pass —extra-experimental-features to the nix command, as nix would read that from /etc/nix/nix.conf
-
the
genericBuild
afternix develop /config#qemu-espressif
fails with:
../docs/meson.build:13:19: ERROR: Command `/nix/store/asqa3kfq3maclk7cqqhrjvp7vriw6ahy-coreutils-9.5/bin/env CONFDIR=/etc/qemu /build/qemu-esp_develop_8.2.0_20240122-src/build/pyvenv/bin/sphinx-build -q --version` failed with status 1.
in the /build/qemu-esp_develop_8.2.0_20240122-src/build/meson-logs/meson-log.txt we see:
Traceback (most recent call last):
File "/build/qemu-esp_develop_8.2.0_20240122-src/build/pyvenv/bin/sphinx-build", line 8, in <module>
sys.exit(main())
^^^^^^
File "/nix/store/p96aqbvlhrzc56zd0z5xqh38jwlyah4d-python3.11-sphinx-7.2.6/lib/python3.11/site-packages/sphinx/cmd/build.py", line 326, in main
locale.setlocale(locale.LC_ALL, '')
File "/nix/store/glfr70gi7hfaj50mwj2431p8bg60fhqw-python3-3.11.9/lib/python3.11/locale.py", line 627, in setlocale
return _setlocale(category, locale)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
locale.Error: unsupported locale setting
../docs/meson.build:13:19: ERROR: Command `/nix/store/asqa3kfq3maclk7cqqhrjvp7vriw6ahy-coreutils-9.5/bin/env CONFDIR=/etc/qemu /build/qemu-esp_develop_8.2.0_20240122-src/build/pyvenv/bin/sphinx-build -q --version` failed with status 1.
-
so the $LANG is set to: en_US.UTF-8 … but there is something in /etc, that is needed by the “lang-system”
- NOPE!!! mounting my outside /etc does not make this work
- ref: https://stackoverflow.com/a/37112094
- doing: export LC_ALL=C makes that work…
-
then:
ninja: fatal: posix_spawn: No such file or directory
- https://github.com/alwsl/alwsl/issues/33
- which aparently is related to glibc … but it works with the same glibc outside of the sandbox