Closed shakfu closed 6 months ago
worksforme when building from source (this repo, master). confirm that the error appears when building from hackage source. looks like the issue was fixed with 67d5d0e0a41a484bdb2a85adff1ab166e7c32fde (at least the commit log mentions Eq1)
@jwaldmann Thanks for your response. I installed via cabal install csound-expression
not from the repo, so it was from hackage. But in any case thanks for the fix, I'll try again and test it further.
For anyone else as brand-new to Haskell and cabal as I am, you can circumvent this issue by directing cabal
to build the csound-expression-dynamic
package from a recent commit on GitHub.
Add these lines to your cabal.project
file:
source-repository-package
type: git
location: https://github.com/spell-music/csound-expression
tag: 345df2c91c9831dd895f58951990165598504814
subdir: csound-expression-dynamic
Then re-build using cabal. This appears to encourage cabal to build the csound-expression-dynamic
package from the specified github commit, and appears to work even when your_project.cabal
depends on it indirectly, e.g. build-depends: csound-expression, ...
Then, naturally, since I built a more-recent version of a sub-dependency, I also needed to build the matching versions for the other csound-*
packages. Add to cabal.project
:
source-repository-package
type: git
location: https://github.com/spell-music/csound-expression
tag: 345df2c91c9831dd895f58951990165598504814
subdir: csound-expression-typed
source-repository-package
type: git
location: https://github.com/spell-music/csound-expression
tag: 345df2c91c9831dd895f58951990165598504814
subdir: csound-expression-opcodes
source-repository-package
type: git
location: https://github.com/spell-music/csound-expression
tag: 345df2c91c9831dd895f58951990165598504814
subdir: csound-expression
source-repository-package
type: git
location: https://github.com/spell-music/csound-expression
tag: 345df2c91c9831dd895f58951990165598504814
subdir: csound-sampler
yes that's possible. the easy way to build all the world at once is this:
$ git clone https://github.com/spell-music/csound-expression/
$ cd csound-expression
$ cabal install --lib all base --package-env=cse
then use with
$ ghci -package-env=cse
ghci> import Csound.Base
just tested with ghc-9.6.2, cabal-install-3.10.1.0.
Note: package environment files contain a collection of exposed libraries (exposed = you can import
them in ghci), all
denotes all packages mentioned in cabal.project
, and base
should also be exposed. It's good to have different env files for different projects, avoids per-user cabal hell.
references:
https://downloads.haskell.org/ghc/latest/docs/users_guide/packages.html#package-environments
long discussion about exposing base
: https://github.com/haskell/cabal/issues/8894
@jwaldmann / @colllin
Thanks for the additional guidance on this issue.
I'm new to cabal/Haskell but the above advice doesn't get me past trying to build:
https://github.com/ariesoeteman/figurative_apperception_engine
which fails on the Compilation instructions step:
at which point the OP error occurs.
I recommend to use stack, or install the package from hackage. I build it with stack from sources.
With stack we can create custom environments where to load the lib. Here is the link on how I install the lib: https://github.com/spell-music/csound-expression/blob/master/tutorial/chapters/Intro.md#installing-with-stack-recommended
I create shortcat alias to the command which opens up ghci with all libraries loaded to the interpreter.
I've tried out from scratch with this instruction for stack and it works. This workflow is geared toward using ghci. Usually I try small snippets and if I like it I copy them to file and reload it to interpreter.
But if you want to use it from haskell project in write-compile-listen loop. You can create new stack project with stack new my-project-name
and in the stack.yaml write link to the library on your local drive or in the github repo.
Make sure that your resolver in the stack.yaml matches the one from csound-expression's stack.yaml.
So the algorithm for project is:
stack new foo-bar
extra-deps:
- git: https://github.com/spell-music/csound-expression
commit: <use-latest-commit-from-master-branch-here>
after that you can use libraries from the repo as deps.
Ok, it's a bit more involved. Here is the complete stack.yaml for a new project that depends on CE:
resolver:
lts-20.5
packages:
- .
extra-deps:
- git: https://github.com/spell-music/csound-expression
commit: 345df2c91c9831dd895f58951990165598504814
subdirs:
- csound-expression-dynamic
- csound-expression-typed
- csound-expression-opcodes
- csound-expression
- git: https://github.com/spell-music/temporal-media
commit: b0508a6444714ac64d970d505e27f66daefc8ff1
- git: https://github.com/spell-music/data-fix-cse
commit: abff72605479401fc43fa62f053153a11d7a1c61
zip archive with example project that works.
do commands:
stack install
stack run
<Ctrl+C> to stop
install also csound before that.
Please use newer versions of ghc. It works with 9.6.4 and 9.8
@anton-k Ok, thanks for update!