Skip to content

Commit

Permalink
Merge remote-tracking branch 'DO_NOT_PUSH/main' into merge-turbo-tooling
Browse files Browse the repository at this point in the history
  • Loading branch information
Brooooooklyn committed Oct 13, 2022
2 parents 4e572db + 25a748e commit b2fd329
Show file tree
Hide file tree
Showing 86 changed files with 5,618 additions and 223 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ jobs:
./scripts/version.js ${{ inputs.increment }}
cat version.txt
- name: Stage Commit
run: cd cli && make stage-release && echo "STAGE_BRANCH=$(git rev-parse HEAD)" >> $GITHUB_ENV
run: cd cli && make stage-release && echo "STAGE_BRANCH=$(git branch --show-current)" >> $GITHUB_ENV
- name: Show Stage Commit
run: echo "${{ env.STAGE_BRANCH }}"
13 changes: 11 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,14 +68,23 @@
"cwd": "${workspaceRoot}/examples/basic",
"args": ["run", "build"]
},
{
"name": "Build Basic (Dry Run / Debug)",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/cli/cmd/turbo",
"cwd": "${workspaceRoot}/examples/basic",
"args": ["run", "build", "--dry-run", "-vv"]
},
{
"name": "Build Kitchen Sink",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/cli/cmd/turbo",
"cwd": "${workspaceRoot}/examples/kitchen-sink",
"args": ["run", "build"]
"args": ["run", "build", "-vv"]
},
{
"name": "Build Kitchen Sink (Dry Run)",
Expand All @@ -84,7 +93,7 @@
"mode": "debug",
"program": "${workspaceRoot}/cli/cmd/turbo",
"cwd": "${workspaceRoot}/examples/kitchen-sink",
"args": ["run", "build"]
"args": ["run", "build", "--dry-run"]
},
{
"name": "Build All",
Expand Down
13 changes: 6 additions & 7 deletions cli/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@ else
UNAME := $(shell uname -s)
endif

USE_CGO = 0
ifeq ($(UNAME), Darwin)
USE_CGO = 1
endif

# Strip debug info
GO_FLAGS += "-ldflags=-s -w"

Expand All @@ -25,7 +20,7 @@ SRC_FILES = $(shell find . -name "*.go" | grep -v "_test.go")
GENERATED_FILES = internal/turbodprotocol/turbod.pb.go internal/turbodprotocol/turbod_grpc.pb.go

turbo: $(GENERATED_FILES) $(SRC_FILES) go.mod
CGO_ENABLED=$(USE_CGO) go build $(GO_FLAGS) ./cmd/turbo
CGO_ENABLED=1 go build $(GO_FLAGS) ./cmd/turbo

protoc: internal/turbodprotocol/turbod.proto
protoc --go_out=. --go_opt=paths=source_relative \
Expand All @@ -49,6 +44,10 @@ check-go-version:
# you can run "TURBO_RACE= make test-go" to disable the race detector.
TURBO_RACE ?= -race

ifeq ($(UNAME), Windows)
TURBO_RACE=
endif

clean-go:
go clean -testcache ./...

Expand Down Expand Up @@ -206,7 +205,7 @@ $(CRAM_ENV)/bin/prysk: $(CRAM_ENV)/bin/pip

INTEGRATION_TEST_FILES = $(shell find integration_tests -name "*.t")

integration-tests: $(CRAM_ENV)/bin/prysk turbo $(INTEGRATION_TEST_FILES)
integration-tests: $(CRAM_ENV)/bin/prysk turbo $(INTEGRATION_TEST_FILES) corepack
$(CRAM_ENV)/bin/prysk --shell=`which bash` $(INTEGRATION_TEST_FILES)

# use target testbed-<some directory under integration_tests> to set up the testbed directory
Expand Down
8 changes: 5 additions & 3 deletions cli/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ go 1.18

require (
github.com/AlecAivazis/survey/v2 v2.3.5
github.com/DataDog/zstd v1.5.2
github.com/Masterminds/semver v1.5.0
github.com/adrg/xdg v0.3.3
github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f
github.com/briandowns/spinner v1.18.1
github.com/cenkalti/backoff/v4 v4.1.3
github.com/deckarep/golang-set v1.8.0
Expand All @@ -18,13 +20,15 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
github.com/hashicorp/go-gatedio v0.5.0
github.com/hashicorp/go-hclog v1.2.1
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/go-retryablehttp v0.6.8
github.com/iseki0/go-yarnlock v0.0.2-0.20220905015017-a2a90751cdfa
github.com/karrick/godirwalk v1.16.1
github.com/mattn/go-isatty v0.0.14
github.com/mitchellh/cli v1.1.2
github.com/mitchellh/go-homedir v1.1.0
github.com/mitchellh/mapstructure v1.5.0
github.com/moby/sys/sequential v0.5.0
github.com/nightlyone/lockfile v1.0.0
github.com/pkg/errors v0.9.1
github.com/pyr-sh/dag v1.0.0
Expand All @@ -36,6 +40,7 @@ require (
github.com/stretchr/testify v1.8.0
github.com/yookoala/realpath v1.0.0
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a
google.golang.org/grpc v1.46.2
google.golang.org/protobuf v1.28.0
gopkg.in/yaml.v3 v3.0.1
Expand All @@ -46,15 +51,13 @@ require (
require (
github.com/Masterminds/goutils v1.1.0 // indirect
github.com/Masterminds/sprig v2.22.0+incompatible // indirect
github.com/andybalholm/crlf v0.0.0-20171020200849-670099aa064f // indirect
github.com/armon/go-radix v1.0.0 // indirect
github.com/bgentry/speakeasy v0.1.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.11 // indirect
Expand All @@ -79,7 +82,6 @@ require (
github.com/subosito/gotenv v1.3.0 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/net v0.0.0-20220520000938-2e3eb7b945c2 // indirect
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
google.golang.org/genproto v0.0.0-20220519153652-3a47de7e79bd // indirect
Expand Down
4 changes: 4 additions & 0 deletions cli/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ github.com/AlecAivazis/survey/v2 v2.3.5/go.mod h1:4AuI9b7RjAR+G7v9+C4YSlX/YL3K3c
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ=
github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8=
github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw=
github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg=
github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU=
github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww=
Expand Down Expand Up @@ -360,6 +362,8 @@ github.com/mitchellh/mapstructure v1.5.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR
github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE=
github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw=
github.com/moby/sys/sequential v0.5.0 h1:OPvI35Lzn9K04PBbCLW0g4LcFAJgHsvXsRyewg5lXtc=
github.com/moby/sys/sequential v0.5.0/go.mod h1:tH2cOOs5V9MlPiXcQzRC+eEyab644PWKGRYaaV5ZZlo=
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
Expand Down
81 changes: 81 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/berry.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
Setup
$ . ${TESTDIR}/../setup.sh
$ . ${TESTDIR}/setup.sh $(pwd) berry

Populate cache
$ ${TURBO} build --filter=a
\xe2\x80\xa2 Packages in scope: a (esc)
\xe2\x80\xa2 Running build in 1 packages (esc)
\xe2\x80\xa2 Remote caching disabled (esc)
a:build: cache miss, executing [0-9a-f]+ (re)
a:build: building

Tasks: 1 successful, 1 total
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

$ ${TURBO} build --filter=b
\xe2\x80\xa2 Packages in scope: b (esc)
\xe2\x80\xa2 Running build in 1 packages (esc)
\xe2\x80\xa2 Remote caching disabled (esc)
b:build: cache miss, executing [0-9a-f]+ (re)
b:build: building

Tasks: 1 successful, 1 total
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)


Bump dependency for b and rebuild
Only b should have a cache miss
$ patch yarn.lock yarn-lock.patch
patching file yarn.lock
$ ${TURBO} build --filter=a
\xe2\x80\xa2 Packages in scope: a (esc)
\xe2\x80\xa2 Running build in 1 packages (esc)
\xe2\x80\xa2 Remote caching disabled (esc)
a:build: cache hit, replaying output [0-9a-f]+ (re)
a:build: building

Tasks: 1 successful, 1 total
Cached: 1 cached, 1 total
Time:\s*[\.0-9]+m?s >>> FULL TURBO (re)


$ ${TURBO} build --filter=b
\xe2\x80\xa2 Packages in scope: b (esc)
\xe2\x80\xa2 Running build in 1 packages (esc)
\xe2\x80\xa2 Remote caching disabled (esc)
b:build: cache miss, executing [0-9a-f]+ (re)
b:build: building

Tasks: 1 successful, 1 total
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)


Bump of root workspace invalidates all packages
$ patch yarn.lock turbo-bump.patch
patching file yarn.lock
$ ${TURBO} build --filter=a
\xe2\x80\xa2 Packages in scope: a (esc)
\xe2\x80\xa2 Running build in 1 packages (esc)
\xe2\x80\xa2 Remote caching disabled (esc)
a:build: cache miss, executing [0-9a-f]+ (re)
a:build: building

Tasks: 1 successful, 1 total
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

$ ${TURBO} build --filter=b
\xe2\x80\xa2 Packages in scope: b (esc)
\xe2\x80\xa2 Running build in 1 packages (esc)
\xe2\x80\xa2 Remote caching disabled (esc)
b:build: cache miss, executing [0-9a-f]+ (re)
b:build: building

Tasks: 1 successful, 1 total
Cached: 0 cached, 1 total
Time:\s*[\.0-9]+m?s (re)

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
11 changes: 11 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/berry/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "monorepo",
"workspaces": [
"apps/**"
],
"packageManager": "[email protected]",
"private": true,
"dependencies": {
"turbo": "^1.5.6"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- berry/yarn.lock 2022-10-12 13:33:53.000000000 -0700
+++ berry/new 2022-10-12 14:05:17.000000000 -0700
@@ -86,7 +86,7 @@
linkType: hard

"turbo@npm:^1.5.6":
- version: 1.5.6
+ version: 1.5.7
resolution: "turbo@npm:1.5.6"
dependencies:
turbo-darwin-64: 1.5.6
13 changes: 13 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/berry/yarn-lock.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- yarn.lock 2022-10-12 10:36:16.000000000 -0700
+++ new.lock 2022-10-12 10:59:15.000000000 -0700
@@ -22,8 +22,8 @@
linkType: soft

"function-bind@npm:^1.1.1":
- version: 1.1.1
- resolution: "function-bind@npm:1.1.1"
+ version: 1.1.2
+ resolution: "function-bind@npm:1.1.2"
checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a
languageName: node
linkType: hard
115 changes: 115 additions & 0 deletions cli/integration_tests/lockfile_aware_caching/berry/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# This file is generated by running "yarn install" inside your project.
# Manual changes might be lost - proceed with caution!

__metadata:
version: 6
cacheKey: 8

"a@workspace:apps/a":
version: 0.0.0-use.local
resolution: "a@workspace:apps/a"
dependencies:
has-symbols: ^1.0.3
languageName: unknown
linkType: soft

"b@workspace:apps/b":
version: 0.0.0-use.local
resolution: "b@workspace:apps/b"
dependencies:
function-bind: ^1.1.1
languageName: unknown
linkType: soft

"function-bind@npm:^1.1.1":
version: 1.1.1
resolution: "function-bind@npm:1.1.1"
checksum: b32fbaebb3f8ec4969f033073b43f5c8befbb58f1a79e12f1d7490358150359ebd92f49e72ff0144f65f2c48ea2a605bff2d07965f548f6474fd8efd95bf361a
languageName: node
linkType: hard

"has-symbols@npm:^1.0.3":
version: 1.0.3
resolution: "has-symbols@npm:1.0.3"
checksum: a054c40c631c0d5741a8285010a0777ea0c068f99ed43e5d6eb12972da223f8af553a455132fdb0801bdcfa0e0f443c0c03a68d8555aa529b3144b446c3f2410
languageName: node
linkType: hard

"monorepo@workspace:.":
version: 0.0.0-use.local
resolution: "monorepo@workspace:."
dependencies:
turbo: ^1.5.6
languageName: unknown
linkType: soft

"turbo-darwin-64@npm:1.5.6":
version: 1.5.6
resolution: "turbo-darwin-64@npm:1.5.6"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"turbo-darwin-arm64@npm:1.5.6":
version: 1.5.6
resolution: "turbo-darwin-arm64@npm:1.5.6"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"turbo-linux-64@npm:1.5.6":
version: 1.5.6
resolution: "turbo-linux-64@npm:1.5.6"
conditions: os=linux & cpu=x64
languageName: node
linkType: hard

"turbo-linux-arm64@npm:1.5.6":
version: 1.5.6
resolution: "turbo-linux-arm64@npm:1.5.6"
conditions: os=linux & cpu=arm64
languageName: node
linkType: hard

"turbo-windows-64@npm:1.5.6":
version: 1.5.6
resolution: "turbo-windows-64@npm:1.5.6"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"turbo-windows-arm64@npm:1.5.6":
version: 1.5.6
resolution: "turbo-windows-arm64@npm:1.5.6"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"turbo@npm:^1.5.6":
version: 1.5.6
resolution: "turbo@npm:1.5.6"
dependencies:
turbo-darwin-64: 1.5.6
turbo-darwin-arm64: 1.5.6
turbo-linux-64: 1.5.6
turbo-linux-arm64: 1.5.6
turbo-windows-64: 1.5.6
turbo-windows-arm64: 1.5.6
dependenciesMeta:
turbo-darwin-64:
optional: true
turbo-darwin-arm64:
optional: true
turbo-linux-64:
optional: true
turbo-linux-arm64:
optional: true
turbo-windows-64:
optional: true
turbo-windows-arm64:
optional: true
bin:
turbo: bin/turbo
checksum: 5a243f0113fb886c90e8d7b4e94b590acef9813b1cfb13330b3d62c2b09e89647b5aabbe3ecf80d5fe3d8c1ee74ad4eb81f25de30ef62eb1c8a15c23383bd943
languageName: node
linkType: hard
Loading

0 comments on commit b2fd329

Please sign in to comment.