Skip to content

Conversation

@lokielse
Copy link
Contributor

Description

This PR adds support for passing custom GOPROXY and GOSUMDB environment variables to the Docker-based build environment. This enhancement enables developers working in enterprise environments with restricted network access or corporate proxies to successfully run builds and validation commands.

Changes Made

  • Modified build/makefile/golang.mk to conditionally pass GOPROXY and GOSUMDB environment variables to Docker containers when they are set in the host environment
  • Updated .gitignore to exclude vendor/ directory and /generate-dep.go file

Problem Solved

Developers in enterprise environments often encounter certificate verification errors when running make validate or other build commands due to corporate network restrictions. For example:

level=error msg="Running error: context loading failed: failed to load packages: failed to load packages: failed to load with go/packages: err: exit status 1: stderr: go: downloading go1.24.4 (linux/arm64)\ngo: download go1.24.4: golang.org/[email protected]: verifying module: golang.org/[email protected]: Get \"https://proxy.golang.org/sumdb/sum.golang.org/supported\": tls: failed to verify certificate: x509: certificate signed by unknown authority\n"

With this change, developers can now set custom proxy configurations:

GOPROXY=https://corporate.proxy.com/go GOSUMDB=off make validate

Related Issues

Fixes #

Checklist

Note: Ensure your PR title follows the Conventional Commits format (e.g., feat(scheduler): add new feature)

  • Self-reviewed
  • Added/updated tests (if needed)
  • Updated CHANGELOG.md (if needed)
  • Updated documentation (if needed)

Breaking Changes

None. This change is backward compatible - if GOPROXY and GOSUMDB are not set, the build process behaves exactly as before.

Additional Notes

  • The implementation uses ifneq conditionals to only pass these environment variables when they are explicitly set, maintaining backward compatibility
  • This is particularly useful for developers behind corporate firewalls or in regions with restricted access to public Go proxy servers
  • Common use cases include setting GOSUMDB=off to disable checksum verification or using GOPROXY=https://proxy.golang.org,direct for alternative proxy configurations

@enoodle enoodle enabled auto-merge (squash) November 13, 2025 16:01
@enoodle enoodle merged commit 647a579 into NVIDIA:main Nov 13, 2025
5 checks passed
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.

2 participants