-
Notifications
You must be signed in to change notification settings - Fork 141
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
support mutiple platform/architect dependent definitions #1
base: master
Are you sure you want to change the base?
Conversation
} | ||
) | ||
|
||
func isPlatformDependent(f *token.File) bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this isn't sufficient. You can have files that are platform-dependent because of build tags, not just their file names.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes...But now I haven't found a good way to handle this, because we use the go/build's default context which is for current GOOS and GOARCH. If we want all platform/arch associated files, we need pass all the combinations of GOOS/GOARCH/CGO... Any idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're using the default context, how do we ever get more than one definition of a symbol with this code?
I have been pondering this issue for a while, as it also comes up in other contexts (for example, my godeps tool should really find dependencies from all architectures, which it currently does not).
Unfortunately I'm about out of time for the week now. I'll have a think over the weekend and when I get back on Monday.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I misunderstood...I have added the build tag support in the new patch set.
88f30c0
to
76939e5
Compare
when there are multiple platform/architect implements, all of them will be printed. Signed-off-by: Tw <[email protected]>
76939e5
to
212fe42
Compare
I have uploaded a new patch set, please help to review |
I'm sorry for taking so long to get around to reviewing this. I've spent A few issues that I noted when working through this:
Even though there are actually two alternative definitions of foo.X
because redeclared assumes that its second argument is the
I'm sorry - this isn't an easy problem, which is why I've put off doing it for so long! |
when there are multiple platform/architect implements,
all of them will be printed.