google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.3k stars 209 forks source link

Cannot cross-compile for Solaris #320

Closed edigaryev closed 3 years ago

edigaryev commented 3 years ago

When trying to build a project that depends on starlark-go with GOOS=solaris, compiler throws the following error:

/go/pkg/mod/go.starlark.net@v0.0.0-20201014215153-dff0ae5b4820/starlark/int_posix64.go:70:12: undefined: syscall.Mmap

Is there a reason why golang.org/x/sys (which would otherwise provide the Mmap() implementation) was ditched in favor to a in-house implementation in https://github.com/google/starlark-go/pull/287?

fkorotkov commented 3 years ago

golang.org/x/sys is still brought via an indirect dependency through github.com/chzyer/readline:

$: go mod why -m golang.org/x/sys
# golang.org/x/sys
go.starlark.net/repl
github.com/chzyer/readline
golang.org/x/sys/unix
alandonovan commented 3 years ago

The repository does depend on sys indirectly via readline, but the interpreter itself does not depend on either package, and rolling our own system call was an attempt to avoid adding any dependencies. However, it was probably a false economy in this case.

I've mailed https://github.com/google/starlark-go/pull/321