Become go module, reduce deps, add concurrency flag #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements several fixes and enhancements that allow for a smooth build process and functioning unit test runs in a modern Go environment.
Changes
Enable Go Module1
These days we can't operate out of
$GOPATH
, as this package used to require to some degree.Fix this by adding an underscore in the front of the
openssl
git submodule; thengo mod init [...]
,go mod tidy
.This is because boringssl has Go test runners, so we avoid inheriting those dependencies in the go module.
Ref: https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns
Reduce Dependency Footprint2
This remediates failed builds from not having dependencies required strictly for docs, man pages, and such.
Introduce Configurable Build Concurrency3
Hilariously enough on my overclocked i9 if I try to build tor with the previously hardcoded
fmt.Sprintf("-j%d", runtime.NumCPU())
- I get sporadic internal gcc errors.This allows passing
-j 16
, which in my case, permits me to build tor.Footnotes
Fix: enable go module by renaming git openssl submodule ↩
Fix: disable building docs to reduce dependency footprint ↩
Feat: Add -j flag to control build concurrency ↩