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

Fixes for future Bazel changes #2

Closed
laurentlb opened this issue Feb 7, 2019 · 5 comments
Closed

Fixes for future Bazel changes #2

laurentlb opened this issue Feb 7, 2019 · 5 comments

Comments

@laurentlb
Copy link
Contributor

Based on our CI tests (https://buildkite.com/bazel/bazel-at-release-plus-incompatible-flags/builds/95), it looks like the project fails with the following flags:

  • --incompatible_new_actions_api
  • --incompatible_bzl_disallow_load_after_statement
  • --incompatible_no_support_tools_in_action_inputs
  • --incompatible_merge_genfiles_directory
  • --incompatible_disable_deprecated_attr_params
  • --incompatible_no_transitive_loads

Let me know if you need help with this. The error messages should provide enough information (otherwise, check Bazel issue tracker on GitHub for extra information).

@ensonic
Copy link
Contributor

ensonic commented Feb 7, 2019

Thanks for the heads up - We seems to be hitting this one:
bazelbuild/bazel#7347

bazel build --show_progress_rate_limit=5 --curses=yes --color=yes --verbose_failures --keep_going --jobs=32 --announce_rc --experimental_multi_threaded_digest --sandbox_tmpfs_path=/tmp --remote_timeout=60 --disk_cache= --remote_max_connections=200 --host_platform_remote_properties_override=properties:{name:"platform" value:"ubuntu1804"} --google_default_credentials --remote_http_cache=https://storage.googleapis.com/bazel-untrusted-buildkite-cache --incompatible_new_actions_api incompatible_bzl_disallow_load_after_statement --incompatible_no_support_tools_in_action_inputs --incompatible_disallow_filetype --incompatible_merge_genfiles_directory --incompatible_no_transitive_loads --incompatible_disable_deprecated_attr_params --incompatible_disallow_load_labels_to_cross_package_boundaries --incompatible_disallow_dict_plus --incompatible_disallow_struct_provider_syntax --incompatible_disallow_old_style_args_add //...
--
  | ERROR: Unrecognized option: --incompatible_disallow_struct_provider_syntax
  | INFO: Invocation ID: 9abf76f6-fde8-4128-a8e3-c99c2a5365f9

but there is no context in the error message due to which rule this is. A quick search show 3 cases where we return a struct:

$ find bazel -name "*.bzl" -exec grep -Hn "return struct" {} \;
bazel/build_rules/app_chart/run_sequentially.bzl:27:    return struct(runfiles = ctx.runfiles(files = runfiles))
bazel/build_rules/app_chart/cache_gcr_credentials.bzl:24:    return struct(runfiles = ctx.runfiles(files = runfiles))
bazel/build_rules/app_chart/run_parallel.bzl:26:    return struct(runfiles = ctx.runfiles(files = runfiles))

but this does not match the examples in the bug I link to above.

@laurentlb
Copy link
Contributor Author

Sorry, I thought I replied to this earlier.
You can skip incompatible_disallow_struct_provider_syntax (your Bazel version doesn't support it, it was added very recently).

Other flags should give you clearer error messages.

@ensonic
Copy link
Contributor

ensonic commented Feb 20, 2019

Here is the latest
https://buildkite.com/bazel/bazel-at-release-plus-incompatible-flags/builds/109#685ded1f-9015-4616-8fb8-91a2826ac101
its still failing even though we e.g. just updated rules_docker. We'll keep trying on low prio.

cloud-robotics-github-robot pushed a commit that referenced this issue Feb 21, 2019

Verified

This commit was signed with the committer’s verified signature.
ewbankkit Kit Ewbank
This addresses use of single_file, and pulls in some changes to
rules_python from upstream. This is a contribution to
#2.

I have also sent a pull request for bazel_rules:
antonovvk/bazel_rules#2

There are many other failures, including:

- java_grpc_library.bzl from grpc/grpc-java
- protobuf.bzl from google/protobuf
- rules_go
- references to genfiles (this will be unified with `bin`).

Change-Id: Ic6548244f0906cdbd53aed16017191b6db8cd553
GitOrigin-RevId: daa70bc
laurentlb referenced this issue in bazelbuild/bazel Feb 22, 2019
Fixes #5822

RELNOTES: --incompatible_disallow_old_style_args_add is enabled by default.
PiperOrigin-RevId: 235053596
cloud-robotics-github-robot pushed a commit that referenced this issue Feb 26, 2019
With the recent fixes, it makes this repository compatible with Bazel
flag `--incompatible_disallow_old_style_args_add`

Progress towards #2

Closes #5
#5

ORIGINAL_AUTHOR=Laurent Le Brun <[email protected]>
GitOrigin-RevId: 0e362c4
Change-Id: I96a7a45b4383d053e9177f05ad5870646a83827d
@drigz
Copy link
Contributor

drigz commented Feb 28, 2019

A lot of our problems come from grpc/grpc-java, which doesn't appear to be on the Bazel CI, and protobuf, which should be better when 3.7.0 is released. In the long run, we should push for grpc-java to be added to the Bazel CI so they get notified directly.

@laurentlb
Copy link
Contributor Author

Yes, some problems are caused by grpc-java (grpc/grpc-java#5383).

cloud-robotics-github-robot pushed a commit that referenced this issue Feb 28, 2019
This pulls in some Bazel compatibility changes (#2).

Change-Id: I525f0edb7e15099a7a6df7850124b0bbcbf610d2
GitOrigin-RevId: 4cb1717
cloud-robotics-github-robot pushed a commit that referenced this issue Mar 5, 2019
- use .to_list() instead of iterating
- use depset() constructor instead of .union()

See #2.

Change-Id: I9bb75fe638e029f7b55dd3647c414e64f5c86066
GitOrigin-RevId: 8578828
cloud-robotics-github-robot pushed a commit that referenced this issue Mar 5, 2019
The old `.proto` provider will be removed in a future Bazel version.

See #2.

Change-Id: Id53260a1855f078d510779ad66cf23f9ede09a61
GitOrigin-RevId: f822b73
cloud-robotics-github-robot pushed a commit that referenced this issue Mar 5, 2019
Due to a change in how the dependencies work, we need to be careful to
load go_repository from deps.bzl, not def.bzl:

bazel-contrib/rules_go#1933

Additionally, Gazelle 0.17.0 seems to find the dependencies in
src/.gopath, so I've added a gazelle:ignore directive for them. At the
same time, I've added the path to .bazelignore, so that Bazel doesn't
try to build or run files in there.

This pulls in some Bazel compatibility fixes (#2).

Change-Id: Ic215ca30c0e6bb438e8fff134e439e4e4a032879
GitOrigin-RevId: 8c7708b
cloud-robotics-github-robot pushed a commit that referenced this issue Mar 5, 2019
This pulls in a Bazel compatibility fix. See #2.

Change-Id: Ib59f363c154a5132f5c641eea4cc5f683135c5b0
GitOrigin-RevId: 89269a1
cloud-robotics-github-robot pushed a commit that referenced this issue Mar 5, 2019
For historical reasons, Bazel has two directories for generated files,
although a future version of Bazel will remove the genfiles directory:
bazelbuild/bazel#6761

Currently, rosmsg() copies all the source files (*.msg, *.srv) to the
output directory, so that the directory structure matches the needs of
ROS's codegen tools. It uses a hacky way of finding the paths to the
transitive dependencies within the output directory, which includes a
direct reference to genfiles. By using output_to_bindir=True, we can
avoid the direct reference.

Fixing the hack would involve rewriting the rosmsg() macro to use a
rule, which wouldn't be too hard but might break compatibility.

See #2.

Change-Id: Ibae3451e1329e397329089aa6796c5477789c788
GitOrigin-RevId: e38ef5d
cloud-robotics-github-robot pushed a commit that referenced this issue Mar 27, 2019
This includes fixes to ensure compatibility with newer Bazel versions.

#2

Change-Id: Ic8b3dd22e6df68edfa5adc578e49501e3308e83f
GitOrigin-RevId: 6b4afa0
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

No branches or pull requests

3 participants