-
-
Notifications
You must be signed in to change notification settings - Fork 340
turn pkg-config into a package #869
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
Conversation
|
Building in pkg is not recommended if not necessary. Generally, the build things should be library type. Because we already support building from source and releasing weekly, there's no need to modify existing code. Simply modify the dependencies and install the package in Doctor with one click. |
# Conflicts: # src/globals/test-extensions.php
|
We're keeping it in lib.json and in unix/library/pkgconfig too? What's the point in erroring out if it's not found then? |
Yeah, since we still need a location to build own pkg-config, I think the best option is to keep the current state. But for backward compatibility and to achieve this (avoid building pkg-config every time), downloading our existing pre-built content is decent.
You mean auto-fix in afterInit? |
| if (($found = PkgConfigUtil::findPkgConfig()) === null) { | ||
| throw new WrongUsageException('Cannot find pkg-config executable. Please run `doctor` to fix this.'); | ||
| } | ||
| GlobalEnvManager::putenv("PKG_CONFIG={$found}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes here, when it's still a library it could be automatically built if someone forgot to build it with the doctor fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't recommend building libraries in pkg; they should simply involve downloading and installing whenever possible.
As for the "auto-repair if pkg-config not found" in afterInit in GlobalEnv, I don't think it should be downloaded here, at least for now. People should run bin/spc doctor in new environments anyway.
But I think we could package the pkg-config prebuilt binary into a single spc file, automatically extracting it to pkgroot/bin if it's not found there. And then do this in the setup-runtime method, since it's always required to be installed.
What does this PR do?
Checklist before merging
*.phpor*.json, run them locally to ensure your changes are valid:composer cs-fixcomposer analysecomposer testbin/spc dev:sort-configsrc/globals/test-extensions.php.extension testortest extensionsto trigger full test suite.