bazelbuild / bazel

a fast, scalable, multi-language and extensible build system
https://bazel.build
Apache License 2.0
23k stars 4.03k forks source link

//third_party/protobuf/protoc-*.exe files should point to //third_party/protobuf/3.0.0/protoc-*.exe #2066

Closed cgrushko closed 7 years ago

cgrushko commented 7 years ago

Code: https://bazel-review.googlesource.com/#/c/7312/1/src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java

I have a proto field of type map<>, which I want to populate in the code above.

I'm able to build Bazel with another Bazel, but can't bootstrap it:

$ ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
  Building Bazel from scratch../usr/local/buildtools/java/jdk8-google-v7-64/bin/javac -classpath third_party/apache_commons_lang/commons-lang-2.6.jar:third_party/apache_commons_compress/apache-commons-compress-1.9.jar:third_party/junit/junit-4.11.jar:third_party/hazelcast/hazelcast-3.5.4.jar:third_party/hazelcast/hazelcast-client-3.6.4.jar:third_party/hazelcast/hazelcast-3.6.4.jar:third_party/hazelcast/hazelcast-client-3.5.4.jar:third_party/apache_commons_codec/commons-codec-1.9.jar:third_party/apache_commons_collections/commons-collections-3.2.2.jar:third_party/ijar/test/libwrongcentraldir.jar:third_party/apache_commons_logging/commons-logging-1.1.1.jar:third_party/joda_time/joda-time-2.3.jar:third_party/jcip_annotations/jcip-annotations-1.0-1.jar:third_party/plexus_interpolation/plexus-interpolation-1.22.jar:third_party/jimfs/jimfs-1.1-rc1.jar:third_party/gson/gson-2.2.4.jar:third_party/xz/xz-1.5.jar:third_party/pcollections/pcollections-2.1.2.jar:third_party/plexus_component_annotations/plexus-component-annotations-1.6.jar:third_party/jsch/jsch-0.1.51.jar:third_party/maven/maven-builder-support-3.3.3.jar:third_party/maven/maven-settings-builder-3.3.3.jar:third_party/maven/maven-settings-3.3.3.jar:third_party/tomcat_annotations_api/tomcat-annotations-api-8.0.5.jar:third_party/apache_httpclient/httpclient-4.2.5.jar:third_party/apache_commons_pool2/commons-pool2-2.3.jar:third_party/netty/netty-all-4.1.0.CR6.jar:third_party/auto/auto-common-0.3.jar:third_party/auto/auto-service-1.0-rc2.jar:third_party/auto/auto-value-1.2.jar:third_party/jsr330_inject/javax.inject.jar:third_party/android_common/com.android.tools.build_builder_0.13.3.jar:third_party/android_common/com.android.tools_repository_25.0.0.jar:third_party/android_common/com.android.tools.build_manifest-merger_23.1.3.jar:third_party/android_common/com.android.tools_common_23.1.3.jar:third_party/android_common/com.android.tools_sdk-common_23.1.3.jar:third_party/android_common/com.android.tools.layoutlib_layoutlib_25.0.0.jar:third_party/android_common/com.android.jill_api_0.9.0.jar:third_party/android_common/com.android.tools_common_25.0.0.jar:third_party/android_common/com.android.tools.build_builder-model_2.0.0.jar:third_party/android_common/com.android_annotations_25.0.0.jar:third_party/android_common/com.android.tools_ddmlib_25.0.0.jar:third_party/android_common/com.android.jack_api_0.9.0.jar:third_party/android_common/com.android.tools.build_builder-model_0.13.3.jar:third_party/android_common/com.android.tools.build_manifest-merger_25.0.0.jar:third_party/android_common/com.android.tools_sdklib_25.0.0.jar:third_party/android_common/com.android.tools_dvlib_25.0.0.jar:third_party/android_common/com.android.tools.layoutlib_layoutlib_23.1.3.jar:third_party/android_common/com.android.tools.build_builder_2.0.0.jar:third_party/android_common/com.android.tools_sdklib_23.1.3.jar:third_party/android_common/com.android.tools_sdk-common_25.0.0.jar:third_party/android_common/com.android.tools.build_builder-test-api_2.0.0.jar:third_party/hamcrest/hamcrest-core-1.3.jar:third_party/guava/guava-19.0.jar:third_party/guava/guava-testlib-21.0-20161101.jar:third_party/guava/guava-testlib.jar:third_party/guava/guava-21.0-20161101.jar:third_party/plexus_utils/plexus-utils-3.0.21.jar:third_party/apache_httpcore/httpcore-4.2.4.jar:third_party/slf4j/slf4j-jdk14-1.7.7.jar:third_party/slf4j/slf4j-api-1.7.7.jar:third_party/jsr305/jsr-305.jar:third_party/jgit/org.eclipse.jgit-4.0.1.201506240215-r.jar:third_party/asm/asm-util-5.0.4.jar:third_party/asm/asm-5.0.3.jar:third_party/asm/asm-commons-5.0.4.jar:third_party/asm/asm-5.0.4.jar:third_party/error_prone/error_prone_annotations-2.0.13.jar:third_party/error_prone/error_prone_annotation-2.0.13.jar:third_party/error_prone/error_prone_core-2.0.13.jar:third_party/maven_model/maven-repository-metadata-3.2.3.jar:third_party/maven_model/maven-aether-provider-3.2.3.jar:third_party/maven_model/maven-model-builder-3.2.3.jar:third_party/maven_model/maven-model-3.2.3.jar:third_party/checker_framework_dataflow/dataflow-1.8.10.jar:third_party/java/jarjar/jarjar-1.4.jar:third_party/java/android_databinding/exec.jar:third_party/java/apksig/apksigner_deploy.jar:third_party/aether/aether-transport-wagon-1.0.0.v20140518.jar:third_party/aether/aether-transport-http-1.0.0.v20140518.jar:third_party/aether/aether-spi-1.0.0.v20140518.jar:third_party/aether/aether-transport-classpath-1.0.0.v20140518.jar:third_party/aether/aether-connector-basic-1.0.0.v20140518.jar:third_party/aether/aether-transport-file-1.0.0.v20140518.jar:third_party/aether/aether-impl-1.0.0.v20140518.jar:third_party/aether/aether-util-1.0.0.v20140518.jar:third_party/aether/aether-api-1.0.0.v20140518.jar:third_party/bytebuddy/byte-buddy-dep-0.7-rc6.jar:third_party/apache_velocity/velocity-1.7.jar:third_party/mockito/mockito-all-1.10.19.jar:third_party/truth/truth-0.28.jar:third_party/dagger/dagger-2.5.jar:third_party/dagger/dagger-compiler-2.5.jar:third_party/dagger/dagger-producers-2.5.jar:third_party/protobuf/3.0.0/protobuf-java-3.0.0.jar:third_party/protobuf/protobuf-java-3.0.0-beta-1.jar:third_party/protobuf/protobuf-java-3.0.0-beta-4.jar::third_party/grpc/grpc-netty-0.15.0.jar:third_party/grpc/grpc-protobuf-0.15.0.jar:third_party/grpc/grpc-core-0.15.0.jar:third_party/grpc/grpc-protobuf-lite-0.15.0.jar:third_party/grpc/grpc-stub-0.15.0.jar::/tmp/bazel_OCd70Pic -sourcepath src/java_tools/singlejar/java/com/google/devtools/build/zip:src/main/java:src/tools/xcode-common/java/com/google/devtools/build/xcode/common:src/tools/xcode-common/java/com/google/devtools/build/xcode/util:third_party/java/dd_plist/java:/tmp/bazel_OCd70Pic/src -d /tmp/bazel_OCd70Pic/classes -source 1.8 -target 1.8 -encoding UTF-8 @/tmp/bazel_HY7ZfA4k/param
src/main/java/com/google/devtools/build/lib/actions/AbstractAction.java:456: error: cannot find symbol
        result.putAspectParameters(
              ^
  symbol:   method putAspectParameters(String,StringList)
  location: variable result of type Builder
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error

Anyone has ideas?

cgrushko commented 7 years ago

@lberki you mentioned something about proto maps in Bazel not working? @damienmg can you route to someone who's familiar with Bazel's bootstrapping?

lberki commented 7 years ago

Dunno... I mentioned this on the general principle that proto maps are new-ish.

cgrushko commented 7 years ago

Figured it out - the bootstrap script uses //thirdparty/protobuf/protoc-.exe, which is actually 3.0.0-beta4, while Bazel proper uses //thirdparty/protobuf/3.0.0/protoc-.exe, which is 3.0.0.

I assume there's been an API change between beta4 and 3.0.0.

I fixed it by pointing the bootstrap script at the /3.0.0/protoc-*.exe, and I will next delete the outdated binaries.

As a long-term solution, we should replace //third_party/protobuf/protoc-*.exe with scripts that call into the /3.0.0/ subdirectory.

@aehlig Kristina tells me it might be on your turf?

aehlig commented 7 years ago

@aehlig Kristina tells me it might be on your turf?

The protoc binaries are going away anyway, so that bootstrapping will only use the pregenerated output of protoc. See the design document https://bazel.build/designs/2016/10/11/distribution-artifact.html

The patch is actually ready, https://bazel-review.googlesource.com/#/c/6731/ however blocked on our internal testing machinery which still assumes you can basically just checkout and run compile.sh; as soon as this is fixed, that patch will be submitted. @damienmg might know the more precise time line.

Klaus Aehlig Google Germany GmbH, Erika-Mann-Str. 33, 80636 Muenchen Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschaeftsfuehrer: Matthew Scott Sucherman, Paul Terence Manicle

aehlig commented 7 years ago

I believe this is fixed now. ed787feff0a6f532ee0432fed75806553f2fd77b removed the outdated versions of protoc, including outdated jars. Also, since e72d7a07d6f6e13feee87e16d48fee9dd3857eee we build protoc from source; in fact, the binaries have been removed.