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

build yaegi in android termux #843

Closed
mvertes opened this issue Sep 11, 2020 · 0 comments · Fixed by #844
Closed

build yaegi in android termux #843

mvertes opened this issue Sep 11, 2020 · 0 comments · Fixed by #844
Assignees
Labels
area/stdlib bug Something isn't working os/android
Milestone

Comments

@mvertes
Copy link
Member

mvertes commented Sep 11, 2020

Building yaegi natively in a android host in termux (GOOS=android) leads to the following errors:

$ go build ./cmd/yaegi
# github.com/containous/yaegi/stdlib/syscall
stdlib/syscall/go1_15_syscall_linux_arm.go:2258:6: _syscall_Conn redeclared in this block
        previous declaration at stdlib/syscall/go1_15_syscall_android_arm.go:2258:6
stdlib/syscall/go1_15_syscall_linux_arm.go:2262:24: _syscall_Conn.SyscallConn redeclared in this block
        previous declaration at stdlib/syscall/go1_15_syscall_android_arm.go:2262:6
stdlib/syscall/go1_15_syscall_linux_arm.go:2265:6: _syscall_RawConn redeclared in this block
        previous declaration at stdlib/syscall/go1_15_syscall_android_arm.go:2265:6
stdlib/syscall/go1_15_syscall_linux_arm.go:2271:27: _syscall_RawConn.Control redeclared in this block
        previous declaration at stdlib/syscall/go1_15_syscall_android_arm.go:2271:6
stdlib/syscall/go1_15_syscall_linux_arm.go:2272:27: _syscall_RawConn.Read redeclared in this block
        previous declaration at stdlib/syscall/go1_15_syscall_android_arm.go:2272:6
stdlib/syscall/go1_15_syscall_linux_arm.go:2273:27: _syscall_RawConn.Write redeclared in this block
        previous declaration at stdlib/syscall/go1_15_syscall_android_arm.go:2273:6
stdlib/syscall/go1_15_syscall_linux_arm.go:2276:6: _syscall_Sockaddr redeclared in this block
        previous declaration at stdlib/syscall/go1_15_syscall_android_arm.go:2276:6

When cross-compiling, only specified OS corresponding file is taken, and there is no problem. The problems happens when compiling natively.

The problem occurs because both go1_15_syscall_linux_arm.go and go1_15_syscall_linux_arm.go are compiled. According to https://golang.org/cmd/go/#hdr-Build_constraints, this happens for android/linux and illumos/solaris.

@mvertes mvertes added bug Something isn't working area/stdlib os/android labels Sep 11, 2020
@mvertes mvertes self-assigned this Sep 11, 2020
@mvertes mvertes added this to the v0.8.x milestone Sep 11, 2020
mvertes added a commit that referenced this issue Sep 11, 2020
As per https://golang.org/cmd/go/#hdr-Build_constraints,
using GOOS=android also matches tags and files for GOOS=linux,
$so exclude it explicetly to avoid collisions.

Also using GOOS=illumos matches tags and files for GOOS=solaris.

Fixes #843.
traefiker pushed a commit that referenced this issue Sep 14, 2020
As per https://golang.org/cmd/go/#hdr-Build_constraints,
using GOOS=android also matches tags and files for GOOS=linux,
$so exclude it explicetly to avoid collisions.

Also using GOOS=illumos matches tags and files for GOOS=solaris.

Fixes #843.
traefiker pushed a commit that referenced this issue Sep 14, 2020
As per https://golang.org/cmd/go/#hdr-Build_constraints,
using GOOS=android also matches tags and files for GOOS=linux,
so exclude it explicetly to avoid collisions.

Also using GOOS=illumos matches tags and files for GOOS=solaris.

Fixes #843.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/stdlib bug Something isn't working os/android
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant