Skip to content

fix(haskell): install Haskell libraries#52

Merged
koralowiec merged 3 commits into
devcontainers-extra:mainfrom
klezm:issue/584
Nov 4, 2024
Merged

fix(haskell): install Haskell libraries#52
koralowiec merged 3 commits into
devcontainers-extra:mainfrom
klezm:issue/584

Conversation

@klezm

@klezm klezm commented Oct 14, 2024

Copy link
Copy Markdown
Contributor

As discussed in devcontainers-contrib/features/issues/584 you can install either executables or libraries with Cabal. This PR fixes devcontainers-contrib/features/issues/584 and adds the option to install libraries besides executables.

Add globalLibraries option
@klezm

klezm commented Oct 14, 2024

Copy link
Copy Markdown
Contributor Author

Here is the original PR devcontainers-contrib/features/pull/600

@koralowiec koralowiec self-requested a review October 18, 2024 19:27
@koralowiec

Copy link
Copy Markdown
Member

As you introduce a new option to the feature (globalLibraries), I would like to have a test scenario for that - It should verify whether the packages are installed as libraries

@koralowiec koralowiec added the existing feature This PR or issue is about modifying an existing Dev Container feature label Oct 20, 2024
@klezm

klezm commented Nov 1, 2024

Copy link
Copy Markdown
Contributor Author

Both just test-scenario haskell test_libraries and just test haskell succeed when I run them locally.
Running the test via GitHub Actions throws the error ghc: command not found though.

(GitHub Copilot suggested to "free up disk space on the runner to ensure enough space for file operations.")

@koralowiec

Copy link
Copy Markdown
Member

Yeah, test passes locally

Indeed, it seems that the issue may be the lack of disk space - 3rd line here (ref):

[2024-11-01T11:54:09.389Z] #14 83.60 [ Error ] [�]8;;[https://errors.haskell.org/messages/GHCup-00080�\GHCup](https://errors.haskell.org/messages/GHCup-00080%1B/GHCup)
[2024-11-01T11:54:09.523Z] -00080�]8;;�\] Failed to merge file tree from /home/vscode/.cache/ghcup/tmp/ghcup-e8a428df65a662cd/home/vscode/.local/share/ghcup/ghc/9.4.8 to /home/vscode/.local/share/ghcup/ghc/9.4.8 
#14 83.60 [ ...   ] exception was: <file descriptor: 18>: hPutBuf: resource exhausted (No space left on device)
#14 83.60 [ ...   ] ...you may need to delete /home/vscode/.local/share/ghcup/ghc/9.4.8 manually. Make sure it's gone.
#14 83.60 [ Error ] Also check the logs in /home/vscode/.cache/ghcup/logs

If I understand currently, right now we have 4 different packages set for the scenario (here). I think that we can reduce the number to just 2 libraries. Also, can we install more lightweight ones? Maybe that will help reduce the disk usage

@klezm

klezm commented Nov 1, 2024

Copy link
Copy Markdown
Contributor Author

hspec has QuickCheck and HUnit besides countless other dependencies anyways.
For testing it doesn't matter which library I install. So I'll search for one that has minimum dependencies.

To free up space on the action runner I used this action once and it worked fine for me. It also allows filtering for what to delete.
https://github.com/marketplace/actions/free-disk-space-ubuntu
This action takes some time though!

@koralowiec

Copy link
Copy Markdown
Member

I check out that GitHub Action! Thanks for suggesting it

@koralowiec

Copy link
Copy Markdown
Member

I included the GitHub Action in the Workflow (more context in #69). Could you please rebase your branch?

@klezm

klezm commented Nov 4, 2024

Copy link
Copy Markdown
Contributor Author

Those are some small Haskell packages we could use for testing. I'll go with stm as it is the smallest with no dependencies at all

  • stm no deps
    • import Control.Concurrent.STM"
  • HUnit deps: call-stack
    • import Test.HUnit"
  • QuickCheck deps: splitmix random
    • import Test.QuickCheck"
  • async deps: os-string hashable
    • import Control.Concurrent.Async"
  • text no deps but long build time!
    • import Data.Text"

@koralowiec koralowiec left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! LGTM

@koralowiec koralowiec merged commit a9a0944 into devcontainers-extra:main Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

existing feature This PR or issue is about modifying an existing Dev Container feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Haskell: globalPackages option installs no libraries

2 participants