Skip to content

fix: symbolic linking (ln -s) with pre-existing installation#1135

Merged
marcoesters merged 5 commits into
conda:mainfrom
dlaehnemann:patch-1
Dec 15, 2025
Merged

fix: symbolic linking (ln -s) with pre-existing installation#1135
marcoesters merged 5 commits into
conda:mainfrom
dlaehnemann:patch-1

Conversation

@dlaehnemann

@dlaehnemann dlaehnemann commented Dec 11, 2025

Copy link
Copy Markdown
Contributor

Description

This is an issue we came across very far downstream, when using the setup-miniconda GitHub Action in multiple steps of the same GitHub Actions job implicitly (through the snakemake GitHub Action that uses it, which we use for two subsequent steps).

Basically, the during first use of the snakemake GitHub Action, setup-miniconda installs miniforge without any issues. During the second install, it throws this error:

Running installer...
  /usr/bin/bash /home/runner/work/_temp/e83768cc-2602-4a3d-a62b-6a1cc1af9dd4.sh -f -b -p /home/runner/miniconda3
  PREFIX=/home/runner/miniconda3
  Unpacking bootstrapper...
  Warning: ln: failed to create symbolic link '/home/runner/miniconda3/_conda': File exists
  
  ln: failed to create symbolic link '/home/runner/miniconda3/_conda': File exists
Error: The process '/usr/bin/bash' failed with exit code 1

Finding out where that linking actually happens, so where the installers actually take their script code from, was a bit of treasure hunt. But here we are. The code I am suggesting to modify was only recently added in #1090 and thus seems very likely to be the cause of this. But if this forcing of the symlinking does not look like the correct fix to you, I'd be glad to stand corrected.

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@dlaehnemann
dlaehnemann requested a review from a team as a code owner December 11, 2025 11:42
@github-project-automation github-project-automation Bot moved this to 🆕 New in 🔎 Review Dec 11, 2025
@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Dec 11, 2025
@dlaehnemann

Copy link
Copy Markdown
Contributor Author

I'm not sure if it makes sense to add a test case for this and whether this would need to be here, or rather somewhere downstream (e.g. miniforge?). It would basically mean running an installer twice, to ensure the installer works, even if a version of conda already exists...

@dlaehnemann

Copy link
Copy Markdown
Contributor Author

Pinging @marcoesters , as he reviewed the pull request #1090 that brought in this code.

@marcoesters

Copy link
Copy Markdown
Contributor

I'm not sure if it makes sense to add a test case for this and whether this would need to be here, or rather somewhere downstream (e.g. miniforge?). It would basically mean running an installer twice, to ensure the installer works, even if a version of conda already exists...

I agree that this is niche, especially since the -f flag rather brittle. I'm okay with not having a specific test here.

Comment thread news/1135-fix-symbolic-linking Outdated

@marcoesters marcoesters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Approved in 🔎 Review Dec 15, 2025
@marcoesters
marcoesters enabled auto-merge (squash) December 15, 2025 20:36
@marcoesters
marcoesters merged commit a707971 into conda:main Dec 15, 2025
14 of 15 checks passed
@github-project-automation github-project-automation Bot moved this from ✅ Approved to 🏁 Done in 🔎 Review Dec 15, 2025
@dlaehnemann
dlaehnemann deleted the patch-1 branch December 15, 2025 20:58
@dlaehnemann

Copy link
Copy Markdown
Contributor Author

Perfect, that was quick. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants