ghc: unable to load package `snap-core-0.9.4.1' - cabal

When trying to install snap with cabal I get the following, how can I fix this? :
$ cabal install snap
Resolving dependencies...
Configuring snap-0.13.1.2...
Building snap-0.13.1.2...
Preprocessing library snap-0.13.1.2...
[ 1 of 33] Compiling Snap.Snaplet.Internal.RST ( src/Snap/Snaplet/Internal/RST.hs, dist/build/Snap/Snaplet/Internal/RST.o )
[ 2 of 33] Compiling Snap.Snaplet.Internal.Lensed ( src/Snap/Snaplet/Internal/Lensed.hs, dist/build/Snap/Snaplet/Internal/Lensed.o )
[ 3 of 33] Compiling Snap.Snaplet.Internal.LensT ( src/Snap/Snaplet/Internal/LensT.hs, dist/build/Snap/Snaplet/Internal/LensT.o )
[ 4 of 33] Compiling Control.Access.RoleBased.Internal.Role ( src/Control/Access/RoleBased/Internal/Role.hs, dist/build/Control/Access/RoleBased/Internal/Role.o )
[ 5 of 33] Compiling Control.Access.RoleBased.Internal.Rule ( src/Control/Access/RoleBased/Internal/Rule.hs, dist/build/Control/Access/RoleBased/Internal/Rule.o )
[ 6 of 33] Compiling Control.Access.RoleBased.Internal.Types ( src/Control/Access/RoleBased/Internal/Types.hs, dist/build/Control/Access/RoleBased/Internal/Types.o )
[ 7 of 33] Compiling Control.Access.RoleBased.Role ( src/Control/Access/RoleBased/Role.hs, dist/build/Control/Access/RoleBased/Role.o )
[ 8 of 33] Compiling Control.Access.RoleBased.Types ( src/Control/Access/RoleBased/Types.hs, dist/build/Control/Access/RoleBased/Types.o )
[ 9 of 33] Compiling Control.Access.RoleBased.Internal.RoleMap ( src/Control/Access/RoleBased/Internal/RoleMap.hs, dist/build/Control/Access/RoleBased/Internal/RoleMap.o )
[10 of 33] Compiling Control.Access.RoleBased.Checker ( src/Control/Access/RoleBased/Checker.hs, dist/build/Control/Access/RoleBased/Checker.o )
[11 of 33] Compiling Snap.Snaplet.Session.SessionManager ( src/Snap/Snaplet/Session/SessionManager.hs, dist/build/Snap/Snaplet/Session/SessionManager.o )
[12 of 33] Compiling Snap.Snaplet.Session.SecureCookie ( src/Snap/Snaplet/Session/SecureCookie.hs, dist/build/Snap/Snaplet/Session/SecureCookie.o )
[13 of 33] Compiling Snap.Snaplet.Session.Common ( src/Snap/Snaplet/Session/Common.hs, dist/build/Snap/Snaplet/Session/Common.o )
[14 of 33] Compiling Snap.Snaplet.Config ( src/Snap/Snaplet/Config.hs, dist/build/Snap/Snaplet/Config.o )
src/Snap/Snaplet/Config.hs:9:1:
Warning: In the use of `mkTyCon'
(imported from Data.Typeable):
Deprecated: "either derive Typeable, or use mkTyCon3 instead"
[15 of 33] Compiling Snap.Snaplet.Internal.Types ( src/Snap/Snaplet/Internal/Types.hs, dist/build/Snap/Snaplet/Internal/Types.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package bytestring-0.9.2.1 ... linking ... done.
Loading package primitive-0.4.1 ... linking ... done.
Loading package vector-0.9.1 ... linking ... done.
Loading package vector-algorithms-0.5.4.2 ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package stm-2.3 ... linking ... done.
Loading package extensible-exceptions-0.1.1.4 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package MonadCatchIO-transformers-0.3.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.4.2.1 ... linking ... done.
Loading package text-0.11.2.0 ... linking ... done.
Loading package attoparsec-0.10.4.0 ... linking ... done.
Loading package enumerator-0.4.20 ... linking ... done.
Loading package attoparsec-enumerator-0.3.1 ... linking ... done.
Loading package blaze-builder-0.3.1.1 ... linking ... done.
Loading package blaze-builder-enumerator-0.2.0.5 ... linking ... done.
Loading package hashable-1.1.2.5 ... linking ... done.
Loading package case-insensitive-1.1 ... linking ... done.
Loading package mtl-2.1.1 ... linking ... done.
Loading package parsec-3.1.2 ... linking ... done.
Loading package unix-2.5.1.0 ... linking ... done.
Loading package network-2.3.0.13 ... linking ... done.
Loading package old-locale-1.0.0.4 ... linking ... done.
Loading package HUnit-1.2.4.2 ... linking ... done.
Loading package bytestring-mmap-0.2.2 ... linking ... done.
Loading package filepath-1.3.0.0 ... linking ... done.
Loading package old-time-1.1.0.0 ... linking ... done.
Loading package directory-1.1.0.2 ... linking ... done.
Loading package time-1.4 ... linking ... done.
Loading package random-1.0.1.1 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-posix-0.95.1 ... linking ... done.
Loading package unix-compat-0.4.1.1 ... linking ... done.
Loading package unordered-containers-0.2.3.3 ... linking ... done.
Loading package zlib-0.5.3.3 ... linking ... done.
Loading package zlib-bindings-0.1.1.3 ... linking ... done.
Loading package zlib-enum-0.2.3 ... linking ... done.
Loading package snap-core-0.9.4.1 ... linking ... ghc:
unknown symbol `_directoryzm1zi2zi0zi1_SystemziDirectory_doesDirectoryExist2_closure'
ghc: unable to load package `snap-core-0.9.4.1'
Failed to install snap-0.13.1.2
cabal: Error: some packages failed to install:
snap-0.13.1.2 failed during the building phase. The exception was:
ExitFailure 1

My guess is that you have two or more different versions of directory installed. I'd recommend blowing away your package repository with rm -fr ~/.ghc and reinstalling. If that doesn't work, then I'd need more information. In that case it would probably be easier to debug this interactively in the #snapframework IRC channel.

Related

How do I install elm-repl despite these errors?

I'm brand new to elm and web development generally. I'm working through the guide here. I installed Sublime Text and the elm compiler. I'd like to use a REPL to play around with things easily. I tried installing it through the instructions here, where I run this:
cabal update ; cabal install elm-repl
But I get this error:
Resolving dependencies...
Configuring http-client-0.5.8...
Building http-client-0.5.8...
Failed to install http-client-0.5.8
Build log ( /home/matt/.cabal/logs/http-client-0.5.8.log ):
cabal: Entering directory '/tmp/cabal-tmp-9068/http-client-0.5.8'
Configuring http-client-0.5.8...
Building http-client-0.5.8...
Preprocessing library http-client-0.5.8...
[ 1 of 19] Compiling Network.PublicSuffixList.Types ( publicsuffixlist/Network/PublicSuffixList/Types.hs, dist/build/Network/PublicSuffixList/Types.o )
[ 2 of 19] Compiling Network.PublicSuffixList.Serialize ( publicsuffixlist/Network/PublicSuffixList/Serialize.hs, dist/build/Network/PublicSuffixList/Serialize.o )
[ 3 of 19] Compiling Network.PublicSuffixList.DataStructure ( publicsuffixlist/Network/PublicSuffixList/DataStructure.hs, dist/build/Network/PublicSuffixList/DataStructure.o )
[ 4 of 19] Compiling Network.PublicSuffixList.Lookup ( publicsuffixlist/Network/PublicSuffixList/Lookup.hs, dist/build/Network/PublicSuffixList/Lookup.o )
[ 5 of 19] Compiling Network.HTTP.Client.Util ( Network/HTTP/Client/Util.hs, dist/build/Network/HTTP/Client/Util.o )
[ 6 of 19] Compiling Data.KeyedPool ( Data/KeyedPool.hs, dist/build/Data/KeyedPool.o )
[ 7 of 19] Compiling Network.HTTP.Client.Types ( Network/HTTP/Client/Types.hs, dist/build/Network/HTTP/Client/Types.o )
[ 8 of 19] Compiling Network.HTTP.Client.Connection ( Network/HTTP/Client/Connection.hs, dist/build/Network/HTTP/Client/Connection.o )
[ 9 of 19] Compiling Network.HTTP.Client.Body ( Network/HTTP/Client/Body.hs, dist/build/Network/HTTP/Client/Body.o )
[10 of 19] Compiling Network.HTTP.Client.Cookies ( Network/HTTP/Client/Cookies.hs, dist/build/Network/HTTP/Client/Cookies.o )
Network/HTTP/Client/Cookies.hs:152:38: error:
• Couldn't match expected type ‘Builder’
with actual type ‘Data.ByteString.Builder.Internal.Builder’
NB: ‘Data.ByteString.Builder.Internal.Builder’
is defined in ‘Data.ByteString.Builder.Internal’
in package ‘bytestring-0.10.8.1’
‘Builder’
is defined in ‘Blaze.ByteString.Builder.Internal.Types’
in package ‘blaze-builder-0.3.3.4’
• In the second argument of ‘($)’, namely
‘renderCookies $ output_cookies’
In the expression: toByteString $ renderCookies $ output_cookies
In an equation for ‘output_line’:
output_line = toByteString $ renderCookies $ output_cookies
cabal: Leaving directory '/tmp/cabal-tmp-9068/http-client-0.5.8'
cabal: Error: some packages failed to install:
Elm-0.12.3 depends on http-client-0.5.8 which failed to install.
elm-repl-0.2.2.1 depends on http-client-0.5.8 which failed to install.
http-client-0.5.8 failed during the building phase. The exception was:
ExitFailure 1
http-client-tls-0.3.5.3 depends on http-client-0.5.8 which failed to install.
pandoc-2.1 depends on http-client-0.5.8 which failed to install.
If you've already installed the Elm compiler, you already have the REPL. Try typing elm repl in the shell. Note that there is no hyphen in this command.
The instructions you are following to install a separate REPL are long out of date.

XLConnect, rJava and package building

I am writing a function that i want to include in a user-defined package (MYPACKAGE). The function is a follows:
readSchedule <- function(FILE){
WB = loadWorkbook(FILE)
WS= readWorksheet(WB, sheet = 'Sheet1',header = TRUE)
return(WS)
}
where FILE is the name of the Excel file i want to read. When writing this function, I want it to import XLConnect, since that is the package it uses. I placed header code defining the function:
#param FILE Excel file
#return Excel data
#export
#import XLConnect
I have also added import(XLConnect) to the NAMESPACE and the DESCRIPTION file of MYPACKAGE. The package builds fine (or at least at first cut it appears to build OK) but when i run "Check Package" it fails and gives me the following error:
* installing *source* package 'MYPACKAGE' ...
** R
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
*** arch - i386
Error : .onLoad failed in loadNamespace() for 'rJava', details:
call: fun(libname, pkgname)
error: No CurrentVersion entry in Software/JavaSoft registry! Try re-installing Java and make sure R and Java have matching architectures.
Error: loading failed
Execution halted
*** arch - x64
ERROR: loading failed for 'i386'
I have the correct version of Java and can load rJava just fine. i've tried importing rJava (similar to XLConnect) but i get the same error. Below is my sessionInfo:
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] MYPACKAGE
loaded via a namespace (and not attached):
[1] chron_2.3-45 data.table_1.9.4 digest_0.6.8 lubridate_1.3.3 memoise_0.2.1 plyr_1.8.1
[7] Rcpp_0.11.1 reshape2_1.4 rJava_0.9-6 stringr_0.6.2 tools_3.1.2 XLConnect_0.2-7
It looks like you are building your package on a Windows 64-bit machine with a 64-bit version of Java installed. When checking your package using R CMD check, R by default also attempts to check your package on other sub-architectures (i386, 32-bit) which in your case would in addition require a 32-bit installation of Java.
If you want to check your package also for i386 you may just additionally install Java 32-bit. The other option is to pass the option --no-multiarch to your R CMD check call, e.g. R CMD check --no-multiarch MYPACKAGE.

Why the tests are not running ? ( Golang ) - goapp test - bug?

I'm trying to run GAE tests on multiple packages. My app (testapp ) looks as below:
testapp>
README.md package1 package2
each package has two go files. One is the package itself the other is the 'test' package.
package1
$ls package1
package1.go package1_test.go
package2
$ls package2
package2.go package2_test.go
To run the tests I use
goapp test -v ./...
Output:
warning: building out-of-date packages:
github.com/mihai/API
installing these packages with 'go test -i ./...' will speed future tests.
=== RUN TestGetDiskFile
codelistgobfile.gob
codelist.gob written successfully
--- PASS: TestGetDiskFile (0.00 seconds)
PASS
ok testapp/package1 0.010s
However as you can see above it seems to run only the first test ( TestGetDiskFile ) from package1. After that it gets stuck. I get no kind of output. If I go in each package ( cd package 1 ) and run goapp test all the tests (about 20 tests) run successfully
Any idea how I can fix / run all the tests without getting stuck or at least how I can debug it further? is this a goapp bug?
I've tried on two different machines ( Mac osx , and ubuntu ), the result is same.
To debug, strip things down to a minimal test case. For example, the following is a minimal test case for go test -v ./.... Try something similar for goapp test -v ./....
$ dir
package1 package2
$ tree ../packages
../packages
├── package1
│   └── package1_test.go
└── package2
└── package2_test.go
2 directories, 2 files
$ go test -v ./...
=== RUN TestPackage1
--- PASS: TestPackage1 (0.00 seconds)
PASS
ok packages/package1 0.004s
=== RUN TestPackage2
--- PASS: TestPackage2 (0.00 seconds)
PASS
ok packages/package2 0.004s
$
File: package1_test.go:
package package1
import "testing"
func TestPackage1(t *testing.T) {}
File: package2_test.go:
package package2
import "testing"
func TestPackage2(t *testing.T) {}

Including Agilent Drivers in Ansi-C VS2010 Project results in error LNK2001

I am unable to resolve a linker error
my projects includes in one of its c files:
#include "../bin/AgN6700/agN6700.h"
#pragma comment(lib, "bin/AgN6700/agN6700.lib")
This is a adaption to a powersupply.
This adaption has several dependencies.
76 symbols fail to link.
8 are defined in the ivi.h
76 are defined in the visa.h
I have lib files for both of them on my machine in the folder:
C:\Program Files (x86)\National Instruments\Shared\CVI\ExtLib\msvc
So i added this folder to the library entrie in the VS2010 Project.
What is going wrong here? How can i investigate and solve this issue?
The full list of LNK2001 errors:
agN6700.lib(agn6700.c) : error LNK2001: ... Symbol "...".
_viOpen#20
_viClose#4
_viSetAttribute#12
_viRead#16
_viSetBuf#12
_viPrintf
_viScanf
_viQueryf
_Ivi_DefaultCheckCallbackViInt32#16
_Ivi_DefaultCheckCallbackViReal64#20
_Ivi_SpecificDriverNew#12
_Ivi_Dispose#4
_Ivi_SetAttributeViInt32#20
_Ivi_SetAttributeViReal64#24
_Ivi_SetAttributeViString#20
_Ivi_SetAttributeViBoolean#20
_Ivi_SetAttributeViSession#20
_Ivi_SetAttributeViAddr#20
_Ivi_CheckAttributeViInt32#20
_Ivi_CheckAttributeViReal64#24
_Ivi_CheckAttributeViString#20
_Ivi_CheckAttributeViBoolean#20
_Ivi_CheckAttributeViSession#20
_Ivi_GetAttributeViInt32#20
_Ivi_GetAttributeViReal64#20
_Ivi_GetAttributeViString#24
_Ivi_GetAttributeViBoolean#20
_Ivi_GetAttributeViSession#20
_Ivi_GetAttributeViAddr#20
_Ivi_AddAttributeViInt32#32
_Ivi_AddAttributeViReal64#40
_Ivi_AddAttributeViString#28
_Ivi_AddAttributeViBoolean#28
_Ivi_AddAttributeViAddr#28
_Ivi_SetAttrReadCallbackViString#12
_Ivi_SetAttrCheckCallbackViInt32#12
_Ivi_SetAttrCheckCallbackViReal64#12
_Ivi_SetAttrCheckCallbackViBoolean#12
_Ivi_SetAttrCoerceCallbackViReal64#12
_Ivi_InvalidateAttribute#12
_Ivi_InvalidateAllAttributes#4
_Ivi_NeedToCheckStatus#4
_Ivi_SetNeedToCheckStatus#8
_Ivi_BuildChannelTable#16
_Ivi_CoerceChannelName#12
_Ivi_GetNthChannelString#12
_Ivi_SetErrorInfo#20
_Ivi_GetErrorInfo#16
_Ivi_ClearErrorInfo#4
_Ivi_ParamPositionError#4
_Ivi_LockSession#8
_Ivi_UnlockSession#8
_Ivi_IOSession#4
_Ivi_RangeChecking#4
_Ivi_QueryInstrStatus#4
_Ivi_Simulating#4
_Ivi_GetStringFromTable#12
_Ivi_GetValueFromTable#12
_Ivi_GetAttrRangeTable#16
_Ivi_GetViInt32EntryFromValue#32
_Ivi_GetViInt32EntryFromString#28
_Ivi_Alloc#12
_Ivi_Free#8
_Ivi_SetValInStringCallback#12
_Ivi_GetSpecificDriverStatusDesc#16
_Ivi_CompareWithPrecision#24
_Ivi_WriteInstrData#8
_Ivi_ReadInstrData#16
_Ivi_GetInfoFromResourceName#20
_Ivi_GetNextCoercionString#12
_Ivi_GetNextInterchangeCheckString#12
_Ivi_ResetInterchangeCheck#4
_Ivi_ClearInterchangeWarnings#4
_Ivi_GetAttributeFlags#12
_Ivi_SetAttributeFlags#12
_Ivi_ApplyDefaultSetup#4
It seems i misunderstood how lib files are included in the buildprocess.
The solution is to supply the linker with additional dependencies via the project properties.
This is illustrated in this stackoverflow post.

How to compile a C extension as part of a ruby gem with mkmf on Mac OS X?

I am trying to create a gem that wraps libpuzzle, but cannot figure out this flat_namespace issue:
--- personal/sayzame ‹master* M⁇› » gem build sayzame.gemspec && gem install sayzame-0.0.1.gem
Successfully built RubyGem
Name: sayzame
Version: 0.0.1
File: sayzame-0.0.1.gem
Building native extensions. This could take a while...
Successfully installed sayzame-0.0.1
1 gem installed
--- personal/sayzame ‹master* M⁇› » pry -rsayzame -Ilib
[1] pry(main)> Sayzame.compare_images :a, :b
dyld: lazy symbol binding failed: Symbol not found: _puzzle_init_dvec
Referenced from: /usr/local/lib/libpuzzle.dylib
Expected in: flat namespace
dyld: Symbol not found: _puzzle_init_dvec
Referenced from: /usr/local/lib/libpuzzle.dylib
Expected in: flat namespace
[1] 56394 trace trap pry -rsayzame -Ilib
My full source code here: https://github.com/neezer/sayzame
I'm fairly sure the problem is in my ext/puzzle/extconf.rb file, in that I am not linking the library correctly. I have already posted on ffi/ffi's issue tracker about it and followed up on those two leads with no success.
I would really appreciate any and all help here; been banging my head against the wall for quite sometime on this.
Possibly related:
- https://groups.google.com/d/msg/picky-ruby/8kuG8FkATgU/89JLc6U7SrcJ

Resources