Stack shadowed dependencies - haskell-stack

I converted a project from cabal new-build to stack. While it works on most machines, on one machine I get the shadowed dependencies problem:
Building library for PSS-0.2.0.0..
<command line>: cannot satisfy -package-id conduit-extra-1.3.0-
IqE5lCHhGFAGyZP27mhAWv:
conduit-extra-1.3.0-IqE5lCHhGFAGyZP27mhAWv is unusable due to
shadowed dependencies:
streaming-commons-0.1.19-2BxOAPRD0RODtVLE2OYQW2
(use -v for more information)
From what I know, this problem should have been fixed in stack already, but on this one installation it still happens.
Stack version:
Version 1.6.5, Git revision 24ab0d6ff07f28276e082c3ce74dfdeb1a2ca9e9
(5514 commits) x86_64 hpack-0.20.0
Cabal was installed with stack itself, version:
> which cabal
/home/oswald/.local/bin/cabal
> cabal --version
cabal-install version 2.0.0.1
compiled using version 2.0.1.1 of the Cabal library
It uses the system-installed ghc (ghc 8.2.2) and lts-11.4. It works on openSuSE LEAP 42.3 and interestingly it works best on SLES 11 (which is very old, but there I had the least problems. GHC had to be compiled manually there). The system where this happens is an Ubuntu Studio 14.04. The other systems use the same stack and cabal versions and have no problems.
Does anybody have an idea, of what happens here?

I think this is a ghc 8.2+ issue, so you may prefer to stay on 8.0.2 for the time being to avoid it.
(I think Fedora 28 and NixOS have patches for it.)
See https://github.com/haskell/cabal/issues/4728 for more details.

Related

Install older version of gcc cross compiler for arm on Ubuntu

I need to use gcc-arm-linux-gnueabi version 6.5, along with a version of libc that came out around the same period (I believe is libc-2.26). My host system is Ubuntu 18.04.
If I go with just a simple
sudo apt-get install gcc-arm-linux-gnueabi g++-arm-linux-gnueabi binutils-arm-linux-gnueabi
I'll get v7 for the gcc cross compiler and v2.30 for binutills, which does not work for me, since I'll end up with errors similar to the one described here.
If I try to download the deb packages, I get unmet dependencies.
I have also tried to force apt-get to install specific versions, using something like described here but I get error messages that the version I'm looking for cannot be found.
Is there a way to force ubuntu to install specific (older) version of gcc, libc, etc.?
I know that gcc v 6 is obsolete, but I cannot do otherwise.
You could give a try to the Linaro release of gcc 6.5, available here, which comes with glibc version 2.23.

Replacing old Xcode command line tool with newer Brew version

I'm trying to build a binary from source code which has a dependency on the package" NASM 2.12.02 or later. However, I have an earlier version already installed on my Mac via Xcode:
/usr/local/bin/nasm -v
NASM version 0.98.40 (Apple Computer, Inc. build 11) compiled on May 1 2018
So to (attempt to) rectify this, I used Homebrew to install a much newer version of the package
brew info nasm
nasm: stable 2.13.03 (bottled), HEAD
However, now my PATH is only pointed to the old NASM executable, while the new tool seems to be sitting in Homebrew's Cellar (ie. /usr/local/Cellar/nasm/2.13.03).
Is there a nice way of "switching" between these versions so that the system PATH views only the newer version and disregards the older one? So far I've thought of rm -rf-ing the old version and exporting the new version to my PATH, but that seems very destructive.
Also, I have run the command: brew doctor and have resolved all linker errors, but that has not seemed to help.
Any help would be greatly appreciated!
To fix this, I used the following command:
export PATH=/usr/local/Cellar/nasm/2.13.03/bin:$PATH
This modifies the PATH variable to point to the /usr/local/Cellar/nasm/2.13.03/bin directory and find the nasm executable there before looking in /usr/local/bin.

Installing gcc 4.8 on Debian

I want to start playing around with some of the newer C++11 features and it appears that the best support for this is with gcc 4.8, and Squeeze ships with 4.4.5.
However, I don't want to cause any "damage" to my current setup. What's the best way to get both versions of gcc running side-by-side? I'm concerned mostly at the large number of dependencies and that taking them all in to my current system may render it unstable.
Has anyone managed to do this, and what are the steps involved?
Failing that, I'll probably just create a VM and run an "unstable" Debian under that but it's a less-than-ideal solution.
If you install GCC from source just make sure you don't install it to /usr and it won't mess anything up. If you install it as your own user, not root, then there is zero chance of messing up the system.
See http://gcc.gnu.org/wiki/InstallingGCC for the almost-idiot-proof minimal configuration.
I have various versions built as my user and installed in ~/gcc/4.X for various X.
The only thing to be aware of using that set up is that the shared libraries for the new version aren't in the dynamic linker's default search path, so you need to use LD_LIBRARY_PATH or some other solution to ensure executables find the libs from 4.8, see the libstdc++ FAQ and the page it links to in the manual
I use a wrapper script call g++11 which simply calls the new version of GCC with -std=gnu++11 and passes a flag to the linker telling it to set the path to the 4.8 libs in the executable:
$HOME/gcc/4.8/bin/g++ -Wl,-rpath,$HOME/gcc/4.8/lib64 -std=gnu++11 -Wall -Wextra -g "$#"
I had the same problem, and didn't want to fully upgrade to testing.
Jessie (testing) now contains g++-4.8 which is compliant with C++11.
I used apt-pinning in the following way:
A source to jessie was added to /etc/apt/sources.list:
deb http://ftp.uk.debian.org/debian/ jessie main non-free contrib
/etc/apt/preferences was edited as such:
Package: *
Pin: release n=wheezy
Pin-Priority: 900
Package: gcc*
Pin: release n=jessie
Pin-Priority: 910
Then,
$ sudo aptitude update
$ sudo aptitude install gcc/jessie
At which point I selected the second presented option to resolve dependencies fully.
Debian has the package under the name gcc-4.8 (or for the c++ compiler, g++-4.8). Installing those packages will not mess up your OS, as long as you do not rename it to g++. The package is listed as experimental though.
Information on the package is here.
Update: g++-4.8 is now in testing, but an updated package is in unstable
Quick ones:
Just upgrade to testing, it is rock-solid and offers you several concurrent gcc versions. Similar for Ubuntu, on 12.10 I have gcc/g++ 4.4, 4.5, 4.6 and 4.7 in parallel.
Try the Debian backports archive, it may have a port of gcc 4.8.
Use virtualization: I prefer libvirt / kvm which is incredibly lightweight on Linux as it is kernel based. My amd64 server has two other 32 bit installations for that very reason.
Not really a SO question...
Have you tried chroot to install a newer Debian flavor?
you can play around without fear to break you working system.
install a Debian flavor that support you gcc version desired.
install a gcc version manually without affecting you working system.
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender/Linux/Chroot

Installing dph-examples in Mac OS X 10.7.2

I am trying to install dph-examples in mac os x version 10.7.2 and I got this error. How ever on ghci , I can see
ghci>import Data.Array.Parallel.
Data.Array.Parallel.Base Data.Array.Parallel.Base.DTrace Data.Array.Parallel.Base.TracePrim Data.Array.Parallel.Stream
but not Data.Array.Parallel , Data.Array.Parallel.Prelude and Data.Array.Parallel.Prelude.Double. I copied the example ( it uses these libraries ) given on Data-Parallel-Haskell and its working fine. My program is compiling and running so my question is, why i am not able to see these library at ghci prompt. Also i am not able to find the reference for sumP function at the Data-Array-Parallel. I am using ghc-7.2.1.
GHC depends on Xcode 3.2:
The package requires Xcode 3.2 (in particular, the "Unix Development Support") to be already installed.
— GHC 7.2.1 download page
Xcode 3.2 should already come with LLVM, so if it's not already installed, installing it should fix things. If you already have it installed, then your installation might be broken somehow; you could try reinstalling it to make sure. I think Xcode 4 isn't fully supported by GHC yet, so if you have it installed, that might be the problem; you could try uninstalling it and installing 3.2 instead.
Warning: Couldn't figure out LLVM version!
Make sure you have installed LLVM
Perhaps you didn't install LLVM? Go install LLVM.

How do you install the Haskell Platform over a previous install?

I've been working with Haskell lately, and installed gtk2hs (a gtk library for Haskell) a few days ago using MacPorts. For some reason, MacPorts saw fit to install GHC 6.10 over my previous GHC 6.12 install, but I didn't really care.
Now I find myself desiring the improved parallelism support of the latest Haskell Platform, so I installed it today, and it installed successfully - except that when I type in "ghc -v" in Terminal, I am informed that I have GHC 6.10 still.
I have tried using uninstall-hs, and it informs me that I have three Haskells on my system: versions 6.12, 6.12.3, and 7.04. I'm not sure how that 6.12.3 showed up, and what happened to the 6.10? Most importantly, how can I start running version 7.04? Thanks in advance for your help!
You should completely purge your MacPorts install of GHC and your current Platform installation and install the Haskell Platform directly with the OS X installer. After that, future versions of the Haskell Platform can be upgraded to cleanly simply by installing them.
The following command should remove your MacPorts GHC:
$ sudo port uninstall --follow-dependents ghc
You might want to execute something like find /usr /opt/local -name '*ghc*' after uninstalling everything to check that there's no remaining traces.
To really clear out the old install, you've got to go in and delete things by hand.
This will be very useful: Everywhere that GHC/Haskell Platform installs
Might want to look here also: http://www.vex.net/~trebla/haskell/sicp.xhtml

Resources