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

Made generated files more Buildifier compliant #260

Merged
merged 10 commits into from
Oct 21, 2020
Merged

Made generated files more Buildifier compliant #260

merged 10 commits into from
Oct 21, 2020

Conversation

UebelAndre
Copy link
Collaborator

@UebelAndre UebelAndre commented Oct 17, 2020

This addresses #192 (comment) and was already almost merged but was changed at the last minute. If Buildifier expects BUILD.{name}.bazel then cargo-raze should be compliant. Vendored files are already compliant by default with the default output_buildfile_suffix being BUILD.bazel

edit: Linked the wrong comment. Fixed that.

Copy link
Contributor

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

Thanks!

@UebelAndre
Copy link
Collaborator Author

Maybe a smoother/larger change would be to add a new field that controls the formatting of the "Remote" output files and rename output_buildfile_suffix to indicate that it only controls the "Vendored" output files. I feel the only benefit in doing this would be to maintain legacy behavior. I personally much prefer that these files output the standardized filenames and so am fine with having the "Remote" outputs always output BUILD.{crate}.bazel.

@acmcarther would probably have strong feelings about this. Hoping to hear from him.

@PiotrSikora
Copy link
Contributor

The BUILD.{crate}.bazel format was introduced quite recently (I think in v0.5.0), those files were previously named {crate}.BUILD, so I don't think there should be too much concern about maintaining legacy behavior.

@UebelAndre UebelAndre changed the title Remote output filenames are now Buildifier compliant Made generated files more Buildifier compliant Oct 17, 2020
@UebelAndre
Copy link
Collaborator Author

UebelAndre commented Oct 17, 2020

@PiotrSikora see 210083e

Man, that was a tough one. Friendly reminder to always challenge one's assumptions 😄

edit: This change also has your changes from #261 btw

@UebelAndre
Copy link
Collaborator Author

@acmcarther This PR is ready for review

@UebelAndre
Copy link
Collaborator Author

@PiotrSikora I want to explicitly thank you for opening your PR for sorting out the other attributes. That was SUUUUPER helpful in getting us on the same page 🙏 😄

@PiotrSikora
Copy link
Contributor

@UebelAndre awesome! Thanks for fixing this!

@PiotrSikora
Copy link
Contributor

Note: This should probably ship as v0.7.0, due to changes in artifact filenames.

Copy link
Member

@acmcarther acmcarther left a comment

Choose a reason for hiding this comment

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

LGTM % request to update settings.rs.

impl/src/planning.rs Outdated Show resolved Hide resolved
@UebelAndre
Copy link
Collaborator Author

@acmcarther this is ready for another review

Copy link
Member

@acmcarther acmcarther left a comment

Choose a reason for hiding this comment

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

PR generally looks good to me, but you've got more changes here that aren't related to the PR.

impl/src/planning/subplanners.rs Outdated Show resolved Hide resolved
impl/src/context.rs Show resolved Hide resolved
@UebelAndre UebelAndre mentioned this pull request Oct 20, 2020
impl/src/context.rs Outdated Show resolved Hide resolved
@UebelAndre
Copy link
Collaborator Author

There was still one case that was not being handled. I updated the PR to hopefully pass now but it required adding more leave-alones. @PiotrSikora I added a comment on this PR pointing that out.

@acmcarther Up to you if you still want to merge this. I think this is already a big improvement but don't know if that's just because I sank a bunch of time into it 😅

@acmcarther
Copy link
Member

I'm open to merging this and implementing correct sorting of the merged default_deps and additional_deps in a separate PR, but I don't feel strongly about it and would defer to @PiotrSikora's preference.

@UebelAndre
Copy link
Collaborator Author

@PiotrSikora @acmcarther How does the change look now?

Copy link
Contributor

@PiotrSikora PiotrSikora left a comment

Choose a reason for hiding this comment

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

@UebelAndre looks great, thanks!

@acmcarther acmcarther merged commit 2e7f0d8 into google:master Oct 21, 2020
@UebelAndre UebelAndre deleted the buildifier branch October 21, 2020 17:41
wchargin added a commit to tensorflow/tensorboard that referenced this pull request Nov 7, 2020
Summary:
Version 0.7.0 of `cargo-raze` was just released. Some visible changes:

  - can now set `[package.metadata.raze]` instead of `[raze]` to avoid a
    Cargo warning: <google/cargo-raze#274>
  - build files have been renamed and restructured to be more compliant
    with Buildifier: <google/cargo-raze#260>

If you have an old version installed, run `cargo install cargo-raze` to
update to the most recent version.

Changes to `third_party/rust/` generated with:

```
(rm -rf third_party/rust/ && cd tensorboard/data/server && cargo raze)
```

The changes to `Cargo.toml` and `third_party/rust/` are independent.

Test Plan:
Run `(cd tensorboard/data/server && cargo test)` and note that the tests
run without an “unused manifest key: raze” warning. Note further that
everything still builds with Bazel.

wchargin-branch: rust-regen-raze-0.7.0
wchargin-source: c73530a2f7948b4842617ff686f645e66e917d0d
wchargin added a commit to tensorflow/tensorboard that referenced this pull request Nov 10, 2020
Summary:
Version 0.7.0 of `cargo-raze` was just released. Some visible changes:

  - can now set `[package.metadata.raze]` instead of `[raze]` to avoid a
    Cargo warning: <google/cargo-raze#274>
  - build files have been renamed and restructured to be more compliant
    with Buildifier: <google/cargo-raze#260>

If you have an old version installed, run `cargo install cargo-raze` to
update to the most recent version.

Changes to `third_party/rust/` generated with:

```
(rm -rf third_party/rust/ && cd tensorboard/data/server && cargo raze)
```

The changes to `Cargo.toml` and `third_party/rust/` are independent.

Test Plan:
Run `(cd tensorboard/data/server && cargo test)` and note that the tests
run without an “unused manifest key: raze” warning. Note further that
everything still builds with Bazel.

wchargin-branch: rust-regen-raze-0.7.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants