[Concept] CI: Use ln -sf to avoid failure on existing symlinks

Message ID 20260326231329.321882-1-sjg@u-boot.org
State New
Headers
Series [Concept] CI: Use ln -sf to avoid failure on existing symlinks |

Commit Message

Simon Glass March 26, 2026, 11:13 p.m. UTC
  From: Simon Glass <sjg@chromium.org>

The before_script creates symlinks for the qemu_arm64_lwip config and
for mapping the runner hostname to the travis-ci directory. With plain
ln -s, these fail if the symlinks already exist from a cached workspace
or a previous job, causing intermittent INTERNALERROR failures in pytest.

Use -sf for file symlinks and -sfn for directory symlinks to overwrite
any stale entries.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 .gitlab-ci.yml | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 03153ea505f..3ca5a62b877 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -64,10 +64,10 @@  stages:
     - git config --global --add safe.directory "${CI_PROJECT_DIR}"
     # qemu_arm64_lwip_defconfig is the same as qemu_arm64 but with NET_LWIP enabled.
     # The test config and the boardenv file from qemu_arm64 can be re-used so create symlinks
-    - ln -s conf.qemu_arm64 test/hooks/bin/travis-ci/conf.qemu_arm64_lwip_na
-    - ln -s u_boot_boardenv_qemu_arm64_na.py test/hooks/py/travis-ci/u_boot_boardenv_qemu_arm64_lwip_na.py
-    - ln -s travis-ci test/hooks/bin/`hostname`
-    - ln -s travis-ci test/hooks/py/`hostname`
+    - ln -sf conf.qemu_arm64 test/hooks/bin/travis-ci/conf.qemu_arm64_lwip_na
+    - ln -sf u_boot_boardenv_qemu_arm64_na.py test/hooks/py/travis-ci/u_boot_boardenv_qemu_arm64_lwip_na.py
+    - ln -sfn travis-ci test/hooks/bin/`hostname`
+    - ln -sfn travis-ci test/hooks/py/`hostname`
     - if [[ "${TEST_PY_BD}" == "qemu-riscv32_spl" ]] || [[ "${TEST_PY_BD}" == "xilinx_mbv32_smode" ]]; then
         wget -O - https://github.com/riscv-software-src/opensbi/releases/download/v1.3.1/opensbi-1.3.1-rv-bin.tar.xz | tar -C /tmp -xJ;
         export OPENSBI=/tmp/opensbi-1.3.1-rv-bin/share/opensbi/ilp32/generic/firmware/fw_dynamic.bin;