aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
Commit message (Collapse)AuthorAge
* test_rules.bzl: Make Skylark rule forward compatibleGravatar David Ostrovsky2018-01-04
| | | | | | | This fixes "type 'depset' is not iterable. Use the `to_list()` method to get a list." warning. Change-Id: I10bd791ce15445469afb9e12b2246be583c77a4b
* Remove usages of `+` on dictsGravatar vladmos2018-01-03
| | | | | | | | | The `+` operator on dicts is deprecated and will be removed. This change makes Bazel files compatible with the new behavior. Fixes #4346. PiperOrigin-RevId: 180702882
* Refactor Windows C++ toolchain selectionGravatar Yun Peng2018-01-03
| | | | | | | | | | | | | | | | | | | We used to have --cpu=x64_windows_msys for selecting msys gcc toolchain, this is a misuse of --cpu flag. Instead, we should use --compiler flag to select C++ toolchain. For example, --compiler=msvc-cl, --compiler=msys-gcc, --compiler=mingw-gcc After this change, we can use mingw gcc toolchain by following steps: 1. In MSYS, install mingw by `pacman -S mingw-w64-x86_64-gcc` 2. Add /mingw64:/mingw64/bin into PATH 3. build with --compiler=mingw-gcc Related: https://github.com/bazelbuild/rules_go/issues/736 Change-Id: I4b5f77ce0698cfcafefe5d2ab17657f9c9e295d3 PiperOrigin-RevId: 180678829
* Use -no-canonical-prefixes when -fno-canonical-system-headers is not availableGravatar ibiryukov2018-01-02
| | | | | | | | | | | | Bazel's autoconf script adds -fno-canonical-system-headers to gcc's crosstool in order to get output in '.d' files that can be properly verified by bazel. To workaround the same issue in clang we have to use a different flag: '-no-canonical-prefixes'. The same issue arises with clang if it resides in the configured repository (e.g., when it is downloaded via 'repository_ctx.download'). PiperOrigin-RevId: 180552155
* Use relative paths for repository-local files in C++ crosstoolGravatar ibiryukov2018-01-02
| | | | | | | | | | | | | | | Generated crosstool previously used absolute paths for everything. However, when using a compiler, local to the repository (e.g., downloaded via 'repository_ctx.download'), relative paths should be used to avoid absolute paths that point into the crosstool repository. Specifically, this patch contains the following changes: 1. Replaces absolute paths in 'cxx_builtin_include' with relative if includes point inside the repository. 2. Removes the '-B<compiler-dir>' from 'compiler_flag' and 'linker_flag' sections when compiler is inside the repository. PiperOrigin-RevId: 180540359
* Enable switching def_parser's Windows target for remote executionGravatar Yun Peng2018-01-02
| | | | | | | | | | | | When --define EXECUTOR=remote is specified in bazel command, embedded tools 'def_parser' will be compiled remotely from source. Because def_parser itself is a cc_binary, if we want to compile it remotely, to avoid cycle dependency it cannot be a dependency of cc_toolchain. Therefore, we make it a dependency of cc rules. Change-Id: I77faf77238f8edd3585d0e5e5c780b14e9782a40 PiperOrigin-RevId: 180534568
* Retire the filegroup //tools/cpp:toolchain_category in favor of theGravatar cpeyser2017-12-21
| | | | | | cc_toolchain_type //tools/cpp:toolchain_type. PiperOrigin-RevId: 179818065
* Raise path error for failing read in GetTarFile.Gravatar Andreas Bergmeier2017-12-21
| | | | | | Closes #4282. PiperOrigin-RevId: 179783690
* Remove unused filegroup.Gravatar ajmichael2017-12-20
| | | | | RELNOTES: None PiperOrigin-RevId: 179760609
* Update bootclasspath handling for JDK 9Gravatar cushon2017-12-20
| | | | | | | rt.jar etc. no longer exist, retrieve the default bootclasspath contents using a Java program instead. PiperOrigin-RevId: 179747945
* Migrate uses of xcode_config_alias to use the recently-introduced skylark ↵Gravatar cparsons2017-12-20
| | | | | | | late bound default instead. RELNOTES: None. PiperOrigin-RevId: 179738235
* Add license field to cc auto-configure BUILD templates.Gravatar xingao2017-12-20
| | | | | | This makes sure the BUILD files we publish in https://github.com/bazelbuild/bazel-toolchains has the right license notice. PiperOrigin-RevId: 179686473
* Make cc_configure script more extensibleGravatar Ilya Biryukov2017-12-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a few extension points to cc_configure script with the ultimate goal to allow downloading the compiler and other tools used for C++ build before generating the crosstool. Specifically, we make the following changes: - Expose the implementation of a cc_autoconf repository rule under a name of cc_autoconf_impl. - Extend cc_autoconf_impl to allow overriding paths to build tools (i.e. compilers, linkers, etc.) - Allow to put any extra artifacts into the generated crosstool repository. All files inside 'extra_tools' folder are added into compiler_files, all_files and linker_files properties of the generated crosstool, so that they are available for the crosstool. With these extension one can do the following to download the compilers used for the build and configure the crosstool: - Create a repository_rule for the toolchain with a custom implementation. - In the implementation function of the repository rule: + Download the compilers and put them into `extra_tools` folder. + Run cc_autoconf_impl with overriden_tools set to relative paths of the compiler and other build tools in the extra_tools folder. Change-Id: I51af6b504578963b3e97bcdd1ccb6d0a5fed1c3e PiperOrigin-RevId: 179675911
* Windows MSYS CROSSTOOL: Remove /usr from cxx_builtin_include_directoryGravatar Yun Peng2017-12-20
| | | | | | | | | | After 8b3ba50246fed6ff13d70299fb039cc66be465c4, msys path should not appear in CROSSTOOL, because Bazel won't translate it anymore. Fix https://github.com/bazelbuild/bazel/issues/4318 Change-Id: I33d783a2ef14299e586856fefa2d68adce587045 PiperOrigin-RevId: 179667545
* Add java_toolchain definitions that work with JDK 8 and 9 host_javabasesGravatar cushon2017-12-19
| | | | | | | And inject the correct toolchain for the current host_javabase into tools.WORKSPACE. PiperOrigin-RevId: 179618337
* Python 3 fixes for tools/build_defs, jdk, objcGravatar Googler2017-12-19
| | | | | RELNOTES: None PiperOrigin-RevId: 179596587
* More updates to tools/android modules for compatibility with python 3.Gravatar Googler2017-12-19
| | | | | RELNOTES: None. PiperOrigin-RevId: 179577497
* Ensure that the target package in the <instrumentation> tag of the ↵Gravatar jingwen2017-12-19
| | | | | | | | | | | | instrumentation android_binary's AndroidManifest.xml references the correct package name of the instrumented android_binary. During an instrumentation test, ART will use the targetPackage specified in the instrumentation APK's AndroidManifest to determine the application to be instrumented. We can perform this check in Bazel at execution time, before the apps are loaded onto the device. See android_instrumentation_test_integration_test.sh for the e2e example. GITHUB: https://github.com/bazelbuild/bazel/issues/903 RELNOTES: None. PiperOrigin-RevId: 179564246
* Add two action types to the list of those requiring apple_envGravatar cparsons2017-12-18
| | | | | | | These two action types, 'linkstamp-compile' and 'c++-link-interface-dynamic-library', require use of the wrapped_clang tool, which requires apple_env to be set. RELNOTES: None. PiperOrigin-RevId: 179475470
* Update tools/ modules for compatibility with python 3.Gravatar Akira Baruah2017-12-18
| | | | | | | | | Fixes #4097. Fixes part of #4310. Closes #4265. PiperOrigin-RevId: 179437184
* Refactor flag access out of Adb._Exec() and into main().Gravatar Akira Baruah2017-12-13
| | | | | | | | | | Rather than access the `extra_adb_arg` command line flag directly, the `Adb` class now receives the flag value in its constructor, preventing an error where flags are accessed before they are parsed (prohibited in `absl.flags`). If the constructor arg isn't passed at all, the value stored in the `Adb` object defaults to an empty list. PiperOrigin-RevId: 178906612
* Fix windows_cc_configure after ↵Gravatar hlopko2017-12-13
| | | | | | | | | https://github.com/bazelbuild/bazel/commit/2aeaeba66857c561dd6d63c79a213f1cabc3650d Fixes #4288 RELNOTES: None. PiperOrigin-RevId: 178889458
* When linking mostly-static Linux binaries, link libstdc++.a explicitly.Gravatar John Millikin2017-12-12
| | | | | | | | | | | | | | | | | | This allows libstdc++ to be statically linked, which is normally only possible when invoking GCC as `g++` with the `-static-libstdc++` flag. Fixes https://github.com/bazelbuild/bazel/issues/2840 See https://github.com/envoyproxy/envoy/issues/415 for additional background and context. cc @htuch (for Envoy) and @calpeyser @hlopko (who I talked to earlier about this) I'm only doing this in the Linux toolchain because MacOS doesn't do static linking of system libs anyway, and I don't know enough about Windows or FreeBSD to test on those platforms. Closes #4031. PiperOrigin-RevId: 178762357
* Fix bash in osx_cc_wrapperGravatar hlopko2017-12-12
| | | | | RELNOTES: None. PiperOrigin-RevId: 178745230
* Use C++-only toolchain on darwin when BAZEL_USE_CPP_ONLY_TOOLCHAIN env var ↵Gravatar hlopko2017-12-12
| | | | | | | | | | | | | is set to "1" By default when xcode is installed on darwin bazel will pick a toolchain that supports both C++ and ObjC. This cl allows the user to pick C++ only toolchain even when Xcode is installed. Fixes #4231. RELNOTES: None. PiperOrigin-RevId: 178745218
* Windows MSVC CROSSTOOL: Don't pass /DEBUG:FASTLINK to linker if it doesn't ↵Gravatar Yun Peng2017-12-11
| | | | | | | | | | | | | | support it This makes Bazel work nicer with VC++ version prior to VC++ 2015, but it doesn't mean we fully support them. For example, /WHOLEARCHIVE doesn't work with versions older that VC++ 2015, either. Fixed https://github.com/bazelbuild/bazel/issues/3109 Fixed https://github.com/bazelbuild/bazel/issues/4240 Change-Id: Iab7280bea241a203cb04dc9ca0a7b3bce518fb64 PiperOrigin-RevId: 178615516
* Implement @bazel_tools//tools/jdk:current_host_java_runtime .Gravatar lberki2017-12-08
| | | | | | | This is now possible because the Bazel release now supports TemplateVariableInfo. RELNOTES: None. PiperOrigin-RevId: 178360631
* Automated rollback of commit 7b540204eea9b003e19efe917abacf67270f5e02.Gravatar tomlu2017-12-06
| | | | | | | | | | | | | *** Reason for rollback *** Breaks rapid candidate creation *** Original change description *** This and further changes may contain minor modifications to BUILD files that don't serve any apparent purpose. The reason for these changes is that we're switching from checked-in BUILD files to generated BUILD files, and there may be small differences between these files. RELNOTES: None PiperOrigin-RevId: 178120126
* Fix some broken targets and failing tests.Gravatar ajmichael2017-12-06
| | | | | RELNOTES: None PiperOrigin-RevId: 178099410
* Add aapt2 to the filegroup of integration test dependencies.Gravatar ajmichael2017-12-05
| | | | | | | | | This will allow us to write a bazel integration test for --android_aapt=aapt2. Necessary for https://github.com/bazelbuild/bazel/issues/4103. RELNOTES: None PiperOrigin-RevId: 177980382
* This and further changes may contain minor modifications to BUILD files that ↵Gravatar tomlu2017-12-05
| | | | | | | don't serve any apparent purpose. The reason for these changes is that we're switching from checked-in BUILD files to generated BUILD files, and there may be small differences between these files. RELNOTES: None PiperOrigin-RevId: 177949511
* Add a 'fdo_optimize' feature to the auto-configured crosstool.Gravatar Benjamin Peterson2017-12-05
| | | | | | | | | | | Bazel's fallback action config for PGO optimization uses Google-internal compiler flags. Here, we provide a 'fdo_optimize' feature without these internal flags, so --fdo_optimize can work out of the box. This fixes https://github.com/bazelbuild/bazel/issues/1171. Change-Id: I1d40eb72211e7c5bea213de7d2c237ac2877b3a1 PiperOrigin-RevId: 177947264
* Add a //tools/jdk:host_jdk target.Gravatar lberki2017-12-05
| | | | | RELNOTES: None. PiperOrigin-RevId: 177944402
* Remove `-R` flags from the MacOS crosstool template.Gravatar John Millikin2017-12-04
| | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/4028 Closes #4029. PiperOrigin-RevId: 177813419
* Add an open-source version of find_cpp_toolchain, to allow open-source users ofGravatar cpeyser2017-12-04
| | | | | | | | the CppConfiguration Skylark API to migrate to platforms and toolchains. For more details on toolchains, please see https://docs.google.com/document/d/1-G-VPRLEj9VyfC6VrQBiR8To-dZjnBSQS66Y4nargGM/edit#heading=h.al54v2ddwqzv PiperOrigin-RevId: 177811908
* Windows: Expose find_vc_path and find_msvc_tool functionGravatar Yun Peng2017-12-01
| | | | | | | | | | | | | | | find_vc_path and find_msvc_tool are now visible from windows_cc_configure.bzl, users can do: load("@bazel_tools//tools/cpp:windows_cc_configure.bzl", "find_vc_path" "find_msvc_tool") to get Visual C++ path and find Visual C++ tools detected by Bazel in their repository rule. Change-Id: Ifb6d1f412e64251f413a59d3149d44ca2f8bc5d7 PiperOrigin-RevId: 177589321
* Move bazel conditions into src/conditions.Gravatar tomlu2017-11-30
| | | | | | | This will enable an easier transition from checked-in BUILD files to ones generated by copybara. RELNOTES: None PiperOrigin-RevId: 177514519
* Revert name of coverage_suppot to coverage_support.Gravatar cparsons2017-11-29
| | | | | | | The previous change was accidental. RELNOTES: None. PiperOrigin-RevId: 177330228
* Create the output source jar in java_common.compileGravatar elenairina2017-11-29
| | | | | | | | | | | | | | | | | and expose transitive source jars to Skylark. Initial change was rolled back (unknown commit). java_common.compile wouldn't fill the JavaRuleOutputJarsProvider when there was only one input source jar. Fixed that and added test (there was one before, but didn't check this particular provider). Slightly refactor java classes to take in specific host javabase inputs and host java executable for creating the source jar, instead of always relying on fetching them from native java rules specific attributes. Creating the output source jar in java_common.compile makes the behavior more similar to java_library. Exposing the transitive_source_jars to Skylark helps with the Skylark migration from the old 'java' provider to JavaInfo. Progress on #2614. RELNOTES: transitive_source_jars is now exposed on JavaInfo. PiperOrigin-RevId: 177311138
* Expressly fetch remote and ref when using git_repositoryGravatar Ed Baunton2017-11-29
| | | | | | | | | | | | | | | | When I clone from a git repo that doesn't have the default branch the same as the branch that I want ; it doesn't seem to fetch the appropriate branch. I am using a name rather than explicit sha. What happens is: ``` + git reset --hard build-with-bazel fatal: ambiguous argument 'build-with-bazel': unknown revision or path not in the working tree. ``` because it hasn't fetched that ref. Closes #4039. PiperOrigin-RevId: 177298578
* Handle spaces in absolute paths to tests.Gravatar Seth Greenstein2017-11-29
| | | | | | | | | | | | | | | | | | | | | | This allows for output_base paths that contain spaces, fixing #3897 The test path is set by grepping the MANIFEST, in which each line is a space-separated 2-tuple of relative path and absolute path to the test. Replace the awk command that extracts the second item in the space-separated list with a sed command that extracts everything after the first space. Also, quote the manifest path arg to the grep command. There will still be problems if there are spaces in the relative path, below the Bazel project root. Test: Built and tested a test with an output_base containing a space. Change-Id: I5dba285bb50c27eedace17a5e20efac7392a9a6e Closes #3899. Change-Id: I5dba285bb50c27eedace17a5e20efac7392a9a6e PiperOrigin-RevId: 177283695
* Various Shell Script Fixes and Improvements - Part OneGravatar Androbin2017-11-29
| | | | | | | | see #4023 Closes #4051. PiperOrigin-RevId: 177279457
* Remove uses of ar_flag and uses_action_config_for_arGravatar hlopko2017-11-23
| | | | | | | Bazel is not reading its value anyway. RELNOTES: None PiperOrigin-RevId: 176768851
* Automated rollback of commit 0ebb3e54fc890946ae6b3d059ecbd50e4b5ec840.Gravatar dmarting2017-11-22
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Cause rare case of test hanging. To cherry-pick for #3772 *** Original change description *** Attempting to fix an occasionally missing stdout from test.xml. In hello-world_test, when executed inside a docker container, for about 2% of the runs the test.xml has an empty CDATA, instead of the expected "Hello, world!". I'm not sure still what exactly was the bug, but in any case this change simplifies the test execution code line, so if this doesn't fix it, at least further debugging will be easier. I ran the test in a loop 1360 times, and the error did not reproduce once, which hints to... *** PiperOrigin-RevId: 176662654
* Windows CROSSTOOL: Define DEBUG in fastbuild and dbg modeGravatar pcloudy2017-11-22
| | | | | RELNOTES: None PiperOrigin-RevId: 176646230
* Windows CROSSTOOL: Define NDEBUG in opt modeGravatar pcloudy2017-11-22
| | | | | | | Fixed https://github.com/bazelbuild/bazel/issues/4144 RELNOTES: None PiperOrigin-RevId: 176642833
* Remove java_toolchain using remote targets.Gravatar xingao2017-11-21
| | | | PiperOrigin-RevId: 176521744
* Update/Add license header to cc auto-configure templates.Gravatar xingao2017-11-21
| | | | PiperOrigin-RevId: 176510846
* Fix gflags mark_flag_as_required warning.Gravatar Austin Schuh2017-11-21
| | | | | | | | | | | | I'm getting .../bazel-out/host/bin/external/bazel_tools/tools/build_defs/pkg/make_deb.runfiles/bazel_tools/third_party/py/gflags/gflags/__init__.py:284: UserWarning: Flag architecture has a non-None default value; therefore, mark_flag_as_required will pass even if flag is not specified in the command line! 'command line!' % flag_name) So, let's not mark it as required if a default is passed in! Change-Id: Iad9a3886ce0ff21ce26eb7fa17a986be4c4af5cf PiperOrigin-RevId: 176480367
* Add 'assemble' action_config for Windows.Gravatar Seth Greenstein2017-11-17
| | | | | | | | | | | Allows .asm files to be included in srcs. ml64.exe is used to create .o files which can later be linked. However, this change will not allow custom flags to be passed to ml64.exe other than /I and /D. Fixes #3648 Closes #3887. Change-Id: I42b6ff76d526abed440bb7f0e0ed4cc3812b4893 PiperOrigin-RevId: 176085382