Skip to content

Commit

Permalink
Revert riscv removal.
Browse files Browse the repository at this point in the history
  • Loading branch information
creack committed Oct 26, 2023
1 parent 5c92749 commit 8042b22
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Dockerfile.riscv
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# NOTE: Using 1.13 as a base to build the RISCV compiler, the resulting version is based on go1.6.
FROM golang:1.13

# Clone and complie a riscv compatible version of the go compiler.
RUN git clone https://review.gerrithub.io/riscv/riscv-go /riscv-go
# riscvdev branch HEAD as of 2019-06-29.
RUN cd /riscv-go && git checkout 04885fddd096d09d4450726064d06dd107e374bf
ENV PATH=/riscv-go/misc/riscv:/riscv-go/bin:$PATH
RUN cd /riscv-go/src && GOROOT_BOOTSTRAP=$(go env GOROOT) ./make.bash
ENV GOROOT=/riscv-go

# Set the base env.
ENV GOOS=linux GOARCH=riscv CGO_ENABLED=0 GOFLAGS='-v -ldflags=-s -ldflags=-w'

# Pre compile the stdlib.
RUN go build -a std

# Add the code to the image.
WORKDIR pty
ADD . .

# Build the lib.
RUN go build
5 changes: 5 additions & 0 deletions test_crosscompile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ if ! hash docker; then
return
fi

echo2 "Build for linux."
echo2 " - linux/riscv"
docker build -t creack-pty-test -f Dockerfile.riscv .

# Golang dropped support for darwin 32bits since go1.15. Make sure the lib still compile with go1.14 on those archs.
echo2 "Build for darwin (32bits)."
echo2 " - darwin/386"
Expand All @@ -53,6 +57,7 @@ echo2 " - darwin/arm"
docker build -t creack-pty-test -f Dockerfile.golang --build-arg=GOVERSION=1.14 --build-arg=GOOS=darwin --build-arg=GOARCH=arm .

# Run a single test for an old go version. Would be best with go1.0, but not available on Dockerhub.
# Using 1.6 as it is the base version for the RISCV compiler.
# Would also be better to run all the tests, not just one, need to refactor this file to allow for specifc archs per version.
echo2 "Build for linux - go1.6."
echo2 " - linux/amd64"
Expand Down

0 comments on commit 8042b22

Please sign in to comment.