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

go_test: fix filtering of _cgo files in external archives #1425

Merged
merged 1 commit into from
Apr 3, 2018

Conversation

jayconrod
Copy link
Contributor

Previously, new files that were generated by cgo (those prefixed with
_cgo, like _cgo_gotypes.go, not those ending with .cgo1.go) were
compiled automatically without any filter for tags or package
names. This broke combined tests with an external component that
depended on library that contained cgo: the _cgo files would get
compiled into the external archive since the compile builder did not
filter them by package name. This caused errors when package names in
source files did not match.

With this change, in analysis, we treat cgo files like regular source
files. In the compile builder, we filter them normally, except we
don't check build constraints (these files would always be excluded,
since they start with '_').

Previously, new files that were generated by cgo (those prefixed with
_cgo, like _cgo_gotypes.go, not those ending with .cgo1.go) were
compiled automatically without any filter for tags or package
names. This broke combined tests with an external component that
depended on library that contained cgo: the _cgo files would get
compiled into the external archive since the compile builder did not
filter them by package name. This caused errors when package names in
source files did not match.

With this change, in analysis, we treat cgo files like regular source
files. In the compile builder, we filter them normally, except we
don't check build constraints (these files would always be excluded,
since they start with '_').
@jayconrod jayconrod merged commit ecd4fee into bazel-contrib:master Apr 3, 2018
@jayconrod jayconrod deleted the fix-cgo-tests branch April 3, 2018 15:23
jayconrod added a commit that referenced this pull request Apr 4, 2018
Previously, new files that were generated by cgo (those prefixed with
_cgo, like _cgo_gotypes.go, not those ending with .cgo1.go) were
compiled automatically without any filter for tags or package
names. This broke combined tests with an external component that
depended on library that contained cgo: the _cgo files would get
compiled into the external archive since the compile builder did not
filter them by package name. This caused errors when package names in
source files did not match.

With this change, in analysis, we treat cgo files like regular source
files. In the compile builder, we filter them normally, except we
don't check build constraints (these files would always be excluded,
since they start with '_').
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants