Commit b0f5da22 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜

gitlab: Fix cannot overwrite directory error when symlinking

GitLab doesn't wipe images entirely before reusing them across jobs.
It relies on the build scripts to not write outside the workdir.
However, we create symlinks outside of the workdir, which breaks in
weird ways.

Specifically, when ../../gstreamer/cerbero exists, `ln -sf` creates
../../gstreamer/cerbero/cerbero, which is wrong, but doesn't cause an
error. However, when the image is reused again after this,
../../gstreamer/cerbero/cerbero already exists, so `ln -sf` yields:

ln: ../../gstreamer/cerbero/cerbero: cannot overwrite directory

This is fixed in master after overhauling the scripts to never write
outside of workdir, but for 1.16 we need to hack it by not symlinking
if the target dir already exists.

Originally commited to the 1.16 branch in

The proper fix will be backported from master, but let's fix this
error in the meantime so it doesn't roadblock the 1.18 stable releases

Part-of: <!374>
parent 5421bfe6
Pipeline #220607 waiting for manual action with stages
in 34 seconds
......@@ -694,9 +694,9 @@ valgrind ges:
# Workaround build-tools having hardcoded internal path
- pwd
- mkdir -p ../../gstreamer
- ln -sf $(pwd) ../../gstreamer/cerbero
- test -e ../../gstreamer/cerbero || ln -sf $(pwd) ../../gstreamer/cerbero
- mkdir -p ../../${CI_PROJECT_NAMESPACE}
- ln -sf $(pwd) ../../${CI_PROJECT_NAMESPACE}/cerbero
- test -e ../../${CI_PROJECT_NAMESPACE}/cerbero || ln -sf $(pwd) ../../${CI_PROJECT_NAMESPACE}/cerbero
- rsync -aH ${CERBERO_HOST_DIR} .
- echo "home_dir = \"$(pwd)/${CERBERO_HOME}\"" >> localconf.cbc
- echo "local_sources = \"$(pwd)/${CERBERO_SOURCES}\"" >> localconf.cbc
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