GregorySchwartz / too-many-cells

Cluster single cells and analyze cell clade relationships with colorful visualizations.
https://gregoryschwartz.github.io/too-many-cells/
GNU General Public License v3.0
104 stars 19 forks source link

Error when installing with nix on CentOS 7 #40

Closed YiweiNiu closed 3 years ago

YiweiNiu commented 3 years ago

Hi,

I was trying to install too-many-cells with nix-env, but I encountered the following error.

...
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
** checking absolute paths in shared objects and dynamic libraries
** testing if installed package can be loaded from final location
** testing if installed package keeps a record of temporary installation path
* DONE (gert)
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/h9as7005w58sizn57y1ps5hym37dr940-r-gert-1.0.2
shrinking /nix/store/h9as7005w58sizn57y1ps5hym37dr940-r-gert-1.0.2/library/gert/libs/gert.so
strip is /nix/store/8xiqj7nkx1z0mxhda9pcl8fa51zmxqd1-binutils-2.35.1/bin/strip
patching script interpreter paths in /nix/store/h9as7005w58sizn57y1ps5hym37dr940-r-gert-1.0.2
checking for references to /tmp/nix-build-r-gert-1.0.2.drv-0/ in /nix/store/h9as7005w58sizn57y1ps5hym37dr940-r-gert-1.0.2...
building '/nix/store/3n793cglv7dbwzpvw1rhnj4j1rry43si-diagrams-cairo-1.4.1.1.drv'...
setupCompilerEnvironmentPhase
Build with /nix/store/2ip3lwzqswai3zz33407h4b2q3har28p-ghc-8.10.4.
ghc-pkg: Couldn't open database /tmp/nix-build-diagrams-cairo-1.4.1.1.drv-0/setup-package.conf.d for modification: {handle: /tmp/nix-build-diagrams-cairo-1.4.1.1.drv-0/setup-package.conf.d/package.cache.lock}: hLock: invalid argument (Invalid argument)
error: builder for '/nix/store/3n793cglv7dbwzpvw1rhnj4j1rry43si-diagrams-cairo-1.4.1.1.drv' failed with exit code 1
error: 1 dependencies of derivation '/nix/store/9m6m0in321whhiijcj55lvfq97978lq0-too-many-cells-2.2.0.0.drv' failed to build

The nix version

nix-env (Nix) 2.4pre20210503_6d2553a

I am not familiar with nix, and could not find anything related though Google.

Could you please help me with this?

Best wishes, Yiwei

GregorySchwartz commented 3 years ago

That is indeed a weird one. I wonder if it has to do with the age of CentOS 7 vs. 8. Can you try to edit the GHC version in the default.nix file? Instead of ghc8104, can you change it to ghc881 and rerun it (there may be some dependencies that change though which you might need to jailbreak). If that doesn't work for the same reason (ghc-pkg) try another older version of GHC: https://www.haskell.org/ghc/download.html (removing the periods for the version to put in the default.nix file).

YiweiNiu commented 3 years ago

Thank you for your quick reply!

Instead of ghc8104, can you change it to ghc881 and rerun it

Then I got the following error.

$ nix-env -f default.nix -i too-many-cells
error: attribute 'ghc881' missing

       at /T02Data/niuyw/software/too-many-cells/default.nix:31:14:

           30|   # Haskell compiler
           31|   compiler = pkgs.haskell.packages."${compilerVersion}";
             |              ^
           32|
(use '--show-trace' to show detailed location information)

When I changed it to ghc801, the error was the same.

GregorySchwartz commented 3 years ago

That means that the particular GHC version is too old for that snapshot. I recently updated the nixpkgs snapshot, so try commit de5aeaf1d71c0d00d3c593c7b73ae737c2372dbf and see if that works.

YiweiNiu commented 3 years ago

After switching to commit de5aeaf, the too-many-cells could be successfully installed through nix-env.

Thank you so much.