Skip to content

Commit c550063

Browse files
committed
Fix BSD REPL terminal builds
1 parent 81d34d9 commit c550063

2 files changed

Lines changed: 24 additions & 1 deletion

File tree

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ vet: $(GO)
209209
go vet ./...
210210

211211
# vet is disabled until we fix errors in generated code
212-
test: test-aot-runtime test-glj test-repl-wasm # vet
212+
test: test-aot-runtime test-glj test-repl-wasm test-repl-bsd # vet
213213
($(MAKE) test-suite v=1 || $(MAKE) test-suite v=1) || $(MAKE) test-suite v=1
214214

215215
TEST-COMPARE-LOAD := $(shell \
@@ -230,6 +230,19 @@ test-aot-runtime: $(GO)
230230
test-repl-wasm: $(GO)
231231
GOOS=js GOARCH=wasm CGO_ENABLED=0 go build ./pkg/repl
232232

233+
.PHONY: test-repl-bsd
234+
test-repl-bsd: $(GO)
235+
@set -e; \
236+
for target in \
237+
dragonfly/amd64 \
238+
freebsd/386 freebsd/amd64 freebsd/arm64 \
239+
netbsd/amd64 netbsd/arm64 \
240+
openbsd/amd64 openbsd/arm64; do \
241+
echo "Building pkg/repl for $$target"; \
242+
GOOS=$${target%/*} GOARCH=$${target#*/} CGO_ENABLED=0 \
243+
go build ./pkg/repl; \
244+
done
245+
233246
.PHONY: test-aot test-suite-aot
234247
test-aot: test-aot-runtime test-glj
235248
$(MAKE) test-suite-aot

pkg/repl/ioctl_bsd.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
//go:build dragonfly || freebsd || netbsd || openbsd
2+
3+
package repl
4+
5+
import "golang.org/x/sys/unix"
6+
7+
const (
8+
ioctlGetTermios = unix.TIOCGETA
9+
ioctlSetTermios = unix.TIOCSETA
10+
)

0 commit comments

Comments
 (0)