Why is nixos-rebuild switch creating a store for something that is not used? - nixos

I did something to my system when switching channels from nixos-18.09 to nixos-unstable and back, and now run into an issue that prevents $ nixos-rebuild switch from running successfully.
When I try to do that, I get the following error:
writing manifest file 'singledispatch.egg-info/SOURCES.txt'
Copying singledispatch.egg-info to build/bdist.linux-x86_64/wheel/singledispatch-3.4.0.3-py3.6.egg-info
running install_scripts
Traceback (most recent call last):
File "nix_run_setup", line 8, in <module>
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
File "setup.py", line 20, in <module>
long_description = f.read()
File "/nix/store/qbyckcddc74s2fi060n8xqcn8gygrhjl-python3-3.6.8/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 898: ordinal not in range(128)
builder for '/nix/store/mcncvdwadrq1335bwy279dg7q0sxhvhp-python3.6-rsa-4.0.drv' failed with exit code 1
cannot build derivation '/nix/store/pifmbmqallj7jkl3ar1wv8nqyfzq08hr-python3.6-python-jose-3.0.1.drv': 1 dependencies couldn't be built
building '/nix/store/1qy7ka8c0s3mjv51pdiyyp103d11awkb-python3.6-termstyle-0.1.11.drv'...
building '/nix/store/8zvlx7367p21vj0iccsvhpz1jv3wx0b6-python3.6-websocket_client-0.54.0.drv'...
cannot build derivation '/nix/store/3w08jzilgvddzx728nnkpaadc7sd9p2v-python3.6-moto-1.3.7.drv': 1 dependencies couldn't be built
building '/nix/store/qfkfr913dx4ssp1qahfd9wcj6csf6yxm-python3.6-xlrd-1.1.0.drv'...
building '/nix/store/dvi6y2zlc4gwli0qqhxhr6cbvfs5qwhx-python3.6-xlwt-1.3.0.drv'...
building '/nix/store/p38p279r5y8bh7n9pvw8194k9zvnybic-reload-container.drv'...
cannot build derivation '/nix/store/sf4d3zrds99sq22s096f4pdwb2602mf2-python3.6-pandas-0.23.4.drv': 1 dependencies couldn't be built
building '/nix/store/hy1197qj5ivb54wicyn0ljdbv8qxp0zc-remove-references-to.drv'...
building '/nix/store/6cqp8vf151gvxbnz03qp4sj9awd8lnfc-smb-dummy.conf.drv'...
building '/nix/store/cb5r8y9llx4yw64kyg2hhwds4g123h29-stage-1-init.sh.drv'...
building '/nix/store/4ps1704mhdqj5bp1ck7sa2x67l7h08x4-su.pam.drv'...
cannot build derivation '/nix/store/hx05mqxryfl1aqvc5lqf0q05n230qnz3-system-path.drv': 1 dependencies couldn't be built
building '/nix/store/zrrbcfif92d7yz1d4vlcnva3gx8npc2k-systemd-boot-builder.py.drv'...
building '/nix/store/z8mld3scs2hzb6k3hffjqvfyrg9qnlg7-systemd-user.pam.drv'...
building '/nix/store/0gixkqfsr3plwcyf72izycpkr5rf1r6k-udev-rules.drv'...
cannot build derivation '/nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv': 1 dependencies couldn't be built
error: build of '/nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv' failed
I have tried removing the offending path by running
$ nix-store --delete /nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv
That path has no 'referrers' according to
$ nix-store -q --referrers /nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv`)
I also garbage-collected using $ nix-store --gc. However, running $ nixos-rebuild switch still re-creates this path and gives the same error again.
Why is $ nixos-rebuild switch creating this path, and how can I get that command running successfully again?
I am not sure why nixos-system-nixos-19.03 is present on my system at all; at this point I am only tracking the nixos-18.09 channel:
$ nixos-channel --list
nixos-18.09 https://nixos.org/channels/nixos-18.09

If you filter through the error message, it's pretty clear about the chain of events:
builder for '/nix/store/mcncvdwadrq1335bwy279dg7q0sxhvhp-python3.6-rsa-4.0.drv' failed with exit code 1
cannot build derivation '/nix/store/pifmbmqallj7jkl3ar1wv8nqyfzq08hr-python3.6-python-jose-3.0.1.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/3w08jzilgvddzx728nnkpaadc7sd9p2v-python3.6-moto-1.3.7.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/sf4d3zrds99sq22s096f4pdwb2602mf2-python3.6-pandas-0.23.4.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/hx05mqxryfl1aqvc5lqf0q05n230qnz3-system-path.drv': 1 dependencies couldn't be built
cannot build derivation '/nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv': 1 dependencies couldn't be built
error: build of '/nix/store/19sp5z5i8kg7x0inyrb1kzm1n6g6rzcc-nixos-system-nixos-19.03pre164715.201d739b0ff.drv' failed
So, the build of the Python rsa module failed because that package has a bug.
Why do we depend on rsa? Because...
Your system is configured to have a Python 3.6 install with pandas in its default PATH.
pandas depends on the package moto to run its tests (pkgs/development/python-modules/pandas/default.nix:38).
The moto package depends on python-jose (pkgs/development/python-modules/moto/default.nix:44).
The python-jose package depends on the rsa package (pkgs/development/python-modules/python-jose/default.nix:33).
BTW, while this is the case on nixpkgs-unstable, the 18.09 release (latest published as of this answer) doesn't have this dependency from python-jose on rsa, and so doesn't exhibit the issue at hand. Might I suggest using it instead?

Related

`Undefined symbol: ossl_sha3_512_functions` when trying to build the Kadena chainweb-node Haskell project

I've been trying to compile the Kadena chainweb-node project from source (via the docs found here) in a docker container running the arm64v8/ubuntu base image on an Apple M1 host machine and I keep getting errors. Thanks to the super helpful folks in the #haskell IRC channel, I've made it over a number of small hurdles, but the build still fails with:
Undefined symbol: ossl_sha3_512_functions
I can not find any resources on how to fix this but one of the #haskell community members informed me that these symbols are not provided by the openssl 3.0 API. That person created an issue here: https://github.com/larskuhtz/hs-hashes/issues/14
I've found that I can use the docker base image haskell:8 which comes preinstalled with ghc, cabal, and openssl 1.1.1 to cabal build chainweb-node successfully using a slightly different set of apt-get dependencies. However, when trying to cabal install the binaries so that I can run chainweb-node, I get:
Failed to build chainweb-2.14.1. The failure occurred during the configure
step.
Build log (
/root/.cabal/logs/ghc-8.10.7/chainweb-2.14.1-36aedf5adc1967eb17358e6434b6fd51bc7e64082f6c12e0df40ddafece6ff69.log
):
[1 of 1] Compiling Main ( /tmp/cabal-install.-838/dist-newstyle/tmp/src-838/chainweb-2.14.1/dist/setup/setup.hs, /tmp/cabal-install.-838/dist-newstyle/tmp/src-838/chainweb-2.14.1/dist/setup/Main.o )
Linking /tmp/cabal-install.-838/dist-newstyle/tmp/src-838/chainweb-2.14.1/dist/setup/setup ...
Configuring chainweb-2.14.1...
setup: Encountered missing or private dependencies:
criterion -any,
data-ordlist >=0.4.7,
resource-pool >=0.2,
retry >=0.7,
statistics >=0.15,
tasty-json >=0.1
cabal: Failed to build chainweb-2.14.1. See the build log above for details.
I've tried cabal install criterion and the other missing deps, one by one, but the cabal install gives me the same errors.
Can someone tell me what I'm doing wrong and help me get a working chainweb-node binary built from source and installed using docker?

Yocto bitbake build error when adding fftw package

I am using Yocto Warrior release to build linux for Dart-imx8m SOM. Documentation can be found here : https://variwiki.com/index.php?title=DART-MX8M_Yocto&release=RELEASE_WARRIOR_V1.1_DART-MX8M.
I want to add fftw package whose recipe is in meta-oe layer. Whenever I add this package in my local.conf file, I get an error with bitbake regarding a dnf related task.
I add the package like this in my local.conf file : IMAGE_INSTALL_append = " fftw"
I get the following error when building image with bitbake fsl-image-gui :
ERROR: fsl-image-gui-1.0-r0 do_rootfs: Could not invoke dnf. Command '/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/recipe-sysroot-native/usr/bin/dnf -v --rpmverbosity=info -y -c /home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/rootfs/etc/dnf/dnf.conf --setopt=reposdir=/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/rootfs/etc/yum.repos.d --installroot=/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/rootfs --setopt=logdir=/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/temp --repofrompath=oe-repo,/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/oe-rootfs-repo --nogpgcheck install packagegroup-core-tools-profile packagegroup-fsl-tools-audio packagegroup-core-ssh-dropbear tree rpm packagegroup-fsl-tools-benchmark boost gstreamer1.0 packagegroup-fsl-tools-gpu packagegroup-fsl-gstreamer1.0 psplash gpsd packagegroup-base-extended collectd kernel-image-4.19.35-imx8mq+gdc7a2fd packagegroup-core-tools-testapps packagegroup-core-boot tcf-agent packagegroup-fsl-tools-gpu-external packagegroup-core-full-cmdline packagegroup-tools-bluetooth packagegroup-fsl-tools-testapps opencv fftw libsdl-1.2-0 packagegroup-fsl-gstreamer1.0-full lftp packagegroup-core-tools-debug libgpiod2 dnf weston-init run-postinsts mosquitto packagegroup-core-nfs-server sshfs-fuse spitools kernel-devicetree android-tools htop poco tmux openssh-sftp-server weston-xwayland xterm locale-base-en-us locale-base-en-gb' returned 1:
DNF version: 4.1.0
cachedir: /home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/rootfs/var/cache/dnf
Added oe-repo repo from /home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/oe-rootfs-repo
repo: using cache for: oe-repo
not found other for:
not found modules for:
not found deltainfo for:
not found updateinfo for:
oe-repo: using metadata from Wed 28 Oct 2020 09:16:57 AM UTC.
Last metadata expiration check: 0:00:01 ago on Wed 28 Oct 2020 09:16:57 AM UTC.
No module defaults found
No match for argument: fftw
Error: Unable to find a match
ERROR: fsl-image-gui-1.0-r0 do_rootfs:
ERROR: fsl-image-gui-1.0-r0 do_rootfs: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/build_xwayland/tmp/work/imx8mq_var_dart-poky-linux/fsl-image-gui/1.0-r0/temp/log.do_rootfs.2614
ERROR: Task (/home/safetyn/safetynYoctoGenerator/warrior/var-fsl-yocto/sources/meta-fsl-bsp-release/imx/meta-sdk/recipes-fsl/images/fsl-image-gui.bb:do_rootfs) failed with exit code '1'
Woud you have any clue where this error come from ?
Thanks,
Paul
Edit :
Found a way to make it compile for those who are intereseted. (inspired by Yocto build for a static library fails with error "No Match Found")
I edited my *.bb file and added ALLOW_EMPTY_${PN} = "1"
I am not sure I got it completely but it looks like dnf package manager needs folders created for all added packages even if empty.
https://www.yoctoproject.org/docs/latest/ref-manual/ref-manual.html#var-ALLOW_EMPTY
The fftw recipe is set up to create a few different packages (RPM) like libfftw, libfftwl, libfftwf, fftw-wisdom, fftwl-wisdom, fftwf-wisdom, and fftw-wisdom-to-conf.
You probably want to add one or more of those. It seems there is no actual fftw package.
It is important to remember that IMAGE_INSTALL and RDEPEND lists items from the package namespace, while DEPENDS lists items from the recipe namespace.
If you are unsure about which package you want to install you can inspect the packages-split folder for fftw in tmp/work to see which files are included in which package.

Haskell on Travis CI fails, passes locally

https://travis-ci.org/Fresheyeball/fbatch
Preprocessing library monad-parallel-0.5...
Control/Monad/Parallel.hs:67:8:
Could not find module `Control.Monad.Identity'
It is a member of the hidden package `mtl-2.2.1'.
Perhaps you need to add `mtl' to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
cabal: Error: some packages failed to install:
monad-parallel-0.5 failed during the building phase. The exception was:
ExitFailure 1
I am new to haskell, and just can't seem to get past this. I've tinkered with my .cabal file all I can, and the sub dependency fails on Travis every time.
Please help.
If a build fails while resolving a dependency, it's worth having a look a what version of that package gets installed. Normally, cabal should default to the most recent possible, which if well-maintained should install fine. Older versions do of course often mean trouble, if some dependency of theirs has now a newer, incompatible version installed.
In your case, cabal tried to install the somewhat ancient monad-parallel-0.5, which imports a module that doesn't exist in transformers (namely Control.Monad.Identity). The more recent version 0.7.1.2 does not try this and thus builds successfully. You can force such a recent install by giving a lower bound to the dependency in your .cabal file, in this case monad-parallel >= 0.7.

Cannot install accelerate-cuda in Haskell

I am on a linux box and trying to experiment with Haskell's Accelerate library but having problems installing it. I have successfully installed the accelerate package but there seems to be a dependency problem, which I have detailed below.
cabal: Error: some packages failed to install:
accelerate-cuda-0.14.0.0 depends on haskell-src-exts-1.14.0.1 which failed to
install.
cuda-0.5.1.1 failed during the configure step. The exception was:
ExitFailure 1
haskell-src-exts-1.14.0.1 failed during the configure step. The exception was:
ExitFailure 1
haskell-src-meta-0.6.0.5 depends on haskell-src-exts-1.14.0.1 which failed to
install.
language-c-quote-0.7.6 depends on haskell-src-exts-1.14.0.1 which failed to
install.
I searched SO and noticed someone else had a similiar issue installed the cuda package, and was resolved by adding the cabal bin path to the PATH; I tried this but it didn't solve this problem.
Please could someone help as I really keen to play with this fantastic library.
I wanted to check accelerate-examples and play with them and I also didn't have CUDA GPU (AMD only) and that's how I eventually installed accelerate-examples with stack:
git clone https://github.com/AccelerateHS/accelerate-examples
cd accelerate-examples
#choose version:
ln stack-8.6.yaml stack.yaml
#build without CUDA targeting:
stack build --flag accelerate-examples:-llvm-ptx --flag accelerate-fft:-llvm-ptx
Installation will build all the examples and print the info regarding where they was put.
Might also need to specify GHC libs path with something like: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5/rts/
Also checked that accelerate installs as well the same way but even without specifying any flags (I guess because it doesn't build any programs yet?), but examples are what's fun :)
P.S. You can move llvm-ptx flags to stack.yaml config: change # flags: {} line to:
flags:
accelerate-fft:
llvm-ptx: false
accelerate-examples:
llvm-ptx: false

installation of ridgerun sdk - Leopard board DM

I want to install ridgerun sdk to build and run applications on Leopardboard DM365. I am new to this and I have followed steps as per ridgerun sdk getting started guide - https://www.ridgerun.com/developer/wiki/index.php/DM365_Leopard_SDK_2011Q2_Getting_Started_Guide
I have installed the sdk as per the guide. Then as per the guide I configure the sdk to build it - "make configure". In the configuration I selected support for opencv-2.1.0. Then when I "make" the sdk, I get the following error:
Checking dependencies for OpenCV-2.1.0
Compiling and installing OpenCV-2.1.0...
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named numpy.distutils
CMake Warning: The variable, 'BUILD_DOXYGEN_DOCS', specified manually, was not used during the generation.
CMake Warning: The variable, 'BUILD_PYTHON_SUPPORT', specified manually, was not used during the generation.
CMake Warning: The variable, 'CMAKE_TOOLCHAIN_FILE', specified manually, was not used during the generation.
make[3]: *** [cmake_built] Error 2
Error building OpenCV-2.1.0
make[2]: *** [dependency_build] Error 1
make[1]: *** [apps_build] Error 1
make: *** [fs_build] Error 2
I am stuck up at this point. I searched a lot but cannot find anything. Please guide me as to what has to be done.
Thanks,
Maz
You must disable OpenCV and compile again.
Goto the root directory of your RRSDK and run:
make config
goto "File System Configuration --->Select target's file system software"
Deselect "OpenCV".
Exit and run:
make
make install
OpenCV is known to have a bug in configuration in this version of RRSDK.

Resources