Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use /mingw64 as default prefix on MSYS2/MinGW64 #245

Open
mgeier opened this issue Jan 10, 2022 · 4 comments
Open

Use /mingw64 as default prefix on MSYS2/MinGW64 #245

mgeier opened this issue Jan 10, 2022 · 4 comments

Comments

@mgeier
Copy link
Contributor

mgeier commented Jan 10, 2022

Currently, the --prefix has to be specified explicitly:

cargo cinstall --verbose --release --prefix /mingw64 --target x86_64-pc-windows-gnu

It would be great if /mingw64 could be used as default on MSYS2/MinGW64, since /usr/local doesn't seem to be searched by default.

@lu-zero
Copy link
Owner

lu-zero commented Jan 10, 2022

it requires to know that you are in mingw64 reliably and I'm afraid it is not straightforward, but if you come up with a patch for it I'd be happy to merge it. :)

@mgeier
Copy link
Contributor Author

mgeier commented Jan 12, 2022

I have no idea, but I hope that somebody will come up with a solution eventually!

@kmilos
Copy link

kmilos commented Dec 28, 2022

FWIW, when packaging for MSYS2, we always have to specify the prefix explicitly, as there are many MinGW environments, not just /mingw64...

/ucrt64 is the new default btw, but don't know if that affects the setup-msys2 action defaults yet - if it does, you can't be installing mingw-w64-x86_64-* packages explicitly in your workflow above (without specifying your msystem is mingw64), it is much better to use the pacboy route and install e.g. agnostic rust:p which will pick the package for the matching environment...

If you're inside a MSYS2 shell (like the setup-msys2 action should be), one just uses $MINGW_PREFIX (w/ MSYS2_ARG_CONV_EXCL so it doesn't get converted to an absolute DOS path).

So parts of your action would ideally be something like:

      - name: Install MSYS2
        uses: msys2/setup-msys2@v2
        with:
          msystem: ucrt64
          install: >-
            make
          pacboy: >-
            pkg-config:p
            rust:p

This makes it easy to switch/add more msystems to the CI matrix.

And finally

      - name: Install C API for example project
        working-directory: example-project
        run: |
          MSYS2_ARG_CONV_EXCL="--prefix=" \
            cargo cinstall --verbose --release --prefix=${MINGW_PREFIX}

I'd remove the --target because that one should be figured out automatically, no? This should make this step completely agnostic of the chosen msystem...

Ideally, you'll want to add a matrix to also test e.g. clangarm64 eventually as well (no runners available just yet), so please add support for aarch64-pc-windows-gnullvm to cargo-c ;) @lu-zero

@lu-zero
Copy link
Owner

lu-zero commented Dec 28, 2022

If you can provide a patch for it and a ci item to test it would be great :)

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

No branches or pull requests

3 participants