Skip to content

Investigation of pkg-config, brew / vcpkg on GHA #35

@robo9k

Description

@robo9k

In order to see how viable #1 is I've tested this with GitHub Actions on their shared runners.

At the time of writing:

ubuntu-22.04

  • pkg-config 0.29.2-1ubuntu3
  • libmagic1 1:5.41-3ubuntu0.1
  • libmagig-dev 1:5.41-3ubuntu0.1
  • build static with "-lmagic -llzma -lbz2 -lz"

macos-12

  • pkg-config 0.29.2_3
  • libmagic 5.45
  • brew 4.1.14
  • build static with "-I/usr/local/Cellar/libmagic/5.45/include -L/usr/local/Cellar/libmagic/5.45/lib -lmagic -llzma -lbz2 -lz"

windows-2022

  • libmagic 5.40#2
  • vcpkg 2023-09-15-ac02a9f660977426b8ec6392919fbb1d51b10998
  • build static with ??? (needs vcpkg triplet selection iiuc)
on:
  workflow_dispatch: 

jobs:
  ubuntu:
    runs-on: ubuntu-22.04

    steps:
      - run: |
          sudo apt-get update
          sudo apt-get install libmagic1 libmagic-dev pkg-config

      - run: |
          which pkg-config
          pkg-config --version

      - run: ls $(pkg-config --variable=libdir libmagic)/libmagic*

      - run: pkg-config --debug --validate libmagic

      - run: |
          pkg-config --static --libs --cflags libmagic
          pkg-config --libs --cflags libmagic
  macos:
    runs-on: macos-12

    steps:
      - run: |
          brew update
          brew install libmagic pkg-config

      - run: |
          which pkg-config
          pkg-config --version
          brew --version

      - run: ls $(pkg-config --variable=libdir libmagic)/libmagic*

      - run: pkg-config --debug --validate libmagic

      - run: |
          pkg-config --static --libs --cflags libmagic
          pkg-config --libs --cflags libmagic

  windows:
      runs-on: windows-2022
      env:
        VCPKG_BINARY_SOURCES: clear;x-gha,readwrite

      steps:
        - uses: actions/github-script@v6
          with:
            script: |
              core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
              core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');

        - run: |
            vcpkg update
            vcpkg install libmagic

        - run: |
            vcpkg version

        - run: |
            vcpkg search libmagic
            vcpkg depend-info libmagic

While this did not actually test a build of magic-sys (with neither pkg-config nor (cargo) vcpkg, it looks like at least GHA should be able to build with a hard requirement on

  • pkg-config (on Linux, macOS)
  • vcpkg (on Windows)
  • libmagic >= 5.39

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions