-
Notifications
You must be signed in to change notification settings - Fork 1
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
Improve gRPC patchfile handling #47
Conversation
9730967
to
fd28b29
Compare
fd28b29
to
36441d5
Compare
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.
LGTM
36441d5
to
604425a
Compare
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.
Do we plan to update the scripts for building dependencies to include the option of specifying GRPC_PATCHFILE ? Also, add documentation that it should be available in cmake/patches directory and on how to do it when building using cmake cmdline?
No. GRPC_PATCHFILE is a static mechanism, not a dynamic mechanism. The maintainer defines the As I noted in my response to Sabeel, this variable is not intended to be set from the command line. It's a component property, like |
- Define a "patchfile" property in the components file. Update components.py to support it. - Provide three ways to determine the gRPC patch file: 1. Explicitly specified by the GRPC_PATCHFILE cmake variable (per the "patchfile" component property). This allows the patchfile to be independent of the gRPC version number. 2. Implicitly derived from the GRPC_VERSION cmake variable (per the "version" component property). This provides backward compatibility with the current mechanism. 3. Implicitly specified by a grpc-current.patch.in` symlink in the `patches` folder. This allows an outside process to apply the current patch without knowing the gRPC version. - Make a failure to find the patch file a non-fatal error. Signed-off-by: Derek G Foster <[email protected]>
- Modify define_grpc_patch_clause() to return an empty string if define_grpc_patch_file() returns an empty string. - Improve internal documentation. Signed-off-by: Derek G Foster <[email protected]>
bdf5f05
to
312677f
Compare
@nupuruttarwar - Rereading your comment, I realized that I didn't really address your second question. The existing documentation is in How to create a gRPC patch file. To define "grpc": {
"name": "grpc",
"url": "https://github.com/google/grpc.git",
"sha": "883e5f76976b86afee87415dc67bde58d9b295a4",
"tag": "v1.59.2",
"version": "1.59.2",
"defines": {
"PATCHFILE": "custom.patch"
}
}, Then run ./scripts/components.py -o cmake/deps.cmake Which produces the following: set(GRPC_GIT_URL "https://github.com/google/grpc.git")
set(GRPC_GIT_TAG "883e5f76976b86afee87415dc67bde58d9b295a4") # v1.59.2
set(GRPC_VERSION "1.59.2")
set(GRPC_PATCHFILE "custom.patch") I implemented the We need documentation on |
Define a "patchfile" property in the components file. Update components.py to support it.
Provide three ways to determine the gRPC patch file:
Explicitly specified by the
GRPC_PATCHFILE
cmake variable (per the "patchfile" component property). This allows the patch file to be independent of the gRPC version number.Implicitly derived from the
GRPC_VERSION
cmake variable (per the "version" component property). This provides backward compatibility with the current mechanism.Implicitly specified by a
grpc-current.patch.in
symlink in thepatches
folder. This allows an outside process to apply the patch without knowing the gRPC version.Refactor patchfile handling into two functions:
define_grpc_patch_file()
, which selects the template file to use.define_grpc_patch_clause()
, which generates the patchfile from the template and defines the patch clause.Make the path to the patch file explicitly relative to the top-level directory (
CMAKE_SOURCE_DIR
) rather than implicitly relative togrpc.cmake
. This mitigates the "patch file not found" error in the MEV build.If we are unable to apply to apply the gRPC patch, the worst outcome is that the RUNPATH of the gRPC plugins won't be updated, and the user will have to set LD_LIBRARY_PATH. This is (a) suboptimal rather than fatal, and (b) moot because this version of the Stratum dependencies breaks RPATH anyway. Make the messages WARNINGs rather than FATAL_ERRORs.
Correct the version number in the header comment of the gRPC v1.59.2 patch file.