-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Become go module, reduce deps, add concurrency flag #46
base: master
Are you sure you want to change the base?
Conversation
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. Ref: https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns
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.
Can you help me understand here? So even with modern Go you can't just recursively clone this repo and run |
You can't run This is because it expects bine to be in your
EDIT: Just realized this does call for some minor modification to |
I would support moving just the test to a subfolder and putting the |
Got it. I'll mark this as a draft until I have time to take a deeper look into this proposed alternative route. I may potentially cherry pick other changes from this PR into new PRs unless you have any quarrels against those to note, @cretz. |
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 ↩