summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kuhn <michael.kuhn@ovgu.de>2021-06-25 11:00:06 +0200
committerGitHub <noreply@github.com>2021-06-25 11:00:06 +0200
commitf4b96a21c8386ed76193292d928c68221d82838c (patch)
tree9af82efd41af90162356e6fa57382524a4c91107
parent291703f14679b69a2405c49fbf91d257e05bf5f7 (diff)
downloadspack-f4b96a21c8386ed76193292d928c68221d82838c.tar.gz
spack-f4b96a21c8386ed76193292d928c68221d82838c.tar.bz2
spack-f4b96a21c8386ed76193292d928c68221d82838c.tar.xz
spack-f4b96a21c8386ed76193292d928c68221d82838c.zip
go-bootstrap: Increase environment variable size (#24508)
When having a few packages loaded, installing go-bootstrap will fail because the `PATH` variable is truncated at 4096 bytes. Increase the limit to 128 KiB to make longer paths fit.
-rw-r--r--var/spack/repos/builtin/packages/go-bootstrap/package.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/go-bootstrap/package.py b/var/spack/repos/builtin/packages/go-bootstrap/package.py
index 672a50b04d..95dbdf4094 100644
--- a/var/spack/repos/builtin/packages/go-bootstrap/package.py
+++ b/var/spack/repos/builtin/packages/go-bootstrap/package.py
@@ -35,17 +35,24 @@ class GoBootstrap(Package):
depends_on('git', type=('build', 'link', 'run'))
- # NOTE: Older versions of Go attempt to download external files that have
- # since been moved while running the test suite. This patch modifies the
- # test files so that these tests don't cause false failures.
- # See: https://github.com/golang/go/issues/15694
- @when('@:1.4.3')
def patch(self):
- test_suite_file = FileFilter(join_path('src', 'run.bash'))
- test_suite_file.filter(
- r'^(.*)(\$GOROOT/src/cmd/api/run.go)(.*)$',
- r'# \1\2\3',
- )
+ if self.spec.satisfies('@:1.4.3'):
+ # NOTE: Older versions of Go attempt to download external files that have
+ # since been moved while running the test suite. This patch modifies the
+ # test files so that these tests don't cause false failures.
+ # See: https://github.com/golang/go/issues/15694
+ test_suite_file = FileFilter(join_path('src', 'run.bash'))
+ test_suite_file.filter(
+ r'^(.*)(\$GOROOT/src/cmd/api/run.go)(.*)$',
+ r'# \1\2\3',
+ )
+
+ # Go uses a hardcoded limit of 4096 bytes for its printf functions.
+ # This can cause environment variables to be truncated.
+ filter_file('char buf[4096];',
+ 'char buf[131072];',
+ 'src/cmd/dist/unix.c',
+ string=True)
def install(self, spec, prefix):
env['CGO_ENABLED'] = '0'