You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 12, 2025. It is now read-only.
Packages (e.g. hspec) passed to globalPackages are only installed as executables and not as libraries, which often is necessary. For them to be accessible as libraries the --lib flag is missing in the cabal install command here:
My workaround for the moment is to add the cabal install --lib at the onCreateCommand. This will move the time consuming build process to the image creation (which is favorable for prebuilding devcontainers). But, if the build of a package fails the onCreateCommand fails as well which renders the image useless! Another alternative is to use another feature bash-command.
{
"name": "Ubuntu",
"image": "mcr.microsoft.com/devcontainers/base:jammy",
"features": {
"ghcr.io/devcontainers-contrib/features/haskell:2": {
"globalPackages": "hspec hspec-contrib"
},
// Alternative 1"ghcr.io/devcontainers-contrib/features/bash-command:1": {
"command": "echo \\\"cabal install --lib hspec hspec-contrib\\\" | sudo -iu $_REMOTE_USER"
}
},
// Or without using another feature, you can just install the libraries using onCreateCommand// Alternative 2"onCreateCommand": "cabal install --lib hlint hspec hspec-contrib"
}
Feature id and version
ghcr.io/devcontainers-contrib/features/haskell:2
Devcontainer base Image
mcr.microsoft.com/devcontainers/base:jammy
What happened?
Packages (e.g.
hspec
) passed toglobalPackages
are only installed as executables and not as libraries, which often is necessary. For them to be accessible as libraries the--lib
flag is missing in thecabal install
command here:features/src/haskell/install.sh
Line 89 in 9a1d24b
For more info on
cabal install --lib
and the difference between libraries and executables see: haskell/cabal#6481 and cabal.readthedocs.io [1], [2]Maybe an additional option (e.g.
globalLibraries
) for this feature would be the best.Relevant log output
No response
The text was updated successfully, but these errors were encountered: