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

syscall: use pipe2 on freebsd? #18854

Closed
nbari opened this issue Jan 30, 2017 · 16 comments
Closed

syscall: use pipe2 on freebsd? #18854

nbari opened this issue Jan 30, 2017 · 16 comments

Comments

@nbari
Copy link

nbari commented Jan 30, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.7.5 freebsd/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/root/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
CC="cc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="clang++"
CGO_ENABLED="1"

What did you do?

Trying to compile from source https://github.com/ssh-vault/ssh-vault

$ mkdir -p $HOME/go/src/github.com/ssh-vault
$ git clone git@github.com:ssh-vault/ssh-vault.git $HOME/go/src/github.com/ssh-vault/ssh-vault
$ cd $HOME/go/src/github.com/ssh-vault/ssh-vault
$ go get

What did you expect to see?

Get a binary.

What did you see instead?

$ cd .; git clone https://github.com/ssh-vault/crypto /root/go/src/github.com/ssh-vault/crypto
package github.com/ssh-vault/crypto/aead: pipe: function not implemented
@minux
Copy link
Member

minux commented Jan 30, 2017 via email

@nbari
Copy link
Author

nbari commented Jan 30, 2017

Seems to be happening with other packages as well, I just tried go get gopkg.in/yaml.v2 and have same error:

pipe: function not implemented

I have a feeling is because the images I am using don't use lib32 and syscons (src.conf):

WITHOUT_LIB32: On 64-bit platforms, set to not build 32-bit library set and a
         ld-elf32.so.1 runtime linker.

 WITHOUT_SYSCONS
         Set to not build syscons(4) support files such as keyboard maps,
         fonts, and screen output maps.

Will give a try with a generic instance in the meantime.

@minux
Copy link
Member

minux commented Jan 30, 2017 via email

@nbari
Copy link
Author

nbari commented Jan 30, 2017

This is the current kernel and the src.conf I use.

Checking the /usr/src/UPDATE file I found this:

The libc stub for the pipe(2) system call has been replaced with
a wrapper that calls the pipe2(2) system call and the pipe(2)
system call is now only implemented by the kernels that include
"options COMPAT_FREEBSD10" in their config file (this is the
default).  Users should ensure that this option is enabled in
their kernel or upgrade userspace to r302092 before upgrading their
kernel.

I am missing options COMPAT_FREEBSD10 will give a try and should be working, in case I continue having issues will update the post.

Thanks for the hint.

@nbari nbari closed this as completed Jan 30, 2017
@minux
Copy link
Member

minux commented Jan 30, 2017 via email

@minux minux reopened this Jan 30, 2017
@minux minux changed the title pipe: function not implemented (go version go1.7.5 freebsd/amd64) syscall: use pipe2 on freebsd? Jan 30, 2017
@nbari
Copy link
Author

nbari commented Jan 30, 2017

Hi, I confirm that by recompiling the kernel with:

options COMPAT_FREEBSD10

did the trick :-)

@reezer
Copy link

reezer commented Feb 5, 2017

I don't know what Go's policy on supporting older systems is, but I want to mention that any release prior to 10.0 isn't supported anymore. In fact no release prior to 10.3 is supported anymore.

Therefor I think that pipe support can safely be dropped in favor of the pipe2 system, if Go doesn't plan to support EOLed releases of FreeBSD.

@glebius
Copy link

glebius commented Mar 21, 2017

Hi! I have created required patch.

#19640

@glebius
Copy link

glebius commented Mar 21, 2017

O, fsck, what a long process to contribute!

@bradfitz
Copy link
Contributor

@glebius, sorry. The https://golang.org/doc/contribute.html document is too long but there's actually not many steps in it.

@glebius
Copy link

glebius commented Mar 21, 2017

Which requires me to leak my personal information to Google or lie to them :(

@glebius
Copy link

glebius commented Mar 21, 2017

@gopherbot
Copy link

CL https://golang.org/cl/38422 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/38426 mentions this issue.

@gopherbot
Copy link

CL https://golang.org/cl/38430 mentions this issue.

gopherbot pushed a commit that referenced this issue Mar 21, 2017
I broke FreeBSD 9 in https://golang.org/cl/38426 by using Pipe2.

We still want to support FreeBSD 9 for one last release (Go 1.9 will
be the last), and FreeBSD 9 doesn't have Pipe2.

So this still uses Pipe2, but falls back to Pipe on error.

Updates #18854
Updates #19072

Change-Id: I1de90fb83606c93fb84b4b86fba31e207a702835
Reviewed-on: https://go-review.googlesource.com/38430
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
@gopherbot
Copy link

Change https://golang.org/cl/64910 mentions this issue: all: drop support for FreeBSD 9 or below

gopherbot pushed a commit that referenced this issue Nov 28, 2017
This change drops the support for FreeBSD 9 or below and simplifies
platform-dependent code for the sake of maintenance.

Updates #7187.
Fixes #11412.
Updates #16064.
Updates #18854.
Fixes #19072.

Change-Id: I9129130aafbfc7d0d7e9b674b6fc6cb31b7381be
Reviewed-on: https://go-review.googlesource.com/64910
Reviewed-by: Ian Lance Taylor <iant@golang.org>
@golang golang locked and limited conversation to collaborators Sep 20, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants