Skip to content

Commit

Permalink
Add hack to fix overly long R_Libs (>128K).
Browse files Browse the repository at this point in the history
  • Loading branch information
mjkw31 committed May 14, 2024
1 parent 50bbfc1 commit 39f8109
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/builder_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ Stage: build
/home/ubuntu/spack/opt/spack/gpg /opt/spack/opt/spack/gpg
%post
# Hack to fix overly long R_LIBS env var (>128K).
sed -i 's@item = SetEnv(name, value, trace=self._trace(), force=force, raw=raw)@item = SetEnv(name, value.replace("/opt/software/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__", "") if name == "R_LIBS" else value, trace=self._trace(), force=force, raw=raw)@' /opt/spack/lib/spack/spack/util/environment.py
ln -s /opt/software/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spac /__spac
# Create the manifest file for the installation in /opt/spack-environment
mkdir /opt/spack-environment && cd /opt/spack-environment
cat << EOF > spack.yaml
Expand Down
4 changes: 4 additions & 0 deletions build/singularity.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ Stage: build
/home/ubuntu/spack/opt/spack/gpg /opt/spack/opt/spack/gpg

%post
# Hack to fix overly long R_LIBS env var (>128K).
sed -i 's@item = SetEnv(name, value, trace=self._trace(), force=force, raw=raw)@item = SetEnv(name, value.replace("/opt/software/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__", "") if name == "R_LIBS" else value, trace=self._trace(), force=force, raw=raw)@' /opt/spack/lib/spack/spack/util/environment.py
ln -s /opt/software/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spac /__spac

# Create the manifest file for the installation in /opt/spack-environment
mkdir /opt/spack-environment && cd /opt/spack-environment
cat << EOF > spack.yaml
Expand Down

0 comments on commit 39f8109

Please sign in to comment.