-
Notifications
You must be signed in to change notification settings - Fork 79
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
WIP: Never pick up Strawberry Perl's pkg-config as a valid implementation #165
base: master
Are you sure you want to change the base?
Conversation
Generally makes sense to me. Once this is confirmed to work and merged, I'll get a new release out. |
7d11dd1
to
4db1f48
Compare
Strawberry Perl places a `pkg-config.bat` into PATH that is written in Perl and is not intended to be used by third parties as a MinGW distribution. This wouldn't matter, except that Strawberry Perl is also included in Github CI images out of the box, in `PATH`, and it breaks everyone's CI jobs. This is already done by Meson and CMake: mesonbuild/meson#9384 https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9375 Fixes rust-lang#164
43c653f
to
9aa9377
Compare
I had to rework the code a bit, it had the following mistakes:
I also added some CI and now it looks like 1.30.0 doesn't contain I'll write a test for ignoring Strawberry Perl's pkg-config. |
I've not been following this PR so I don't have much context but do note that rustc considers this a security issue and deliberately avoids searching for executable things in the current directory. E.g. ripgrep had a CVE filed against it for this behaviour (see BurntSushi/ripgrep@229d1a8). |
I don't know how relevant that is for a build system, considering that when you execute However, while investigating all this, I found something very hilarious. Strawberry Perl's pkg-config is already not found by pkg-config-rs because Rust's It's all very broken, but also this PR is not needed... |
The exact rules can (and very likely will) change. Basically, in the pre-1.0 days it attempted to follow Linux rules. Except over time this became broken and fell back to |
Thanks for the explanation! I expect that this will change some day, so we should keep this PR around, but I don't know if we should merge code that actually does nothing today. Especially since this PR's purpose is to try to match what What I do think we should do is to merge a test that checks that Strawberry Perl pkg-config is not picked up. Anything beyond that would just be added maintenance burden. Honestly, I'm surprised that Rust's std decided to not learn from what other APIs are doing in this problem space, dooming itself to repeat everyone else's mistakes. We haven't even gotten to arguments yet — the API takes a list, but |
Strawberry Perl places a
pkg-config.bat
into PATH that is written in Perl and is not intended to be used by third parties as a MinGW distribution. This wouldn't matter, except that Strawberry Perl is also included in Github CI images out of the box, inPATH
, and it breaks everyone's CI jobs.This is already done by Meson and CMake:
mesonbuild/meson#9384
https://gitlab.kitware.com/cmake/cmake/-/merge_requests/9375
Fixes #164
This could've used the
which
crate, but we don't want dependent crates, so we do a manual search instead.WIP because I haven't tested this yet.