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

How to install system libraries on windows? #37

Open

Description

@hasufell

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).

Activity

  1. hasufell commented on Sep 27, 2020

    @hasufell
    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

  2. hazelweakly commented on Oct 1, 2020

    @hazelweakly
    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.

  3. expipiplus1 commented on Nov 6, 2020

    @expipiplus1

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions