-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
[onnx] Add features to use ONNX build options #38879
Conversation
ports/onnx/portfile.cmake
Outdated
@@ -24,6 +24,8 @@ endif() | |||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | |||
FEATURES | |||
pybind11 BUILD_ONNX_PYTHON | |||
disable-exception ONNX_DISABLE_EXCEPTIONS | |||
disable-static-generation ONNX_DISABLE_STATIC_REGISTRATION |
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.
should probably be made a positive feature instead since it gives a shorter feature name.
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.
Good idea. I will change them
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.
Changed their names in 02fe04d
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.
Based on the discussion, the revert feature here may cause fail when it's being enabled by other ports (means NO ONNX_DISABLE_STATIC_REGISTRATION).
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.
Back to disable-static-registration
in f339729
(note disable-static-generation
was wrong name 😱 )
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.
Looks like it disables function, will enabling these two features cause failed for consumers? - do-not-use-features-to-control-alternatives-in-published-interfaces
Honestly. I didn't check deeply for the part because I haven't encountered build errors in my team. |
|
Sorry for being late. |
Note that there are three ports which currently depend on plain "onnx", i.e. implicitly with default features enabled. |
Yes. |
The point is that without updating the other ports, it is not possible to disable the feature when you use one of these ports. |
Understood. I can change the `static-generation` to
`disable-static-generation` if the part can cause some problem. Do you
think it's a better option?
…On Thu, May 30, 2024 at 2:27 PM Kai Pastor ***@***.***> wrote:
The point is that without updating the other ports, it is not possible to
disable the feature when you use one of these ports.
—
Reply to this email directly, view it on GitHub
<#38879 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADLSYE6JO5PEXVF32EAKWJ3ZE22DHAVCNFSM6AAAAABID2NBY2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMZYG4YDQOBSGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
--
*Profile*Facebook: fb.com/luncliff
GitHub: github.com/luncliff
LinkedIn: linkedin.com/in/dong-ha-park-171481229/
|
No. Non-additive features aren't accepted, for good reasons. |
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.
The revert feature may cause failure when it's being enabled by other ports (enable inverted feature static-registrationmeans
means NO ONNX_DISABLE_STATIC_REGISTRATION=0
).
It is probably the best to add "default-features": false to the other three ports.
This is a fragile workaround causes incompatibility in a case vcpkg install onnx[static-registrationmeans] onnxruntime
according to the discussion.
AFAIU: (A) can only be achieved by a default-enabled capability, like a default-feature. In vcpkg CI, we have both (A) and (B).
When you ask for failure, you get failure. Maybe the diagnostics could signal this early. The alternative is to not change anything and require triplet customization in order to use onnxruntime. |
For existing ports and vcpkg CI, Thankfully, |
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.
The port features installation tests pass with the following triplets:
- x64-windows
@dg0yt 's analysis in #38879 (comment) seems correct to me; I think this needs to be controlled with an overlay-port rather than features. |
Seems like no more comment. You can close the PR with the team's decision. |
Related: #36850 . The discussion of the features-as-alternatives problem appears to have been discussed there. |
### Description Changes vcpkg manifest and configuration file (vcpkg.json & vcpkg-configuration.json) * Update vcpkg version to https://github.com/microsoft/vcpkg/releases/tag/2024.12.16 * Use protobuf 3.21.12(= `v21.12`) to sync with [cmake/deps.txt](https://github.com/microsoft/onnxruntime/blob/main/cmake/deps.txt) * Resolve #22750 * Add `onnx` to vcpkg manifest so `find_package(ONNX)` and `find_dependency(Protobuf)` can work as expected. * Currently, It uses 1.16.2 * v1.17.0 will become available after microsoft/vcpkg#42942 However, `onnx` in vcpkg doesn't configure `ONNX_DISABLE_STATIC_REGISTRATION` build option. * microsoft/vcpkg#38879 * Create "cmake/vcpkg-triplets/" folder and triplet files which use `VCPKG_CMAKE_CONFIGURE_OPTIONS` for the option * This requires `VCPKG_OVERLAY_TRIPLETS` environment variable for CI steps, which is a bit inconvenient. I will try to find simple way to get same result ### Motivation and Context * Help #23158 * "ONNX is not consumed from vcpkg" * "Mismatch protobuf version. When vcpkg is enabled , we should not fetch protoc from Github which may cause version mismatches." * microsoft/vcpkg#43126 * #21348
### Description Changes vcpkg manifest and configuration file (vcpkg.json & vcpkg-configuration.json) * Update vcpkg version to https://github.com/microsoft/vcpkg/releases/tag/2024.12.16 * Use protobuf 3.21.12(= `v21.12`) to sync with [cmake/deps.txt](https://github.com/microsoft/onnxruntime/blob/main/cmake/deps.txt) * Resolve #22750 * Add `onnx` to vcpkg manifest so `find_package(ONNX)` and `find_dependency(Protobuf)` can work as expected. * Currently, It uses 1.16.2 * v1.17.0 will become available after microsoft/vcpkg#42942 However, `onnx` in vcpkg doesn't configure `ONNX_DISABLE_STATIC_REGISTRATION` build option. * microsoft/vcpkg#38879 * Create "cmake/vcpkg-triplets/" folder and triplet files which use `VCPKG_CMAKE_CONFIGURE_OPTIONS` for the option * This requires `VCPKG_OVERLAY_TRIPLETS` environment variable for CI steps, which is a bit inconvenient. I will try to find simple way to get same result ### Motivation and Context * Help #23158 * "ONNX is not consumed from vcpkg" * "Mismatch protobuf version. When vcpkg is enabled , we should not fetch protoc from Github which may cause version mismatches." * microsoft/vcpkg#43126 * #21348
### Description Changes vcpkg manifest and configuration file (vcpkg.json & vcpkg-configuration.json) * Update vcpkg version to https://github.com/microsoft/vcpkg/releases/tag/2024.12.16 * Use protobuf 3.21.12(= `v21.12`) to sync with [cmake/deps.txt](https://github.com/microsoft/onnxruntime/blob/main/cmake/deps.txt) * Resolve microsoft#22750 * Add `onnx` to vcpkg manifest so `find_package(ONNX)` and `find_dependency(Protobuf)` can work as expected. * Currently, It uses 1.16.2 * v1.17.0 will become available after microsoft/vcpkg#42942 However, `onnx` in vcpkg doesn't configure `ONNX_DISABLE_STATIC_REGISTRATION` build option. * microsoft/vcpkg#38879 * Create "cmake/vcpkg-triplets/" folder and triplet files which use `VCPKG_CMAKE_CONFIGURE_OPTIONS` for the option * This requires `VCPKG_OVERLAY_TRIPLETS` environment variable for CI steps, which is a bit inconvenient. I will try to find simple way to get same result ### Motivation and Context * Help microsoft#23158 * "ONNX is not consumed from vcpkg" * "Mismatch protobuf version. When vcpkg is enabled , we should not fetch protoc from Github which may cause version mismatches." * microsoft/vcpkg#43126 * microsoft#21348
### Description Changes vcpkg manifest and configuration file (vcpkg.json & vcpkg-configuration.json) * Update vcpkg version to https://github.com/microsoft/vcpkg/releases/tag/2024.12.16 * Use protobuf 3.21.12(= `v21.12`) to sync with [cmake/deps.txt](https://github.com/microsoft/onnxruntime/blob/main/cmake/deps.txt) * Resolve #22750 * Add `onnx` to vcpkg manifest so `find_package(ONNX)` and `find_dependency(Protobuf)` can work as expected. * Currently, It uses 1.16.2 * v1.17.0 will become available after microsoft/vcpkg#42942 However, `onnx` in vcpkg doesn't configure `ONNX_DISABLE_STATIC_REGISTRATION` build option. * microsoft/vcpkg#38879 * Create "cmake/vcpkg-triplets/" folder and triplet files which use `VCPKG_CMAKE_CONFIGURE_OPTIONS` for the option * This requires `VCPKG_OVERLAY_TRIPLETS` environment variable for CI steps, which is a bit inconvenient. I will try to find simple way to get same result ### Motivation and Context * Help #23158 * "ONNX is not consumed from vcpkg" * "Mismatch protobuf version. When vcpkg is enabled , we should not fetch protoc from Github which may cause version mismatches." * microsoft/vcpkg#43126 * #21348
Changes
Make the following CMake build options to features in vcpkg.json
https://github.com/onnx/onnx/blob/b86cc54efce19530fb953e4b21f57e6b3888534c/CMakeLists.txt#L27-L28
References
Checklist
./vcpkg x-add-version --all
and committing the result.