From 4b237349a32798bbdfd55e8c41f9d79180ce2cf2 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 25 Oct 2022 12:27:13 +0200 Subject: [PATCH] Remove recursive symbolic link in lib/spack/docs from git repository (#33483) Delete code removing the symlink during CI --- .github/workflows/unit_tests.yaml | 3 --- .github/workflows/windows_python.yml | 2 -- lib/spack/docs/_spack_root | 1 - lib/spack/docs/conf.py | 3 +++ share/spack/qa/run-shell-tests | 6 ------ share/spack/qa/run-unit-tests | 4 ---- 6 files changed, 3 insertions(+), 16 deletions(-) delete mode 120000 lib/spack/docs/_spack_root diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index d2d267b516..1d84e5bfeb 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -221,9 +221,6 @@ jobs: $(which spack) unit-test --cov --cov-config=pyproject.toml "${common_args[@]}" coverage combine -a coverage xml - # Delete the symlink going from ./lib/spack/docs/_spack_root back to - # the initial directory, since it causes ELOOP errors with codecov/actions@2 - rm lib/spack/docs/_spack_root - uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 with: flags: unittests,macos diff --git a/.github/workflows/windows_python.yml b/.github/workflows/windows_python.yml index adb8344d94..5acc87af70 100644 --- a/.github/workflows/windows_python.yml +++ b/.github/workflows/windows_python.yml @@ -32,7 +32,6 @@ jobs: echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml cd spack dir - (Get-Item '.\lib\spack\docs\_spack_root').Delete() spack unit-test --verbose --cov --cov-config=pyproject.toml --ignore=lib/spack/spack/test/cmd coverage combine -a coverage xml @@ -58,7 +57,6 @@ jobs: run: | echo F|xcopy .\spack\share\spack\qa\configuration\windows_config.yaml $env:USERPROFILE\.spack\windows\config.yaml cd spack - (Get-Item '.\lib\spack\docs\_spack_root').Delete() spack unit-test --verbose --cov --cov-config=pyproject.toml lib/spack/spack/test/cmd coverage combine -a coverage xml diff --git a/lib/spack/docs/_spack_root b/lib/spack/docs/_spack_root deleted file mode 120000 index a8a4f8c212..0000000000 --- a/lib/spack/docs/_spack_root +++ /dev/null @@ -1 +0,0 @@ -../../.. \ No newline at end of file diff --git a/lib/spack/docs/conf.py b/lib/spack/docs/conf.py index 542a3d9024..1bdce87238 100644 --- a/lib/spack/docs/conf.py +++ b/lib/spack/docs/conf.py @@ -32,6 +32,9 @@ # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. +link_name = os.path.abspath("_spack_root") +if not os.path.exists(link_name): + os.symlink(os.path.abspath("../../.."), link_name, target_is_directory=True) sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external")) sys.path.insert(0, os.path.abspath("_spack_root/lib/spack/external/pytest-fallback")) diff --git a/share/spack/qa/run-shell-tests b/share/spack/qa/run-shell-tests index a300bee98b..465c68000e 100755 --- a/share/spack/qa/run-shell-tests +++ b/share/spack/qa/run-shell-tests @@ -56,9 +56,3 @@ fish "$QA_DIR/setup-env-test.fish" # run csh and tcsh tests csh "$QA_DIR/setup-env-test.csh" tcsh "$QA_DIR/setup-env-test.csh" - -# Delete the symlink going from ./lib/spack/docs/_spack_root back to -# the initial directory, since it causes ELOOP errors with codecov/actions@2 -if [[ "$COVERAGE" == "true" ]]; then - rm lib/spack/docs/_spack_root -fi diff --git a/share/spack/qa/run-unit-tests b/share/spack/qa/run-unit-tests index 2de6b6101d..478e582242 100755 --- a/share/spack/qa/run-unit-tests +++ b/share/spack/qa/run-unit-tests @@ -74,7 +74,3 @@ fi bash "$QA_DIR/test-env-cfg.sh" - -# Delete the symlink going from ./lib/spack/docs/_spack_root back to -# the initial directory, since it causes ELOOP errors with codecov/actions@2 -rm lib/spack/docs/_spack_root