Skip to content

bazel: generate //go:generate sh generate.sh within Bazel#61029

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
alan-mas:57787-wkt-generated
Mar 1, 2021
Merged

bazel: generate //go:generate sh generate.sh within Bazel#61029
craig[bot] merged 1 commit intocockroachdb:masterfrom
alan-mas:57787-wkt-generated

Conversation

@alan-mas
Copy link
Copy Markdown
Contributor

@alan-mas alan-mas commented Feb 23, 2021

Part of #57787 work.

As gazelle is not taking care by itself in any changes related to //go:generate ... (anything that has a go run as a prefix) we are creating a genrule and we need to handle every each of them separately.

We are creating a genrule based on pkg/geo/wkt/generate.sh to avoid change that script as it seems it is only used to "change" a flag (has a TODO task inside it).

Release note: None
Release justification: non-production code change

@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Feb 23, 2021

Thank you for contributing to CockroachDB. Please ensure you have followed the guidelines for creating a PR.

My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI.

I have added a few people who may be able to assist in reviewing:

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@blathers-crl blathers-crl bot added O-community Originated from the community X-blathers-triaged blathers was able to find an owner labels Feb 23, 2021
@blathers-crl blathers-crl bot requested a review from otan February 23, 2021 22:05
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@alan-mas alan-mas requested review from rickystewart and removed request for otan February 23, 2021 22:05
outs = ["wkt_generated.go"],
cmd = """
$(location @org_golang_x_tools//cmd/goyacc) -o $(location wkt_generated.go) -p "wkt" $(location wkt.y)
cat $(location wkt_generated.go) | sed -e 's/wktErrorVerbose = false/wktErrorVerbose = true/' > wkt_generated.go.tmp
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the -i option to sed so you don't have to make a temporary file yourself.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

-i works different on OSX and linux :\ (-i "" in OSX, -i in linux) -- theyre not compatible...

Copy link
Copy Markdown
Contributor Author

@alan-mas alan-mas Feb 23, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^^
Yes I tried that and make it work, but at my local (OSX) adding an additional flag .

So I think is better to stay with this rename file strategy to avoid issues with -i as @otan said

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i love technology 🙄


# Based on pkg/geo/wkt/generate.sh file
genrule(
name = "wtk-generated",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wkt-generated

@alan-mas alan-mas force-pushed the 57787-wkt-generated branch from 70a81ce to e0a021d Compare February 23, 2021 22:43
@blathers-crl blathers-crl bot requested a review from otan February 23, 2021 22:43
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Feb 23, 2021

Thank you for updating your pull request.

My owl senses detect your PR is good for review. Please keep an eye out for any test failures in CI.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@alan-mas alan-mas force-pushed the 57787-wkt-generated branch from e0a021d to 5c011e9 Compare February 23, 2021 22:46
@blathers-crl
Copy link
Copy Markdown

blathers-crl bot commented Feb 24, 2021

Thank you for updating your pull request.

Before a member of our team reviews your PR, I have some potential action items for you:

  • We notice you have more than one commit in your PR. We try break logical changes into separate commits, but commits such as "fix typo" or "address review commits" should be squashed into one commit and pushed with --force
  • Please ensure your git commit message contains a release note.
  • When CI has completed, please ensure no errors have appeared.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@alan-mas alan-mas force-pushed the 57787-wkt-generated branch 5 times, most recently from a7f013b to e5a5012 Compare February 26, 2021 15:38
@otan
Copy link
Copy Markdown
Contributor

otan commented Feb 28, 2021

bors r=rickystewart

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 28, 2021

Build failed:

@otan
Copy link
Copy Markdown
Contributor

otan commented Feb 28, 2021

looks like its failing lint

As gazelle is not taking care by itself in any changes related to //go:generate ... (anything that has a go run as a prefix) we are creating a genrule and we need to handle every each of them separately.

We are creating a genrule based on pkg/geo/wkt/generate.sh to avoid change that script as it seems it is only used to "change" a flag (has a TODO task inside it).

Release note: None

Release justification: non-production code change
@alan-mas alan-mas force-pushed the 57787-wkt-generated branch from e5a5012 to b8e5e4d Compare March 1, 2021 17:05
@alan-mas alan-mas removed the request for review from otan March 1, 2021 17:06
@rickystewart
Copy link
Copy Markdown
Collaborator

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 1, 2021

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Mar 1, 2021

Build succeeded:

@craig craig bot merged commit 09514e9 into cockroachdb:master Mar 1, 2021
@alan-mas alan-mas deleted the 57787-wkt-generated branch March 1, 2021 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

O-community Originated from the community X-blathers-triaged blathers was able to find an owner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants