Skip to content
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

ci: improve makefile for multi-threaded build and readme #366

Merged
merged 2 commits into from
Mar 28, 2022

Conversation

IronCore864
Copy link
Member

@IronCore864 IronCore864 commented Mar 28, 2022

Summary

Key Points

  • This is a breaking change.
  • Documentation (new or existing) is updated.

Description

Thanks @algobot76 for raising this issue. This PR reorganized our makefile so that we could simply run "make build -j8" to speed things up.

Ideal releasing process:

  • make clean
  • make build -j8
  • make release

This will be reflected in a release document soon.

Also, some re-order, adding/removing empty lines are done, so that the Makefile is more human-readable.

Related Issues

Closes #361

Screenshots

tiexin@MBA ~/work/stream $ make clean && \time make build -j8
rm -rf .devstream
rm -f dtm*
rm -f *.md5
rm -rf build/working_dir
go install golang.org/x/tools/cmd/goimports@latest
go vet ./...
go mod tidy
mkdir -p .devstream
goimports -local="github.com/merico-dev/stream" -d -w cmd
goimports -local="github.com/merico-dev/stream" -d -w pkg
goimports -local="github.com/merico-dev/stream" -d -w internal
goimports -local="github.com/merico-dev/stream" -d -w test
go fmt ./...
go build -trimpath -gcflags="all=-N -l" -ldflags "-X github.com/merico-dev/stream/cmd/devstream/version.Version=0.3.0" -o dtm-darwin-arm64 ./cmd/devstream/
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/github-repo-scaffolding-golang-darwin-arm64_0.3.0.so ./cmd/plugin/github-repo-scaffolding-golang
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/trello-github-integ-darwin-arm64_0.3.0.so ./cmd/plugin/trello-github-integ
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/githubactions-golang-darwin-arm64_0.3.0.so ./cmd/plugin/githubactions-golang
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/argocd-darwin-arm64_0.3.0.so ./cmd/plugin/argocd
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/gitlabci-golang-darwin-arm64_0.3.0.so ./cmd/plugin/gitlabci-golang
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/jira-github-integ-darwin-arm64_0.3.0.so ./cmd/plugin/jira-github-integ
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/githubactions-python-darwin-arm64_0.3.0.so ./cmd/plugin/githubactions-python
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/githubactions-nodejs-darwin-arm64_0.3.0.so ./cmd/plugin/githubactions-nodejs
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/devlake-darwin-arm64_0.3.0.so ./cmd/plugin/devlake
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/kube-prometheus-darwin-arm64_0.3.0.so ./cmd/plugin/kube-prometheus
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/trello-darwin-arm64_0.3.0.so ./cmd/plugin/trello
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/jenkins-darwin-arm64_0.3.0.so ./cmd/plugin/jenkins
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/openldap-darwin-arm64_0.3.0.so ./cmd/plugin/openldap
go build -buildmode=plugin -trimpath -gcflags="all=-N -l" -o .devstream/argocdapp-darwin-arm64_0.3.0.so ./cmd/plugin/argocdapp
cp dtm-darwin-arm64 dtm
/Library/Developer/CommandLineTools/usr/bin/make md5
md5 -q dtm-darwin-arm64 > dtm-darwin-arm64.md5
md5 -q .devstream/github-repo-scaffolding-golang-darwin-arm64_0.3.0.so > .devstream/github-repo-scaffolding-golang-darwin-arm64_0.3.0.md5
md5 -q .devstream/trello-github-integ-darwin-arm64_0.3.0.so > .devstream/trello-github-integ-darwin-arm64_0.3.0.md5
md5 -q .devstream/githubactions-golang-darwin-arm64_0.3.0.so > .devstream/githubactions-golang-darwin-arm64_0.3.0.md5
md5 -q .devstream/argocd-darwin-arm64_0.3.0.so > .devstream/argocd-darwin-arm64_0.3.0.md5
md5 -q .devstream/gitlabci-golang-darwin-arm64_0.3.0.so > .devstream/gitlabci-golang-darwin-arm64_0.3.0.md5
md5 -q .devstream/jira-github-integ-darwin-arm64_0.3.0.so > .devstream/jira-github-integ-darwin-arm64_0.3.0.md5
md5 -q .devstream/githubactions-python-darwin-arm64_0.3.0.so > .devstream/githubactions-python-darwin-arm64_0.3.0.md5
md5 -q .devstream/githubactions-nodejs-darwin-arm64_0.3.0.so > .devstream/githubactions-nodejs-darwin-arm64_0.3.0.md5
md5 -q .devstream/devlake-darwin-arm64_0.3.0.so > .devstream/devlake-darwin-arm64_0.3.0.md5
md5 -q .devstream/kube-prometheus-darwin-arm64_0.3.0.so > .devstream/kube-prometheus-darwin-arm64_0.3.0.md5
md5 -q .devstream/trello-darwin-arm64_0.3.0.so > .devstream/trello-darwin-arm64_0.3.0.md5
md5 -q .devstream/jenkins-darwin-arm64_0.3.0.so > .devstream/jenkins-darwin-arm64_0.3.0.md5
md5 -q .devstream/openldap-darwin-arm64_0.3.0.so > .devstream/openldap-darwin-arm64_0.3.0.md5
md5 -q .devstream/argocdapp-darwin-arm64_0.3.0.so > .devstream/argocdapp-darwin-arm64_0.3.0.md5
       17.01 real        70.58 user        22.37 sys

@IronCore864
Copy link
Member Author

/ok-to-test

Makefile Show resolved Hide resolved
@daniel-hutao daniel-hutao merged commit dbaf8fa into main Mar 28, 2022
@daniel-hutao daniel-hutao deleted the feat-makefile-update branch March 28, 2022 11:51
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.

Proposal: use make -j to speed up compilation
3 participants