-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[build] Use a submodule for mapbox-gl-js rather than an npm dependency #7513
Conversation
@jfirebaugh, thanks for your PR! By analyzing this pull request, we identified @tmpsantos, @incanus and @mourner to be potential reviewers. |
See in particular #5249 (comment) for the rationale here. @kkaefer @tmpsantos @1ec5 Any reservations about testing this out for a few days? |
I think it should be OK. We’re still using npm on the release-ios-v3.4.0 branch, which is going to be active for the next few weeks, with periodic merges back to master. It just means we have to be careful not to accidentally bring a submodule change along for the ride as we perform merges. |
6d28318
to
5c7d3e7
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.
Thanks a lot for that!
No problem at all. Regarding the CI caching issue we could have a checkout of the repo on the travis cache directory and copy it to the submodule location on the travis shell script. |
if(NOT EXISTS "mapbox-gl-js/package.json") | ||
execute_process( | ||
COMMAND git submodule update --init mapbox-gl-js | ||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}) |
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.
Can we try using externalproject_add
with the GIT_SUBMODULES
setting instead?
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.
I wasn't able to get this to work. It looks to me like the GIT_SUBMODULES
option is for initializing submodules of the external project, rather than using a submodule as the method to obtain the external project itself.
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.
I've been playing with externalproject_add
for a while on the CMake build I'm maintaining for building Mapbox GL Native 100% offline and for Qt + Windows. On the build file for predownloading all of our dependencies I'm doing something like:
include(ExternalProject)
# Macro for cloning and downloading our header-only dependencies
macro(add_dep package tag git)
externalproject_add(${package}
URL https://github.com/${git}/archive/${tag}.zip
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
add_dependencies(mbgl-core ${package})
externalproject_get_property(${package} SOURCE_DIR)
target_include_directories(mbgl-core PRIVATE ${SOURCE_DIR}/include)
target_include_directories(qmapboxgl PRIVATE ${SOURCE_DIR}/include)
set(${package}_SOURCE_DIR ${SOURCE_DIR})
endmacro()
Two things: It is a lot faster to get the tarball rather then cloning the repo and CMake will try to configure + build + install, but you can override it.
2b80772
to
5c7d3e7
Compare
5c7d3e7
to
5446520
Compare
Refs #5249