Open christianrauch opened 4 months ago
I'm largely unfamiliar with building via flatpaks, but I do understand they are generally preferred over appimages for security & versioning/updating reasons. Do other repos that build with flatpak just not let cmake handle dependencies at all? I believe @DonLakeFlyer generally prefers to use submodules too.
One of the reasons I was in favor of using cmake to handle dependencies was because it's really easy to separate dependencies based on platform (which is nice because we started running out of space in the github CI builds). Also, how would you handle the parts where you get dependencies from somewhere other than github? One example being that cmake downloads gstreamer stuff during the build. I did intend on changing the FetchContent command to use FIND_PACKAGE_ARGS
to find installed versions of dependencies at some point, so that could be a solution to geographiclib at least.
Do other repos that build with flatpak just not let cmake handle dependencies at all?
Yes. At least for flathub, all builds run in a sandbox that prevents network access etc. during the build. All sources have to be specified before the build.
Also, how would you handle the parts where you get dependencies from somewhere other than github?
I am not entirely sure what you mean. If you add subprojects as submodules, you can add any remote repo, not just those from github.com. Other dependencies can usually be installed with platform-specific package managers (apt, dnf, brew, vcpkg, ...). Finally, you can always install dependencies from source. The latter is what is usually done for flatpaks.
This also breaks gentoo live builds. Network access during configure phase is always disabled for security reasons.
I believe @DonLakeFlyer generally prefers to use submodules too.
Submodules would be the preferred way.
One of the reasons I was in favor of using cmake to handle dependencies was because it's really easy to separate dependencies based on platform (which is nice because we started running out of space in the github CI builds).
That could be a problem. Maybe different branches for each platform could solve this. Not sure.
Also, how would you handle the parts where you get dependencies from somewhere other than github?
As long as dependencies use git, other sources besides github should be no problem.
btw. this affects all sources fetched by cmake.
FetchContent shouldn't attempt to download, if the submodule has already been fetched. It should (silently) succeed.
That way it would work without git fetch
'ing all submodules (i.e. non-recursive clone).
To avoid a cluttered CI environment, maybe submodules could then be git fetch
'd manually or filtered with some approach like: https://stackoverflow.com/questions/56745097/exclude-submodule-of-a-submodule
I will look into this once the custom build stuff is done. I believe we only have one submodule that doesn't use git but it's for Android only (this was actually my intended question rather than GitHub, but I realized it doesn't matter if it's not Linux). Maybe there's some setup where we can leave all the other build platforms alone besides linux
The build process uses
FetchContent_Declare
to download additional sources during the build process, instead of git submodules. Some packaging processes, such as snap and flatpak, run builds in a sandbox and prevent; and some (Debian) discourage network access during build time and expect all sources to be available before the build.On
master
, theadd_subdirectory(Geo)
tries to fetchhttps://github.com/geographiclib/geographiclib.git
during the build, which causes build issues on flatpak:Would it be possible to add
geographiclib
as a submodule to the git project in order to allow builds in sandboxed/isolated environments?