Skip to content

Commit

Permalink
Updates for OR-Tools v8.2
Browse files Browse the repository at this point in the history
 * Update go protobuf -> `1.5.2`
 * Update go -> `1.16.3`
 * Makefile, Go Dockerfile, + Airspace Readme updates
  • Loading branch information
brettgoing committed Apr 29, 2021
1 parent 999df52 commit e253d89
Show file tree
Hide file tree
Showing 12 changed files with 3,079 additions and 1,989 deletions.
23 changes: 21 additions & 2 deletions AIRSPACE-README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ It has Go bindings and binaries for use with Go projects.
1. Install SWIG 4.0.1:
`brew install swig`
1. Install protobuf for Go:
`go get github.com/golang/protobuf/protoc-gen-go@v1.3`
`go get -u github.com/golang/protobuf/protoc-gen-go@v1.5.2`
1. Clone Airspace OR-tools:
`git clone [email protected]:AirspaceTechnologies/or-tools.git`
1. Make third party:
`make third_party`
`make clean_third_party third_party`
1. Make go:
`make clean_go go`
1. Make go tests:
Expand All @@ -37,5 +37,24 @@ It has Go bindings and binaries for use with Go projects.
`make golib_archive`
1. Log into Github and create a release with the resulting binaries

## Update Fork from Upstream
1. Configure git remote pointing to upstream or-tools repo:
`git remote add upstream [email protected]:google/or-tools.git`
1. Fetch upstream:
`git fetch upstream`
1. Checkout fork's `stable` branch and pull:
`git checkout stable && git pull`
1. Merge changes from upstream `stable` branch:
`git merge upstream/stable`
1. Push fork's `stable` branch:
`git push`
1. Checkout fork's `airspace` branch and pull:
`git checkout airspace && git pull`
1. Merge changes from `stable` to `airspace` branch:
`git merge stable`
1. Push fork's `airspace` branch:
`git push`
1. Optionally build and release using steps above

## TODO
1. Make `IntVar`->`IntExpr` casting cleaner
4 changes: 2 additions & 2 deletions makefiles/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ LANGUAGES = cpp python java dotnet go
## PRESTAGES ##
###############
PRESTAGES = base swig
define make-prestage-target =
define make-prestage-target
#$$(info STAGE: $1)
#$$(info Create targets: $1 $(addsuffix _$1, $(DISTROS)).)
targets_$1 = $(addsuffix _$1, $(DISTROS))
Expand Down Expand Up @@ -151,7 +151,7 @@ $(foreach stage,$(PRESTAGES),$(eval $(call make-prestage-target,$(stage))))
## STAGES ##
############
STAGES = env devel build test package export
define make-stage-target =
define make-stage-target
#$$(info STAGE: $1)
#$$(info Create targets: $1 $(addsuffix _$1, $(DISTROS)).)
targets_$1 = $(addsuffix _$1, $(DISTROS))
Expand Down
5 changes: 3 additions & 2 deletions makefiles/Makefile.go.mk
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,8 @@ go_pimpl: $(GEN_DIR)/ortools/go

$(GEN_DIR)/ortools/go/go.mod:
cd $(GEN_DIR)/ortools/go && \
$(GO_BIN) mod init $(PKG_ROOT)
$(GO_BIN) mod init $(PKG_ROOT) && \
$(GO_BIN) mod tidy

$(GEN_DIR)/ortools/go: \
$(LIB_DIR)/$(LIB_PREFIX)$(GO_OR_TOOLS_NATIVE_LIB).$(SWIG_GO_LIB_SUFFIX) \
Expand Down Expand Up @@ -352,7 +353,7 @@ detect_go:
@echo Relevant info for the Go build:
@echo These must resolve to proceed
@echo " Install go: https://golang.org/doc/install"
@echo " Install protoc-gen-go: 'go get -u github.com/golang/protobuf/protoc-gen-go'"
@echo " Install protoc-gen-go: 'go get -u github.com/golang/protobuf/protoc-gen-go@v1.5.2'"
@echo GO_BIN = $(GO_BIN)
@echo GO_PATH = $(GO_PATH)
@echo PROTOC_GEN_GO = $(PROTOC_GEN_GO)
Expand Down
8 changes: 4 additions & 4 deletions makefiles/docker/debian/go.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ ENV GOROOT=/usr/local/go
ENV GOPATH=/home/go
ENV PATH=$PATH:$GOROOT/bin:$GOPATH/bin
ENV GO111MODULE=on
RUN wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz \
RUN wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz \
&& mkdir -p /usr/local/go \
&& mkdir -p /home/go \
&& tar -xvf go1.14.1.linux-amd64.tar.gz -C /usr/local \
&& rm -rf go1.14.1.linux-amd64.tar.gz \
&& go get github.com/golang/protobuf/protoc-gen-go@v1.3
&& tar -xvf go1.16.3.linux-amd64.tar.gz -C /usr/local \
&& rm -rf go1.16.3.linux-amd64.tar.gz \
&& go get github.com/golang/protobuf/protoc-gen-go@v1.5.2
RUN make -version

FROM env AS devel
Expand Down
Loading

0 comments on commit e253d89

Please sign in to comment.