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

use go workspace mode everywhere #1059

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,12 @@ jobs:
run: |
./scripts/kuneiform/check_tidy

- name: Initialize Go workspace
run: |
task work

- name: Compile packages, apps, and specs
run: | # enter workspace mode to do this on one line
go work init . ./test ./core ./parse
run: |
go build -mod=readonly ./... ./core/... ./parse/... ./test/specifications/

- name: Lint
Expand Down Expand Up @@ -141,11 +144,11 @@ jobs:
task build:admin

- name: compile the core/client/example app
run: GOWORK=off go build -o /dev/null
run: go build -o /dev/null
working-directory: core/client/example

- name: compile the core/gatewayclient/example app
run: GOWORK=off go build -o /dev/null
run: go build -o /dev/null
working-directory: core/gatewayclient/example

- name: Pull math extension docker image
Expand Down
21 changes: 9 additions & 12 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,16 @@ tasks:

work:
cmds:
- go work init . ./core ./test ./parse
- cmd: go work init . ./core ./test ./parse ./core/client/example ./core/gatewayclient/example
ignore_error: true
generates:
- go.work

install:deps:
aliases: [tools]
tools:
aliases: [install:deps]
desc: Install tools required to build this app
cmds:
- go install "golang.org/x/tools/cmd/[email protected]"

init:
desc: Initialize the project
deps: [install:deps]
cmds:
- go mod download
- go install "golang.org/x/tools/cmd/[email protected]"

fmt:
desc: Format the code
Expand Down Expand Up @@ -110,9 +107,9 @@ tasks:
desc: Generate vendor
deps:
- task: vendor:clean
- task: work
cmds:
# somehow GOWORK=off has no effect on local dev workflow, it will include local module changes
- GOWORK=off go mod vendor
- go work vendor

vendor:clean:
desc: Clean vendor
Expand Down
7 changes: 3 additions & 4 deletions build/package/docker/kwild.debug.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ RUN mkdir -p /var/run/kwil
RUN chmod 777 /var/run/kwil

COPY . .
RUN test -f go.work && rm go.work || true

RUN GOWORK=off GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time GO_GCFLAGS="all=-N -l" CGO_ENABLED=0 TARGET="/app/dist" GO_BUILDTAGS=$go_build_tags GO_RACEFLAG=$go_race ./scripts/build/binary kwild
RUN GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time GO_GCFLAGS="all=-N -l" CGO_ENABLED=0 TARGET="/app/dist" GO_BUILDTAGS=$go_build_tags GO_RACEFLAG=$go_race ./scripts/build/binary kwild

RUN GOWORK=off GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_RACEFLAG=$go_race ./scripts/build/binary kwil-admin
RUN GOWORK=off GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_RACEFLAG=$go_race ./scripts/build/binary kwil-cli
RUN GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_RACEFLAG=$go_race ./scripts/build/binary kwil-admin
RUN GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_RACEFLAG=$go_race ./scripts/build/binary kwil-cli
RUN chmod +x /app/dist/kwild /app/dist/kwil-admin /app/dist/kwil-cli

FROM alpine:3.19
Expand Down
7 changes: 3 additions & 4 deletions build/package/docker/kwild.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ RUN mkdir -p /var/run/kwil
RUN chmod 777 /var/run/kwil

COPY . .
RUN test -f go.work && rm go.work || true

RUN GOWORK=off GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_BUILDTAGS=$go_build_tags GO_RACEFLAG=$go_race ./scripts/build/binary kwild
RUN GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_BUILDTAGS=$go_build_tags GO_RACEFLAG=$go_race ./scripts/build/binary kwild

RUN GOWORK=off GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_RACEFLAG=$go_race ./scripts/build/binary kwil-admin
RUN GOWORK=off GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_RACEFLAG=$go_race ./scripts/build/binary kwil-cli
RUN GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_RACEFLAG=$go_race ./scripts/build/binary kwil-admin
RUN GIT_VERSION=$version GIT_COMMIT=$git_commit BUILD_TIME=$build_time CGO_ENABLED=0 TARGET="/app/dist" GO_RACEFLAG=$go_race ./scripts/build/binary kwil-cli
RUN chmod +x /app/dist/kwild /app/dist/kwil-admin /app/dist/kwil-cli

FROM ubuntu:24.04
Expand Down
18 changes: 11 additions & 7 deletions core/client/example/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,29 @@ require (
require (
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/bits-and-blooms/bitset v1.10.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.2.1 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect
github.com/cockroachdb/apd/v3 v3.2.1 // indirect
github.com/consensys/bavard v0.1.13 // indirect
github.com/consensys/gnark-crypto v0.12.1 // indirect
github.com/crate-crypto/go-kzg-4844 v1.0.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
github.com/ethereum/c-kzg-4844 v1.0.0 // indirect
github.com/ethereum/go-ethereum v1.14.3 // indirect
github.com/ethereum/c-kzg-4844 v1.0.2 // indirect
github.com/ethereum/go-ethereum v1.14.8 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/holiman/uint256 v1.2.4 // indirect
github.com/holiman/uint256 v1.3.1 // indirect
github.com/jrick/logrotate v1.1.2 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mmcloughlin/addchain v0.4.0 // indirect
github.com/olekukonko/tablewriter v0.0.6-0.20230925090304-df64c4bbad77 // indirect
github.com/prometheus/client_golang v1.20.1 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/supranational/blst v0.3.11 // indirect
github.com/tklauser/go-sysconf v0.3.14 // indirect
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/sync v0.8.0 // indirect
golang.org/x/sys v0.23.0 // indirect
rsc.io/tmplfunc v0.0.3 // indirect
)
Loading
Loading