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

*: move parser to a separate repository #8036

Merged
merged 3 commits into from
Oct 25, 2018
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
240 changes: 39 additions & 201 deletions Gopkg.lock

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ required = ["github.com/golang/protobuf/jsonpb"]
version = "1.1.0"
name = "github.com/golang/protobuf"

[[constraint]]
branch = "master"
name = "github.com/cznic/parser"

[[constraint]]
branch = "master"
name = "github.com/cznic/sortutil"
Expand Down Expand Up @@ -102,3 +98,6 @@ required = ["github.com/golang/protobuf/jsonpb"]
version = "0.9.0"
source = "https://github.com/pingcap/errors.git"

[[constraint]]
branch = "master"
name = "github.com/pingcap/parser"
45 changes: 12 additions & 33 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FILES := $$(find $$($(PACKAGE_DIRECTORIES)) -name "*.go" | grep -vE "vendor"
GOFAIL_ENABLE := $$(find $$PWD/ -type d | grep -vE "(\.git|vendor)" | xargs gofail enable)
GOFAIL_DISABLE := $$(find $$PWD/ -type d | grep -vE "(\.git|vendor)" | xargs gofail disable)

LDFLAGS += -X "github.com/pingcap/tidb/mysql.TiDBReleaseVersion=$(shell git describe --tags --dirty)"
LDFLAGS += -X "github.com/pingcap/parser/mysql.TiDBReleaseVersion=$(shell git describe --tags --dirty)"
LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBBuildTS=$(shell date -u '+%Y-%m-%d %I:%M:%S')"
LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=$(shell git rev-parse HEAD)"
LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBGitBranch=$(shell git rev-parse --abbrev-ref HEAD)"
Expand All @@ -40,7 +40,7 @@ CHECK_LDFLAGS += $(LDFLAGS) ${TEST_LDFLAGS}

TARGET = ""

.PHONY: all build update parser clean todo test gotest interpreter server dev benchkv benchraw check parserlib checklist
.PHONY: all build update clean todo test gotest interpreter server dev benchkv benchraw check checklist parser

default: server buildsucc

Expand All @@ -51,35 +51,14 @@ buildsucc:

all: dev server benchkv

dev: checklist parserlib test check
parser:
@echo "remove this command later"

dev: checklist test check

build:
$(GOBUILD)

goyacc:
$(GOBUILD) -o bin/goyacc parser/goyacc/main.go

parser: goyacc
bin/goyacc -o /dev/null parser/parser.y
bin/goyacc -o parser/parser.go parser/parser.y 2>&1 | egrep "(shift|reduce)/reduce" | awk '{print} END {if (NR > 0) {print "Find conflict in parser.y. Please check y.output for more information."; exit 1;}}'
rm -f y.output

@if [ $(ARCH) = $(LINUX) ]; \
then \
sed -i -e 's|//line.*||' -e 's/yyEofCode/yyEOFCode/' parser/parser.go; \
elif [ $(ARCH) = $(MAC) ]; \
then \
/usr/bin/sed -i "" 's|//line.*||' parser/parser.go; \
/usr/bin/sed -i "" 's/yyEofCode/yyEOFCode/' parser/parser.go; \
fi

@awk 'BEGIN{print "// Code generated by goyacc"} {print $0}' parser/parser.go > tmp_parser.go && mv tmp_parser.go parser/parser.go;

parserlib: parser/parser.go

parser/parser.go: parser/parser.y
make parser

# The retool tools.json is setup from hack/retool-install.sh
check-setup:
@which retool >/dev/null 2>&1 || go get github.com/twitchtv/retool
Expand Down Expand Up @@ -134,7 +113,7 @@ test: checklist gotest explaintest
explaintest: server
@cd cmd/explaintest && ./run-tests.sh -s ../../bin/tidb-server

gotest: parserlib
gotest:
go get github.com/etcd-io/gofail
@$(GOFAIL_ENABLE)
ifeq ("$(TRAVIS_COVERAGE)", "1")
Expand All @@ -151,21 +130,21 @@ else
endif
@$(GOFAIL_DISABLE)

race: parserlib
race:
go get github.com/etcd-io/gofail
@$(GOFAIL_ENABLE)
@export log_level=debug; \
$(GOTEST) -timeout 20m -race $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
@$(GOFAIL_DISABLE)

leak: parserlib
leak:
go get github.com/etcd-io/gofail
@$(GOFAIL_ENABLE)
@export log_level=debug; \
$(GOTEST) -tags leak $(PACKAGES) || { $(GOFAIL_DISABLE); exit 1; }
@$(GOFAIL_DISABLE)

tikv_integration_test: parserlib
tikv_integration_test:
go get github.com/etcd-io/gofail
@$(GOFAIL_ENABLE)
$(GOTEST) ./store/tikv/. -with-tikv=true || { $(GOFAIL_DISABLE); exit 1; }
Expand All @@ -182,14 +161,14 @@ ifeq ("$(WITH_CHECK)", "1")
CHECK_FLAG = $(TEST_LDFLAGS)
endif

server: parserlib
server:
ifeq ($(TARGET), "")
$(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o bin/tidb-server tidb-server/main.go
else
$(GOBUILD) $(RACE_FLAG) -ldflags '$(LDFLAGS) $(CHECK_FLAG)' -o '$(TARGET)' tidb-server/main.go
endif

server_check: parserlib
server_check:
ifeq ($(TARGET), "")
$(GOBUILD) $(RACE_FLAG) -ldflags '$(CHECK_LDFLAGS)' -o bin/tidb-server tidb-server/main.go
else
Expand Down
64 changes: 0 additions & 64 deletions ast/ddl_test.go

This file was deleted.

70 changes: 0 additions & 70 deletions ast/dml_test.go

This file was deleted.

103 changes: 0 additions & 103 deletions ast/expressions_test.go

This file was deleted.

Loading