Skip to content

Fix build error with --build-template conda/micromamba:v2 for singularity #972

Open
munishchouhan wants to merge 4 commits intomasterfrom
971-build-error-with-build-template-condamicromambav2-for-singularity
Open

Fix build error with --build-template conda/micromamba:v2 for singularity #972
munishchouhan wants to merge 4 commits intomasterfrom
971-build-error-with-build-template-condamicromambav2-for-singularity

Conversation

@munishchouhan
Copy link
Member

Problem:
Singularity builds fail with tar errors when extracting conda packages:
tar: conda/pkgs/...: Cannot change mode to rwxrwxr-x: No such file or directory

Root Cause:
Conda's pkgs/ cache contains dangling symlinks. When tar extracts and tries to chmod these symlinks, Linux applies chmod to the (non-existent) target, causing "No such
file or directory" errors. The symlinks are created successfully - only the chmod fails.

Solution:
Suppress harmless tar errors with 2>/dev/null || true. The extraction succeeds and conda environments function correctly.

Changes:

  • Updated tar commands in conda-micromamba-v2/singularityfile-conda-file.txt
  • Updated tar commands in conda-pixi-v1/singularityfile-conda-file.txt
  • Updated corresponding tests in TemplateUtilsTest.groovy

Signed-off-by: munishchouhan <hrma017@gmail.com>
@munishchouhan munishchouhan self-assigned this Jan 27, 2026
Signed-off-by: munishchouhan <hrma017@gmail.com>
Copy link
Collaborator

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

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

is there any tar options that could provide an alternative solution? bit concerned about shallowing stderr in case of error (and returning

@munishchouhan
Copy link
Member Author

is there any tar options that could provide an alternative solution? bit concerned about shallowing stderr in case of error (and returning

I tired multiple flags but no luck

--delay-directory-restore 
        --no-same-owner 
        --no-same-permissions 

This error could be because of proot
I think we should use single stage build for singularity builds

@munishchouhan
Copy link
Member Author

because even i make a workaround where we just ignore this exception, may lead to brocker env

@munishchouhan
Copy link
Member Author

and not using tar also decreases the build time

Signed-off-by: munishchouhan <hrma017@gmail.com>
Signed-off-by: munishchouhan <hrma017@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build error with --build-template conda/micromamba:v2 for singularity

2 participants