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

Gazelle: split merging into two stages #1099

Merged
merged 1 commit into from
Dec 4, 2017

Conversation

jayconrod
Copy link
Contributor

We need to merge some attributes on rules before indexing them. In
particular, we need to merge "importpath" and "srcs", since these
become keys in the index. It's important to account for '# keep'
comments and '# gazelle:ignore' directives so we need to use the
regular merging algorithm instead of something ad hoc in the indexer.
However, we also need to merge deps after they're resolved.

This means that we need to merge rules in two separate phases. Right
after rules are generated, we merge everything except "deps". Then we
resolve dependencies. Then we merge "deps" only.

This should also prevent us from indexing rules that are deleted.

Related #859

We need to merge some attributes on rules before indexing them. In
particular, we need to merge "importpath" and "srcs", since these
become keys in the index. It's important to account for '# keep'
comments and '# gazelle:ignore' directives so we need to use the
regular merging algorithm instead of something ad hoc in the indexer.
However, we also need to merge deps after they're resolved.

This means that we need to merge rules in two separate phases. Right
after rules are generated, we merge everything except "deps". Then we
resolve dependencies. Then we merge "deps" only.

This should also prevent us from indexing rules that are deleted.

Related bazel-contrib#859
@jayconrod
Copy link
Contributor Author

Jenkins test this please

1 similar comment
@jayconrod
Copy link
Contributor Author

Jenkins test this please

@jayconrod
Copy link
Contributor Author

The Travis CI failure is because run_non_bazel_tests.bash is missing. I believe Travis CI is reading the configuration from master instead of this branch.

Since the tests actually did run and pass, I'm force submitting.

@jayconrod jayconrod merged commit 3930b2c into bazel-contrib:master Dec 4, 2017
@jayconrod jayconrod deleted the gazelle-split-merge branch December 4, 2017 20:22
codesuki added a commit to codesuki/rules_go that referenced this pull request Dec 8, 2017
bazel-contrib#1099 introduced a nil pointer exception happening when BUILD files contain a # keep note.
jayconrod pushed a commit that referenced this pull request Dec 8, 2017
#1099 introduced a nil pointer exception happening when BUILD files contain a # keep note.
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.

2 participants