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

cmd/vet: support cgo packages #4889

Closed
mewmew opened this issue Feb 24, 2013 · 19 comments

Comments

Projects
None yet
9 participants
@mewmew
Copy link
Contributor

commented Feb 24, 2013

What steps will reproduce the problem?
a.go located at http://play.golang.org/p/w44ApVc-Kr
1. go run a.go
2. go vet a.go

What is the expected output?
Output from go run:
%!s(int=5)

Output from go vet:
a.go:7: arg for printf verb %s of wrong type
exit status 1

What do you see instead?
Output from go run:
%!s(int=5)

Output from go vet:
vet: a.go:3:8: could not import C (can't find import: C)
exit status 1

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
Linux

Which version are you using?  (run 'go version')
go version devel +8eb896294200 Sat Feb 23 15:08:36 2013 -0800 linux/amd64
@minux

This comment has been minimized.

Copy link
Member

commented Feb 24, 2013

Comment 1:

type-checking cgo program is not easy, we will need first call "go build -work" to get
cgo-generated Go source files before type-checking, perhaps we could just make
go/types ignore import "C".
@adg

This comment has been minimized.

Copy link
Contributor

commented Feb 25, 2013

Comment 3:

Labels changed: added priority-later, removed priority-triage.

Status changed to Accepted.

@gopherbot

This comment has been minimized.

Copy link

commented Feb 28, 2013

Comment 4 by rnd0x00:

Related to this issue is the following example.
b.go located at: http://play.golang.org/p/dyr3_PAwhl
[~]$ go vet b.go
b.go:10: arg for printf verb %s of wrong type: invalid type
exit status 1
The error is no longer "could not import C (can't find import: C)", but instead an
inaccurate vetting error.
@alberts

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2013

Comment 5:

also saw this:
foo.go:374: %!s(<nil>) composite literal uses untagged fields
foo.go:376: %!s(<nil>) composite literal uses untagged fields
those lines have:
maxwait := C.struct_timeval{1, 500 * 1000}
poll := C.struct_timeval{0, 10 * 1000}
@alberts

This comment has been minimized.

Copy link
Contributor

commented Mar 5, 2013

@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 12, 2013

Comment 7:

[The time for maybe has passed.]

Labels changed: removed go1.1maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2013

Comment 8:

Labels changed: added go1.2maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 30, 2013

Comment 9:

Labels changed: added feature.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Aug 9, 2013

Comment 10:

A number of the examples in this issue work now because they were unrelated to the main
topic. Recent changes have made go vet more robust and accurate even when typechecking
fails.
Top example:
z.go:7: arg 5 for printf verb %s of wrong type: int
Second example: silence.
Deferring to 1.3; the cgo issue that is the real one here remains hard.

Labels changed: added go1.3maybe, removed go1.2maybe.

@robpike

This comment has been minimized.

Copy link
Contributor

commented Aug 20, 2013

Comment 11:

Labels changed: removed go1.3maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2013

Comment 12:

Labels changed: added go1.3maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Nov 27, 2013

Comment 13:

Labels changed: removed feature.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2013

Comment 14:

Labels changed: added release-none, removed go1.3maybe.

@rsc

This comment has been minimized.

Copy link
Contributor

commented Dec 4, 2013

Comment 15:

Labels changed: added repo-tools.

@mewmew mewmew added accepted labels Dec 4, 2013

@rsc rsc added this to the Unplanned milestone Apr 10, 2015

@rsc rsc changed the title cmd/vet: support cgo packages x/tools/cmd/vet: support cgo packages Apr 14, 2015

@rsc rsc modified the milestones: Unreleased, Unplanned Apr 14, 2015

@rsc rsc removed the repo-tools label Apr 14, 2015

@mewmew

This comment has been minimized.

Copy link
Contributor Author

commented Jan 19, 2017

Close the issue for now as it has remained inactive for more than 6 months.

Anyone with more insight into the current status may re-open the issue or add a comment about the current progress.

@mewmew mewmew closed this Jan 19, 2017

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jan 19, 2017

I thought @mdempsky was still interested in this.

@mewmew

This comment has been minimized.

Copy link
Contributor Author

commented Jan 19, 2017

I thought @mdempsky was still interested in this.

Matthew, you may re-open this issue if you are still interested in it. I decided to close it, as it had been placed in the Go "black hole" that is the unreleased milestone.

Didn't mean to close it if you still had an interest in it.

Cheers /u

@bradfitz bradfitz reopened this Jan 19, 2017

@bradfitz bradfitz modified the milestones: Unplanned, Unreleased Jan 19, 2017

@bradfitz

This comment has been minimized.

Copy link
Member

commented Jan 19, 2017

@mewmew, "unreleased" doesn't mean blackhole. It means it's not shipped with Go so it can be fixed at any point. But now that vet is part of the standard library, Unreleased is no longer appropriate.

See also: #16623

@bradfitz bradfitz modified the milestones: Go1.9Maybe, Unplanned Jan 19, 2017

@bradfitz bradfitz changed the title x/tools/cmd/vet: support cgo packages cmd/vet: support cgo packages Jan 19, 2017

@bradfitz bradfitz modified the milestones: Go1.10, Go1.9Maybe Jun 7, 2017

@gopherbot

This comment has been minimized.

Copy link

commented Oct 31, 2017

Change https://golang.org/cl/74750 mentions this issue: cmd/go: pass package config to vet during "go vet"

@gopherbot gopherbot closed this in 5617864 Nov 1, 2017

@golang golang locked and limited conversation to collaborators Nov 1, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.