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

x/playground: cgo builds fail (e.g., importing "net" package) because "gcc" executable not found in $PATH #44714

Closed
bradfitz opened this issue Mar 1, 2021 · 4 comments
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@bradfitz
Copy link
Contributor

bradfitz commented Mar 1, 2021

The playground is currently broken. e.g. https://play.golang.org/p/NbF8QOGEaYB

package main

import (
	"fmt"
	"net"
)

func main() {
	fmt.Println(net.ParseIP("1.2.3.4"))
}

Results in:

# net
cgo: exec gcc: exec: "gcc": executable file not found in $PATH

Go build failed.

/cc @dmitshur

@gopherbot gopherbot added this to the Unreleased milestone Mar 1, 2021
@dmitshur
Copy link
Contributor

dmitshur commented Mar 1, 2021

We've recently changed PATH as part of fixing for Go 1.16, maybe this is relevant.

CC @toothrot.

@dmitshur dmitshur added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Mar 1, 2021
@dmitshur dmitshur changed the title x/playground: cgo: exec gcc: exec: "gcc": executable file not found in $PATH x/playground: cgo builds fail (e.g., importing "net" package) because "gcc" executable not found in $PATH Mar 1, 2021
@toothrot toothrot self-assigned this Mar 1, 2021
@toothrot toothrot added this to In Progress in Go Release Team Mar 1, 2021
@toothrot
Copy link
Contributor

toothrot commented Mar 1, 2021

I'm not sure if it's a PATH issue as much as it could be an issue with how we're building Go now. I don't think gcc has been present in the final container for a while. I'll take a look.

@toothrot
Copy link
Contributor

toothrot commented Mar 1, 2021

We've determined that net is being marked stale now, and that this is broken as of golang.org/cl/295649 (golang/playground@9028cb5), but have yet to determine why.

@gopherbot
Copy link

Change https://golang.org/cl/297636 mentions this issue: all: set CGO_ENABLED=0 when building snippets

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
Archived in project
Development

No branches or pull requests

4 participants