GitLab has been upgraded to 13.7.4 If you encounter any issues mail

Commit 6a7e6b2b authored by Ben Avison's avatar Ben Avison

Fix pipeline failures for established forks

If the following happens:
* a GitLab runner recursively clones a superproject
* one or more submodules has changes upstream and the submodule references in
  the superproject have been updated to point to it
* a new pipeline is launched for the new superproject revision

then, while the runner would fetch changes to the superproject, it wasn't
doing so for the submodules. Ironically, we do both `git submodule update`
and `git submodule update --remote` in different pipeline stages and the
latter includes an implicit submodule fetch - but that was the later stage
which we don't get as far as.

To fix this, while retaining the pipeline stage order, include an explicit
fetch in the earlier stage (and remove the implicit fetch in the later one,
since that now merely wastes time).
parent 9c61e2f0
Pipeline #693 failed with stage
in 3 seconds
......@@ -144,10 +144,12 @@ function do_superproject_class(build_class) {
print " before_script:" >> out
print " # Runner only cleans superproject by default - explicitly clean submodules" >> out
print " - git submodule foreach 'git clean -xdf && git checkout -f'" >> out
if (types[t] == "snapshot")
if (types[t] == "snapshot") {
print " - git submodule foreach 'git fetch origin'" >> out
print " - git submodule update --init --jobs 8" >> out
else # types[t] == "latest"
print " - git submodule update --init --remote --jobs 8" >> out
print " - git submodule update --init --remote --no-fetch --jobs 8" >> out
print " # Tweaks are required to several components to permit cross-compilation, but are currently stuck in review." >> out
print " # Pull them into the source tree explicitly (note that this assumes they are all in bavison's fork projects, which is true at time of writing)." >> out
print " # Eventually we should be able to remove this line entirely, which will speed up builds a lot." >> out
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment