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

DESTDIR: Meson's path handling differs from autoconf's on Windows #407

Open
zmughal opened this issue Nov 7, 2023 · 1 comment
Open

Comments

@zmughal
Copy link
Member

zmughal commented Nov 7, 2023

On Windows, Meson's path handling drops the drive letter from the prefix path when joining the DESTDIR with the prefix.

I have a work around that replaces the private Alien::Build::Util::_destdir_prefix function to make this work:

use Path::Tiny;
use Alien::Build::Util;

# Work around for Meson's `destdir_join` which drops the first part of
# the path when joining (this is the drive letter).
# See <https://github.com/mesonbuild/meson/blob/1.2.3/mesonbuild/scripts/__init__.py>.
*Alien::Build::Util::_destdir_prefix = sub {
  my($destdir, $prefix) = @_;
  $prefix =~ s{^/?([a-z]):}{}i if $^O eq 'MSWin32';
  path($destdir)->child($prefix)->stringify;
};

I'm not sure how to approach fixing this. Perhaps there can be a destdir_prefix_method property:

  • POSIX-ish / MinGW join (default): "D:/path/to/destdir" + "C:/foo/bar" ⇒ "D:/path/to/destdir/c/foo/bar"
  • Meson join: "D:/path/to/destdir" + "C:/foo/bar" ⇒ "D:/path/to/destdir/foo/bar"

Or just a callback.

@shawnlaffan
Copy link
Contributor

Possibly related to #227 (and #195) and #137.

The workaround for those was to write a temporary wrapper for pkg-config and use that. Not sure if Meson supports such an approach, though, or if it would work in any case.

zmughal added a commit to PerlAlien/Alien-Meson that referenced this issue Nov 9, 2023
See issue <PerlAlien/Alien-Build#407> for more information.
zmughal added a commit to PerlAlien/Alien-Meson that referenced this issue Nov 9, 2023
  - Add DESTDIR prefix hack. See issue <PerlAlien/Alien-Build#407>
    for more information. See <#15>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants