Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

How to install system libraries on windows? #37

Open
hasufell opened this issue Sep 26, 2020 · 3 comments
Open

How to install system libraries on windows? #37

hasufell opened this issue Sep 26, 2020 · 3 comments

Comments

@hasufell
Copy link

I think it's common to have to install system libraries. I don't see any description on how to do that with this action (for both stack and cabal).

@hasufell
Copy link
Author

For cabal, I tried

    - name: Install system dependencies (windows)
      if: matrix.os == 'windows-latest'
      run: mingw64-pkg install zlib

It failed with


Run mingw64-pkg install zlib
Bash environment variable found, are you sure you installed cabal and msys2 via chocolatey?
At C:\ProgramData\chocolatey\lib\cabal.3.2.0.0\tools\mingw64-pkg.ps1:39 char:3
+   throw ("Bash environment variable found, are you sure you installed ...
+   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Bash environmen...via chocolatey?:String) [], RuntimeException
    + FullyQualifiedErrorId : Bash environment variable found, are you sure you installed cabal and msys2 via chocolat 
   ey?
 
Error: Process completed with exit code 1.

https://github.com/hasufell/stack2cabal/runs/1172870260?check_suite_focus=true#step:7:1

@hazelweakly
Copy link
Contributor

This took way too long to figure out, but I think I have a minimal example here:

jobs:
  zlib:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2
      - uses: msys2/setup-msys2@v2
        with:
          update: true
          install: zlib
      - uses: haskell-CI/setup@main
        with:
          ghc-version: 8.8.4
          cabal-version: 3.2.0.0
      - run: cabal update
      - run: cabal run

(with a minimal hello-world of importing the zlib library to make sure I'm using something that needs zlib)

I couldn't get mingw64-pkg working regardless of whether or not I installed msys2 via chocolatey or the action. This is the codepath that is causing it to fail. I'm not quite sure why it's there; although it seems to just be a wrapper around pacman -S $package_name, which would make its functionality equivalent to the setup-msys2 snippet above.

@expipiplus1
Copy link

There's nothing Haskell specific about installing system packages.

Cabal or stack just has to be informed about their include/lib locations, and DLL locations added to PATH.

I've been using pkgconfiglite installed by chocolatey for some packages: https://github.com/expipiplus1/vulkan/blob/master/.github/workflows/ci.yml#L63 (in this action I install some dependencies for Cabal and Stack (near the end))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants