Skip to content

Commit

Permalink
build: add go.work in gitignore (#13100)
Browse files Browse the repository at this point in the history
* build: add `go.work` in gitignore

* markdownlint
  • Loading branch information
julienrbrt authored Aug 30, 2022
1 parent 783f597 commit 2c527d0
Show file tree
Hide file tree
Showing 8 changed files with 2,575 additions and 2,575 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/legacy-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ jobs:
with:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
env:
# Here we don't use the go.work for ensuring that the modules are correctly tagged and tidy-ed.
GOWORK: off

sims-notify-success:
needs: [tests]
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,6 @@ jobs:
with:
name: "${{ github.sha }}-${{ matrix.part }}-coverage"
path: ./${{ matrix.part }}profile.out
env:
# Here we don't use the go.work for ensuring that the modules are correctly tagged and tidy-ed.
GOWORK: off

upload-coverage-report:
runs-on: buildjet-4vcpu-ubuntu-2004
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ buf-stamp
artifacts

# Go
go.work
go.work.sum

# Data - ideally these don't exist
Expand Down
5,126 changes: 2,563 additions & 2,563 deletions CHANGELOG.md

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* [Requesting Reviews](#requesting-reviews)
* [Updating Documentation](#updating-documentation)
* [Dependencies](#dependencies)
* [`go.work`](#gowork)
* [Protobuf](#protobuf)
* [Branching Model and Release](#branching-model-and-release)
* [PR Targeting](#pr-targeting)
Expand Down Expand Up @@ -65,7 +66,7 @@ To synchronize we have few major meetings:
* Cosmos Community SDK Development Call on the last Wednesday of every month at 17:00 UTC.
* Cosmos Roadmap Prioritization every 4 weeks on Tuesday at 15:00 UTC (limited participation).

If you would like to join one of those calls, then please contact us on [Discord](https://discord.com/invite/cosmosnetwork) or reach out directly to Cory Levinson from Regen Network (cory@regen.network).
If you would like to join one of those calls, then please contact us on [Discord](https://discord.com/invite/cosmosnetwork) or reach out directly to Marko (@marbar3778).

## Architecture Decision Records (ADR)

Expand Down Expand Up @@ -176,6 +177,13 @@ get away with telling people they can just `go get` our software.
Since some dependencies are not under our control, a third party may break our
build, in which case we can fall back on `go mod tidy -v`.

### `go.work`

The Cosmos SDK is a multi-module repo, for this reason, the use of a `go.work` file is handy.
We provide a [`go.work.example`](./go.work.example) that contains all the modules used in the SDK.
Do note that contributions modifying multiple Go modules should be submitted as separate PRs, this allows us to tag the changes and avoid `replace`s.
For consistency between our CI and the local tests, `GOWORK=off` is set in the `Makefile`. This means that the `go.work` file is not used when using `make test` or any other `make` command.

## Protobuf

We use [Protocol Buffers](https://developers.google.com/protocol-buffers) along with [gogoproto](https://github.com/gogo/protobuf) to generate code for use in Cosmos SDK.
Expand Down
4 changes: 1 addition & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ DOCS_DOMAIN=docs.cosmos.network
# RocksDB is a native dependency, so we don't assume the library is installed.
# Instead, it must be explicitly enabled and we warn when it is not.
ENABLE_ROCKSDB ?= false

export GO111MODULE = on
GOWORK = off # we disable the `go.work` for consistency with our CI

# process build tags

build_tags = netgo
ifeq ($(LEDGER_ENABLED),true)
ifeq ($(OS),Windows_NT)
Expand Down
File renamed without changes.
3 changes: 1 addition & 2 deletions scripts/module-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ execute_mod_tests() {

echo ">>> running $go_mod tests"
cd $mod_dir;
# Here we don't use the go.work for ensuring that the modules are correctly tagged and tidy-ed.
GOWORK=off go test -mod=readonly -timeout 30m -coverprofile=${root_dir}/${coverage_file}.tmp -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
go test -mod=readonly -timeout 30m -coverprofile=${root_dir}/${coverage_file}.tmp -covermode=atomic -tags='norace ledger test_ledger_mock rocksdb_build' ./...
local ret=$?
echo "test return: " $ret;
cd -;
Expand Down

0 comments on commit 2c527d0

Please sign in to comment.