Skip to content
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

Add KDSME as submodule for CI testing #905

Merged
merged 1 commit into from
Apr 4, 2024
Merged

Conversation

dantti
Copy link
Member

@dantti dantti commented Jan 3, 2024

No description provided.

@dantti dantti force-pushed the dantti/kdsme_submodule branch 5 times, most recently from 6abf61f to fc44db5 Compare January 3, 2024 22:29
@dantti dantti force-pushed the dantti/kdsme_submodule branch from fc44db5 to 0e7b8c2 Compare January 5, 2024 15:02
Copy link
Contributor

@winterz winterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few nitpicks. otherwise looks good

@dantti dantti force-pushed the dantti/kdsme_submodule branch from 0e7b8c2 to 8953e06 Compare January 5, 2024 15:12
Copy link
Contributor

@winterz winterz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please change GAMMARAY_WITH_KSME to GAMMARAY_WITH_KDSME everywhere

@dantti dantti force-pushed the dantti/kdsme_submodule branch from 8953e06 to fd9a93a Compare January 5, 2024 15:19
Comment on lines -61 to +50
find_package(${KDSME_PACKAGE_NAME} 1.2 CONFIG QUIET)

# UI part
if(GAMMARAY_BUILD_UI AND ${KDSME_PACKAGE_NAME}_FOUND)
if(GAMMARAY_BUILD_UI AND GAMMARAY_WITH_KDSME)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the ability to use a KDSME package installed separately on the system, doesn't it? Since find_package() is no longer even attempted, even if KDSME is installed, it won't be used — the submodule is the only option. And if the .git directory isn't present (e.g. package releases), there's no way to make it use a KDSME at all.

Distro packagers won't like that, for one. ...Unless I'm completely missing something?

Copy link
Contributor

@ferdnyc ferdnyc Jan 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FTR, my suggestion would be to keep the find_package(), but insert a condition to trigger the submodule stuff:

if(NOT ${KDSME_PACKAGE_NAME}_FOUND AND GAMMARAY_WITH_KDSME)

Maybe even change the option name to GAMMARAY_USE_INTERNAL_KDSME or something.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it breaks, I did that because of the includes.

  • We could include it on releases, remove/disable the git submodule check, and would also make more sense to static link to it.
  • Another option would be to #ifdef the includes
  • Fix KDSME includes, which isn't trivial
    @winterz @Waqar144 thoughts?

Copy link
Contributor

@ferdnyc ferdnyc Jan 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A fourth option:

  • Keep the submodule, but instead of using it in the build with add_subdirectory(), have the CI build-and-install KDSME from there before it configures GammaRay. Then pick it up with find_package() as usual.

The built KDSME could even be added to the GitHub cache, to speed things up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or, in fact, you could use FetchContent to incorporate the submodule'd KDSME — with CMake 3.24+, if you give FetchContent_Declare() a FIND_PACKAGE_ARGS argument, it'll automatically automatically try a find_package() first, and use the installed package if it's found.

(FetchContent_Declare() doesn't have to download it from a remote repo. Like ExternalProject_Add(), you can give it a SOURCE_DIR argument with the path to existing sources.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FetchContent doesn't solve the include issue, it's just a little better ExternalProject_Add() but we are avoiding it in favor of submodules.

@dantti dantti force-pushed the dantti/kdsme_submodule branch from fd9a93a to 02f7f6a Compare January 7, 2024 22:29
@winterz
Copy link
Contributor

winterz commented Apr 4, 2024

the distro packagers won't care because the released tarball will include the submodule. If I do things correctly when I make the release

the point is : graphviz is wildly different on all supported platforms and we can't keep chasing the different API

@winterz winterz merged commit 77bd2cb into master Apr 4, 2024
12 checks passed
@dantti dantti deleted the dantti/kdsme_submodule branch April 4, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants