forked from grackle-project/grackle
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Proposing CMake Build-System Updates #1
Open
mabruzzo
wants to merge
25
commits into
ChristopherBignamini:main
Choose a base branch
from
mabruzzo:GTest
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,585
−143
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It now also deletes the build directory.
In more detail, I added support for bundling the version of libgrackle used while building the Cython extension module into the resulting python package. - Historically, when we would build the Cython extension module, the linking step would link against the copy of libgrackle.so that was found in the build-tree. Then at runtime, when python loaded the shared library (representing the extension module), the linker would search for libgrackle in `LD_LIBRARY_PATHS` and in the system library directories. - As a consequence of this behavior, any time you wanted to rebuild the python module with a newer grackle version, you had to overwrite your "installation" of libgrackle. Given that the grackle test-suite can only be executed with pygrackle, this behavior can sometimes be undesirable - This commit adds support for packaging the a copy of the libgrackle shared library from the build-tree directly into the resulting package (in this scenario, the extension module will always use that particular version of libgrackle). - To specify which choice to use, assign the `PYGRACKLE_PACKAGE_LOCALLIB` environment variable a value of 0 or 1, before building pygrackle.
This commit modifies the `setup.py` script to be able to build the pygrackle python package against versions of libgrackle that were compiled with the CMake build system.
…om the main Makefiles.
…s. Autogeneration should now be a lot more transparent.
…command rather than the config/configure_file.py script
This was achieved by tweaking `doc/source/conf.py`. This triggered a few cascading changes: 1. I needed to rename `config/query-version.py` to `config/query_version.py` so that it's contents could be properly imported 2. I needed to slightly tweak the internals of `config/query_version.py` so that the function returned values (instead of directly printing the value). To reflect this change in behavior, I changed a function name from `show_version` to `query_version` 3. While doing this, I also fixed a bug in some functionality from `config/query_version.py` that was intended to strip off a trailing '\n' character from the result of a shell command. In some cases, a trailing line-break might not be present and the functionality accidentally striped off a different character instead. 4. I needed to adjust a path in `src/clib/Makefile` to reflect the new name of the `config/query_version.py` script
This commit adds capabilities to perform a basic installation with CMake. It also adopts a policy consistent with the older build-system for naming shared libs (and making symbolic links). This policy is a little unidiomatic, but it is probably a better strategy than what idiomatic CMake could produce (given that we don't support ABI compatability)
Previously, we also included a bunch of extra improvements. I definitely think those would be useful. But this should make the cmake PR a lot easier to review
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Following up on our discussion from grackle-project#193, I wanted to suggest some changes to help reconcile the difference between our implementations of the cmake build-system (as a reminder, my version is found in grackle-project#182).
As I've previously mentioned, I think the stuff that you are doing is fantastic, and I definitely don't want to get in the way of your progress (if it's more convenient for you, we can always put off dealing with these differences until a later date).
Overview
I'll now provide some basic details about the changes I am proposing here. There are 2 parts of this changeset that are worth highlighting:
config/*.py
files come from.GRACKLE_
Grackle::Grackle
(this is standard convention for names of imported targets)BUILD_SHARED_LIB
variabletestable_grackle
target should now be used for building unit tests (this is functionally identical to the mainGrackle::Grackle
target -- it just exposes an extra macro definitions necessary for some unit test)Let me know if you are unhappy with any of these changes. I'm happy to iterate.
Other stuff
The changes to website-documentation that I added here are somewhat outdated (i.e. it presents cmake as a secondary build-system that supplements the older classic build system). You should probably just ignore it for now. I need to update that more, but I didn't want that to delay me from proposing this changeset.
For better or worse, I also reintroduced files associated with the old build-system
Out of curiosity, how do you typically invoke the unit-tests and functional-tests? (While I've worked with Google Test, I've never used it with CMake before). I would love to add these tests to the continuous integration file.
Closing Thoughts
Honestly, the number of files changed may seem a little overwhelming. If I were you, I would just focus on the changes to the cmake files. Most of the remaining changes relate to reintroducing old build-system files.
Again, I want to re-emphasize, that I want to make this all as easy for you as possible.
Let me know if there's something that I can do to help with this process
test_implementation
instead I can do that