support-expressions: Add support expressions to features. Error when supports expression evaluates to false in classic and manifest mode.#184
Conversation
cace755 to
617ae0e
Compare
strega-nil-ms
left a comment
There was a problem hiding this comment.
So, I love this change; this would make my experience using vcpkg so much better.
However, I think there needs to be an escape hatch; some kind of "please ignore supports expressions for this install". Additionally, I think it's very likely that we should start by printing warnings instead of errors, since otherwise we will cause breakage on people installing over-constrained packages.
So far, though, this looks amazing. Thank you so much for your work here @autoantwort!
I have checked some random ports, and the supports expression was almost always back upped by a But an additional option is needed to disable the failure. |
|
I have added such an option now |
d2b65d8 to
a2d563f
Compare
a2d563f to
3c31af7
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…supports expression evaluates to false in classic and manifest mode.
Co-authored-by: nicole mazzuca <83086508+strega-nil-ms@users.noreply.github.com>
39fde2c to
f1812a8
Compare
|
I assume a approval from @ras0219-msft is also needed? |
|
Given two yesses, merging now. Thanks @autoantwort :D |
|
@autoantwort Is this actually supposed to work? Cause I added a While It gets more explicit when using |
|
Yes, but this tool version is currently not in the vcpkg repo, only after microsoft/vcpkg#20838 |
I compiled vcpkg tool myself, using both |
|
Maybe you are missing a git pull. I can add |
But this seems to be a bug |
Would be fixed by #240 |
| if (!supports_expression.get()->evaluate( | ||
| m_var_provider.get_dep_info_vars(spec.spec()).value_or_exit(VCPKG_LINE_INFO))) | ||
| { | ||
| const auto msg = Strings::format("%s[%s] is only supported on '%s'", |
There was a problem hiding this comment.
I strongly against this changes!
Since our document does not specify whether to use a whitelist or a blacklist for the supports field, this modification will cause many ports to fail to build on the community triplet.
Please note that this field is only used for pipeline test to judge whether the result is reasonable.
There was a problem hiding this comment.
Support expressions supports black and whitelists. For example !windows is a blacklist while osx & linux is a whitelist. But yeah we should suggest using blacklists to not fail on community triplets unless we know that a port really only works the given set of triplets.
Please note that this field is only used for pipeline test to judge whether the result is reasonable.
Until this PR. Now it can replaces vcpkg_fail_port_install calls to get a better user experience. You don't have to build all dependencies to see that the port does not support your triplet.
If a port is generally supported by a triplet but our ci don't want to build it, you should use ci.baseline.txt because the port in general supports the triplet.
There was a problem hiding this comment.
Please note that this field is only used for pipeline test to judge whether the result is reasonable.
The intent is that ci.baseline.txt is the 'specific to our pipelines' thing, while supports reflects behavior from the upstream sources.
There was a problem hiding this comment.
Therefore, I suggest changes this error to warning message unless we convert all whitelist to blacklist.
There was a problem hiding this comment.
This also breaks option --only-downloads and --keep-going.
There was a problem hiding this comment.
And this doesn't exists in the usage info.
There was a problem hiding this comment.
And this doesn't exists in the usage info.
I don't understand that point.
There was a problem hiding this comment.
I don't understand that point.
This option should be printed in the usage info if we need to add it:
PS F:\vcpkg> .\vcpkg.exe depend-info vtk[*] --allow-unsupported
Unknown option(s) for command 'depend-info':
'--allow-unsupported'
Example:
vcpkg depend-info sqlite3
Options:
--dot Creates graph on basis of dot
--dgml Creates graph on basis of dgml
--show-depth Show recursion depth in output
--max-recurse=... Set max recursion depth, a value of -1 indicates no limit
--sort=... Set sort order for the list of dependencies, accepted values are:
lexicographical, topological (default), reverse
--triplet=<t> Specify the target architecture triplet. See 'vcpkg help triplet'
(default: %VCPKG_DEFAULT_TRIPLET%)
--host-triplet=<t> Specify the host architecture triplet. See 'vcpkg help triplet'
(default: %VCPKG_DEFAULT_HOST_TRIPLET%)
--overlay-ports=<path> Specify directories to be used when searching for ports
(also: %VCPKG_OVERLAY_PORTS%)
--overlay-triplets=<path> Specify directories containing triplets files
(also: %VCPKG_OVERLAY_TRIPLETS%)
--binarysource=<path> Add sources for binary caching. See 'vcpkg help binarycaching'
--x-asset-sources=<path> Add sources for asset caching. See 'vcpkg help assetcaching'
--downloads-root=<path> Specify the downloads root directory
(default: %VCPKG_DOWNLOADS%)
--vcpkg-root=<path> Specify the vcpkg root directory
(default: %VCPKG_ROOT%)
--x-buildtrees-root=<path> (Experimental) Specify the buildtrees root directory
--x-install-root=<path> (Experimental) Specify the install root directory
--x-packages-root=<path> (Experimental) Specify the packages root directory
--x-json (Experimental) Request JSON output
|
|
@autoantwort I think there's some issue with it in CI/CD. Specifically, in microsoft/vcpkg#21491 I added: However, it appears that because of it the Windows CI/CD now skips the |
|
No e2e test for this? |
|
IMHO dependencies' features should be enabled only on systems that support it. |
Note that the skip is not because libmount is part of the default features of kf5solid, but because libmount is part of the features requested by depending port kf5io, unconditionally. |
|
Which means the immediate fix is to add a supports clause to |
Fixes microsoft/vcpkg#17651