Skip to content

syscall build error on GOOS=darwin #1023

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

Closed
gitloverr opened this issue Apr 28, 2021 · 6 comments · Fixed by #1024
Closed

syscall build error on GOOS=darwin #1023

gitloverr opened this issue Apr 28, 2021 · 6 comments · Fixed by #1024

Comments

@gitloverr
Copy link

Hi everyone,

when I import other than the gopherjs library to my go file, and when I ran the "gopherjs build" cmd, it throws errors likes those, but when I import only gopherjs it doesn't give me anything error:
/usr/local/opt/go/libexec/src/syscall/syscall_darwin.go:118:1: //go:linkname local symbol "libc_getfsstat" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/syscall_darwin.go:151:1: //go:linkname local symbol "libc_setattrlist" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/syscall_darwin.go:279:1: //go:linkname local symbol "libc_fdopendir" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/syscall_darwin_amd64.go:59:1: //go:linkname local symbol "libc_sendfile" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/zsyscall_darwin_amd64.go:23:1: //go:linkname local symbol "libc_getgroups" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/zsyscall_darwin_amd64.go:38:1: //go:linkname local symbol "libc_setgroups" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/zsyscall_darwin_amd64.go:54:1: //go:linkname local symbol "libc_wait4" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/zsyscall_darwin_amd64.go:70:1: //go:linkname local symbol "libc_accept" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/zsyscall_darwin_amd64.go:85:1: //go:linkname local symbol "libc_bind" is not found in the current source file /usr/local/opt/go/libexec/src/syscall/zsyscall_darwin_amd64.go:100:1: //go:linkname local symbol "libc_connect" is not found in the current source file :0:0: too many errors

My go file :

`

package main

import (
"github.com/ava-labs/avalanchego/utils/formatting"

"github.com/gopherjs/gopherjs/js"
)

func Try() string { return "hello world"}
 
func main() {
	js.Global.Get("module").Get("exports").Set("Try", Try)
}

`

why is this happening? how do I solve this error?

thank you

@nevkontakte
Copy link
Member

Could you please provide complete commands you execute and outputs you are receiving? Also, which GopherJS versions are you using (run gopherjs version command to get it).

@Pangssu
Copy link

Pangssu commented Apr 29, 2021

same here on GopherJS 1.16.1+go1.16.3

@gitloverr
Copy link
Author

hi, of course. Full commands is here:

My try.go file:

`

package main

import (
"github.com/ava-labs/avalanchego/utils/formatting"

"github.com/gopherjs/gopherjs/js"
)

func Try() string { return "hello world"}
 
func main() {
	js.Global.Get("module").Get("exports").Set("Try", Try)
}

`

My js commands:

`

var tryGo = require('./try.js')

console.log(tryGo.Try())

`

if I import the "github.com/ava-labs/avalanchego/utils/formatting" package my go file, I'm getting this error... But I extract it, all is fine.

Also my gopherjs version: **GopherJS 1.16.1+go1.16.3**

what should I do?

thank you

@nevkontakte nevkontakte changed the title gopherjs build error syscall build error on GOOS=darwin Apr 30, 2021
@nevkontakte
Copy link
Member

Thanks for the details. I am assuming you are building on a Mac, and unfortunately none of the current GopherJS maintainers have it, so it isn't very well tested with Macs. I'll try to see if I can fix this on the weekend.

As a workaround, could you try building with GOOS=linux gopherjs build <other arguments>?

@gitloverr
Copy link
Author

Hey @nevkontakte thank you your support. I fixed with GOOS=linux gopherjs build

@nevkontakte
Copy link
Member

I'm glad it worked. I'll reopen the issue, though, since overriding GOOS shouldn't be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants