Closed curiousleo closed 8 years ago
Actually, even with imm installed globally using cabal install imm
, I get the same error...
I believe you need to perform the following steps:
cabal build
: this will build the project in the dist/
directory;cabal install
: this will install the project in the sandbox directory;cabal exec dist/build/imm/imm -- <options>
: this will execute the binary generated by cabal build
, and ensure that everything from the sandbox is visible.This procedure is not specific to imm, you can apply it to any project that uses both dyre
and sandboxes.
Please let me know if it doesn't fix your issue.
Thanks for the help! Unfortunately that only fails with a different error. The build works just fine:
$ cabal build && cabal install
... all fine ...
$ ls -lh dist/build/imm
total 21M
-rwxr-xr-x 1 leo leo 21M May 21 21:50 imm
drwxr-xr-x 1 leo leo 26 May 21 21:50 imm-tmp
But then cabal exec
fails ...
$ cabal exec dist/build/imm/imm -- -h
cabal: The program 'dist/build/imm/imm' is required but it could not be found.
... even though the program is clearly there and executable:
$ ./dist/build/imm/imm -h
... prints help ...
My bad: you need to provide cabal exec
with the full (absolute) path to the executable.
Don't ask me why :) .
I tried that too... When I give cabal exec
the executable's absolute path, it behaves as if I had just started the executable directly:
./dist/imm/imm -h
and cabal exec /absolute/path/to/imm -- -h
both print the usage notes./dist/imm/imm -l
and cabal exec /absolute/path/to/imm -- -l
both fail with Could not find module ‘Imm’
as before.Well I'm running out of ideas here...
The error suggests that the sandbox is somehow missing the Imm
module, so have a look inside the .cabal-sandbox
directory and see if you can find it. I don't know how the directory is organized so I can't tell you where to look precisely, sorry.
Also, just to be sure, does the same error happen when you run cabal exec imm -- -l
(without the path) ?
Hi, cabal exec imm -- -l
unfortunately gives the same "module not found" error.
I found Imm's compiled files in the .cabal-sandbox
directory:
.cabal-sandbox/lib/x86_64-linux-ghc-7.8.4/imm-0.6.0.3
├── Imm
│ ├── Boot.dyn_hi
│ ├── Boot.hi
│ ├── Config.dyn_hi
│ ├── Config.hi
│ ├── Core.dyn_hi
│ ├── Core.hi
│ ├── Database.dyn_hi
│ ├── Database.hi
│ ├── Dyre.dyn_hi
│ ├── Dyre.hi
│ ├── Error.dyn_hi
│ ├── Error.hi
│ ├── Feed.dyn_hi
│ ├── Feed.hi
│ ├── HTTP.dyn_hi
│ ├── HTTP.hi
│ ├── Maildir.dyn_hi
│ ├── Maildir.hi
│ ├── Mail.dyn_hi
│ ├── Mail.hi
│ ├── OPML.dyn_hi
│ ├── OPML.hi
│ ├── Options.dyn_hi
│ ├── Options.hi
│ ├── Util.dyn_hi
│ └── Util.hi
├── Imm.dyn_hi
├── Imm.hi
├── libHSimm-0.6.0.3.a
├── libHSimm-0.6.0.3-ghc7.8.4.so
├── Paths_imm.dyn_hi
└── Paths_imm.hi
1 directory, 32 files
But I don't know enough about how cabal/ghc determine the search path to tell where things are going wrong...
Closing this issue as it is rather old and probably not relevant anymore (imm code has changed a lot). Please reopen otherwise.
Hi there, I built imm in a cabal sandbox. With the example configuration in
~/.config/imm/imm.hs
, I get the following error when invokingimm -l
:I think I understand where this is coming from---the Imm module is not available to ghc because the sandbox I built it in is not in the search path. But how do I fix it? Is there some way to run
imm
out of a sandbox?