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.
This commit is contained in:
Michael Kuhn 2021-06-25 11:00:06 +02:00 committed by GitHub
parent 291703f146
commit f4b96a21c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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'