cabal install scion-browser fails on ubuntu 14.04 due to incompatible dependencies (in context of installing EclipseFP) - cabal

yesterday I tried to install the EclipseFP plugin with a fresh version of Eclipse 3.8 (the default that ships with Ubuntu repositories) and a clean cabal installition, meaning that the only other package installed is cabal-install. The plugin needs two cabal packages to work properly, named buildwrapper and scion-browser. The first installed completely fine, but the latter fails:
$ cabal install scion-browser
Resolving dependencies...
In order, the following would be installed:
auto-update-0.1.1.1 (new package)
base64-bytestring-1.0.0.1 (new package)
blaze-builder-0.3.3.2 (new package)
blaze-markup-0.6.1.0 (new package)
blaze-html-0.7.0.2 (new package)
exceptions-0.6.1 (new package)
fast-logger-2.2.0 (new package)
mmorph-1.0.3 (new package)
monad-loops-0.4.2.1 (new package)
nats-0.2 (reinstall) changes: hashable-1.2.2.0 -> 1.2.1.0
parallel-io-0.3.3 (new package)
path-pieces-0.1.4 (new package)
polyparse-1.9 (reinstall) changes: text-1.1.1.3 -> 0.11.3.1
cpphs-1.18.5 (reinstall)
haskell-src-exts-1.14.0.1 (new version)
scientific-0.3.3.0 (reinstall) changes: hashable-1.2.2.0 -> 1.2.1.0,
text-1.1.1.3 -> 0.11.3.1
attoparsec-0.11.3.4 (new version)
aeson-0.7.0.6 (reinstall) changes: attoparsec-0.12.1.1 -> 0.11.3.4,
hashable-1.2.2.0 -> 1.2.1.0, text-1.1.1.3 -> 0.11.3.1,
unordered-containers-0.2.5.0 -> 0.2.3.0
semigroups-0.15.2 (reinstall) changes: hashable-1.2.2.0 -> 1.2.1.0,
text-1.1.1.3 -> 0.11.3.1, unordered-containers-0.2.5.0 -> 0.2.3.0
silently-1.2.4.1 (new package)
stm-chans-3.0.0.2 (new package)
streaming-commons-0.1.4.2 (new package)
tar-0.4.0.1 (new package)
terminfo-0.4.0.0 (new package)
haskeline-0.7.1.3 (new package)
transformers-base-0.4.3 (new package)
monad-control-0.3.3.0 (new package)
lifted-base-0.2.3.0 (new package)
resource-pool-0.2.3.0 (new package)
resourcet-1.1.2.3 (new package)
uniplate-1.6.12 (new package)
derive-2.5.16 (new package)
void-0.6.1 (reinstall) changes: hashable-1.2.2.0 -> 1.2.1.0
conduit-1.1.7 (new package)
conduit-extra-1.1.3.1 (new package)
monad-logger-0.3.7.1 (new package)
persistent-1.3.3 (new package)
persistent-sqlite-1.3.0.5 (new package)
persistent-template-1.3.2.2 (new package)
scion-browser-0.3.1 (new package)
cabal: The following packages are likely to be broken by the reinstalls:
dynamic-cabal-0.3.2
buildwrapper-0.8.7
haskell-src-exts-1.15.0.1
haskell-generate-0.2
attoparsec-0.12.1.1
Use --force-reinstalls if you want to install anyway.
Of course, forcing it to install did not work and made everything worse.
My next idea was using cabal's sandboxes. So I made an isolated sandbox just for scion-browser (in version 0.3.1) with the plan to make a link in ~/.cabal/bin to ~/scion-browser-0.3.1/dist/dist-sandbox-4ccbe261/build/scion-browser/scion-browser (the sandboxed binary of scion-browser). Unfortunately this step failed too, because the package terminfo-0.4.0.0 caused an error while compiling scion-browser.
The question is now: How must I proceed to successfully install (a sandboxed version of) scion-browser?
Note that I already found a solution, shown below in my own answer – however I think that my Solution should be made public.

The solution is to install an older version of terminfo, in my case terminfo-0.3.2.6 by typing:
$ cabal install terminfo-0.3.2.6
However, this leads eventually to a new error, which might be fixed by following this post. After doing so, running cabal install scion-browser in the sandbox should be fine.

The eclipsefp author's recommendation is to use cabal sandboxes to correct.
https://github.com/JPMoresmau/eclipsefp/issues/236
http://coldwa.st/e/blog/2013-08-20-Cabal-sandbox.html
The default cabal is 1.16, so it needs to be updated than correctly invoked as per
Upgrade Cabal on Ubuntu 14.04

Related

Centos 7 how to instal old epel repository to get php5 mssql_* functions

I need to install web server for older intranet app - it requires mssql library (I know its old, but nobody will redevelop the app).
In Centos 7 I was installing it like this (along with vesta - also old)
yum install epel-release
yum install php-mssql
And that is it - it worked great, but now while I try to install it it says mssql was removed and replaced with pdo.
I tried to install the mssql library directly:
sudo yum install wget https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/p/php-mssql-5.4.16-9.el7.x86_64.rpm
But there was a problem with dependencies I could not solve (It requires X and X require Y and then Z.... and so on).
My idea is not to install newest epel release but to download older one install it. Is it possible? I have found old repository but how to install it? (its list of modules, how do I install them all to get dependencies)
https://dl.fedoraproject.org/pub/archive/epel/
Or maybe there is other idea to install mssql functions?

Install Racket package only if not installed

I can install a Racket package with:
raco pkg install <pkg-name>
If the package is not installed, it installs it. If the package is already installed however, it will complain that the package is already installed. While this is fine, is there a better way to check if a package is installed, and only try to install it if its not already installed?
For context, I want this because I have a (non-package) Racket project that relies on certain packages being installed. I could put them in an info.rkt file, but as far as I can tell, these won't get installed unless I try to install the project as a package, which doesn't make sense for this domain.
So, is there anyway to determine if a Racket package is installed? Additionally, can I use this information to only install a package if its not already installed?
Yes, in fact you can. If you are using a shell program or makefile (basically, using the raco pkg tool from the command line), you can pass it the --skip-installed parameter. This will only try to install the package if its not already installed. So you could do something like this in a mace file:
all: # Replace spaces here with tabs, because make...
raco pkg install --skip-installed <important-pkg>
<rest-of-makefile>
Alternatively, if you are looking for an 'in Racket' solution, you can use the installed-pkg-table function to get a hash table containing all of the installed packages. From there, its easy enough to do a hash-has-key? to see if the package is in the table. From there, you can use pkg-install-command to install the package. Your total code will look something like this:
(unless (hash-has-key? (installed-pkg-table) "<important-pkg>")
(pkg-install-command #:deps 'search-auto i))
I should note that there is a slight chance that the package database will change between searching for the key and installing the package. If that is important to you, check out with-pkg-lock

Cabal cannot resolve dependencies - chooses wrong version of `containers`?

% cabal sandbox init
Writing a default package environment file to
/Users/pmw/yesod-website/cabal.sandbox.config
Creating a new sandbox at /Users/pmw/yesod-website/.cabal-sandbox
0c4de9cd2926% cabal install --upgrade-dependencies --constraint="template-haskell installed" --dependencies-only --enable-tests
Resolving dependencies...
cabal: Could not resolve dependencies:
trying: yesod-website-0.1.0.0 (user goal)
trying: text-1.2.1.1 (dependency of yesod-website-0.1.0.0)
trying: binary-0.7.5.0 (dependency of text-1.2.1.1)
trying: containers-0.5.6.3 (dependency of binary-0.7.5.0)
trying: yesod-form-1.4.4.1 (dependency of yesod-website-0.1.0.0)
next goal: template-haskell (dependency of yesod-form-1.4.4.1)
rejecting: template-haskell-2.10.0.0 (global constraint requires installed
instance)
rejecting: template-haskell-2.9.0.0/installed-c0b... (conflict:
containers==0.5.6.3, template-haskell => containers==0.5.5.1/installed-d4b...)
rejecting: template-haskell-2.9.0.0, 2.8.0.0, 2.7.0.0, 2.6.0.0, 2.5.0.0,
2.4.0.1, 2.4.0.0, 2.3.0.1, 2.3.0.0, 2.2.0.0 (global constraint requires
installed instance)
Backjump limit reached (change with --max-backjumps).
Note: when using a sandbox, all packages are required to have consistent
dependencies. Try reinstalling/unregistering the offending packages or
recreating the sandbox.
My cabal file:
build-type: Simple
cabal-version: >=1.10
executable yesod-website
main-is: helloworld.hs
build-depends: yesod
, yesod-form
, text
default-language: Haskell2010
When I run a plain cabal install instead, it succeeds. But that's not an option for me: I am running this particular invocation of cabal install because I am trying to integrate with CircleCI, and that's the exact command they run. On their system (Linux), it fails precisely the same way as on mine (OS X).
What is happening?

Cabal: What does "only already installed instances can be used" mean?

I'm new to Cabal, and this phrase "only already installed instances can be used" doesn't make any sense to me.
$ cabal install base==4.7.0.0
Resolving dependencies...
cabal: Could not resolve dependencies:
next goal: base (user goal)
rejecting: base-4.7.0.1 (global constraint requires ==4.7.0.0)
rejecting: base-4.7.0.0 (only already installed instances can be used)
rejecting: base-4.6.0.1/installed-8aa..., 4.6.0.1, 4.6.0.0, 4.5.1.0, 4.5.0.0,
4.4.1.0, 4.4.0.0, 4.3.1.0, 4.3.0.0, 4.2.0.2, 4.2.0.1, 4.2.0.0, 4.1.0.0,
4.0.0.0, 3.0.3.2, 3.0.3.1 (global constraint requires ==4.7.0.0)
Dependency tree exhaustively searched.
What is Cabal trying to communicate here?
Cabal won't let you install base. I ran into this issue when trying to install the profiling version of base. Instead, you need to do something like:
sudo apt-get install haskell-platform-prof
See this thread for a discussion by cabal developers.

how to create a debian package using “equivs-build” which can be “upgraded” if already installed?

I have created a .deb package using equivs-build command and providing necessary control, preinst, postinst, etc. I noticed that version can also be mentioned in control file. Now I want to create a .deb package with updated source code and I want to enable user to upgrade the package if it is already installed (and is of previous version, of course), as I won't be changing conf related files, etc. One way I can think of is to write a shell-script which will first check for installed version, and will take actions accordingly (i.e. if installed, just update the source-code, database-migrations, etc. and if not, install the package using dpkg -i <package-name>). I was wondering if there was a way to achieve using dpkg only (something like dpkg upgrade <package-name>) which will handle installation or up-gradation as required.
That's already how it works.
dpkg -i package_0.123.deb will upgrade if the version of package is less than 0.123, removing the previous version if necessary (there's an option to force a downgrade, too). apt-get install package will install the newest version of package, removing the old one and upgrading to a new one if necessary. apt-get upgrade will upgrade all packages to the newest version.
Basically, just take care to monotonically upgrade the version number each time you publish a new build.
If you didn't specify a version previously, the default will be something simple like 1.0. Just make it bigger than that.

Resources