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

build: Make bazel auto-generate pkg/sql/lexbase/reserved_keywords.go in the bazel sandbox #56062

Closed
jlinder opened this issue Oct 28, 2020 · 2 comments
Assignees
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Comments

@jlinder
Copy link
Collaborator

jlinder commented Oct 28, 2020

Needed for bazel to build without first requiring a make invocation. (ref PR, slack conversation)

@jlinder jlinder added C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception) A-build-system labels Oct 28, 2020
@kenliu
Copy link

kenliu commented Nov 30, 2020

see related issue #56019

@rickystewart rickystewart self-assigned this Dec 8, 2020
rickystewart added a commit to rickystewart/cockroach that referenced this issue Dec 8, 2020
Previously, `reserved_keywords.go` not being declared as a proper
dependency in our Bazel build meant that you had to `make buildshort`
before building `cockroach-short` with Bazel to make the file. We port
the logic for generating `reserved_keywords.go` over to the appropriate
`BUILD.bazel`, and properly declare the dependency, to fix this.

Closes cockroachdb#56062.

Release note: None
alan-mas added a commit to alan-mas/cockroach that referenced this issue Dec 8, 2020
and it is about to Bazelize SQL parser files cockroachdb#56061 and cockroachdb#56062:
- pkg/sql/parser/helpmap_test.go
- pkg/sql/parser/help_messages.go
- pkg/sql/lex/tokens.go
- pkg/sql/lex/keywords.go
- pkg/sql/lexbase/reserved_keywords.go

We are adding new Bazel genrules inside 3 main Build files:
- pkg/sql/parser/BUILD.bazel
- pkg/sql/lex/BUILD.bazel
- pkg/sql/lexbase/BUILD.bazel

And adding permissions (chmod 755) so we can execute these files:
- pkg/sql/parser/help.awk
- pkg/sql/parser/reserved_keywords.awk
- pkg/sql/parser/sql.y

Finally we are excluding all SQLPARSER_TARGETS from main BUILD file to avoid gazelle removing them.

Release note: None
@irfansharif
Copy link
Contributor

Fixed in #57705.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-build-system C-enhancement Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants