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
Closed

cmd/vet: support cgo packages #4889

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

Comments

@mewmew
Copy link
Contributor

mewmew 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
Copy link
Member

minux 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
Copy link
Contributor

adg commented Feb 25, 2013

Comment 3:

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

Status changed to Accepted.

@gopherbot
Copy link

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
Copy link
Contributor

alberts 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
Copy link
Contributor

alberts commented Mar 5, 2013

Comment 6:

I think my issue probably just got fixed:
https://code.google.com/p/go/source/detail?r=eb28a75cdc403bcb2ba0210893494ca8a71c6e1e

@rsc
Copy link
Contributor

rsc commented Mar 12, 2013

Comment 7:

[The time for maybe has passed.]

Labels changed: removed go1.1maybe.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 8:

Labels changed: added go1.2maybe.

@rsc
Copy link
Contributor

rsc commented Jul 30, 2013

Comment 9:

Labels changed: added feature.

@robpike
Copy link
Contributor

robpike 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
Copy link
Contributor

robpike commented Aug 20, 2013

Comment 11:

Labels changed: removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 12:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 13:

Labels changed: removed feature.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 14:

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

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 15:

Labels changed: added repo-tools.

@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
Copy link
Contributor Author

mewmew 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 as completed Jan 19, 2017
@bradfitz
Copy link
Contributor

I thought @mdempsky was still interested in this.

@mewmew
Copy link
Contributor Author

mewmew 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
Copy link
Contributor

@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
Copy link

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

@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.
Projects
None yet
Development

No branches or pull requests

9 participants