Fall back to USERNAME env var in Singularity scratch path - #459
Closed
shitcoinsherpa wants to merge 1 commit into
Closed
Fall back to USERNAME env var in Singularity scratch path#459shitcoinsherpa wants to merge 1 commit into
shitcoinsherpa wants to merge 1 commit into
Conversation
Windows sets USERNAME instead of USER. Without this fallback, the scratch directory path defaults to "hermes" instead of the actual username when running on Windows.
Contributor
|
Closing this — Singularity/Apptainer is a Linux/HPC container technology and won't be run on Windows. The |
This was referenced Jul 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Singularity environment uses
os.getenv("USER", "hermes")to build the scratch directory path under/scratch. On Windows, the username is stored inUSERNAME, notUSER, so this always falls back to the hardcoded "hermes" default.Fix
Chain the fallback:
os.getenv("USER", os.getenv("USERNAME", "hermes")). This picks up the correct username on both Unix and Windows, and still falls back to "hermes" if neither is set.One-line change.