aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
Commit message (Collapse)AuthorAge
* Android,Windows: longpath support in toolGravatar Laszlo Csomor2017-10-24
| | | | | | | | | | Update aar_native_libs_zip_creator.py to support long paths by using junctions. See https://github.com/bazelbuild/bazel/issues/3955 Change-Id: Iafa9ceca9f2a9076f220bd6326c95e5fb8b27f63 PiperOrigin-RevId: 173244903
* Automated rollback of commit e9b10399f6a148a3d20442f2c5020b05fa891873.Gravatar twerth2017-10-24
| | | | | | | | | | | | *** Reason for rollback *** Breaks ~2k ios targets, see b/68179560 *** Original change description *** Move hard-coded compilation-mode-specific flags in ObjcConfiguration. PiperOrigin-RevId: 173239463
* Add java_toolchain which compiles singlejar and ijar from source.Gravatar xingao2017-10-24
| | | | PiperOrigin-RevId: 173178028
* Move hard-coded compilation-mode-specific flags in ObjcConfiguration.Gravatar cpeyser2017-10-23
| | | | PiperOrigin-RevId: 172932367
* Minor update to a docstring.Gravatar lberki2017-10-23
| | | | | RELNOTES: None. PiperOrigin-RevId: 172880849
* Strip Xcode versions like "9.0gm" for the version flag.Gravatar lberki2017-10-20
| | | | | | | Turns out, those exist. RELNOTES: None. PiperOrigin-RevId: 172768102
* Add Skylark code that exports the current Xcode version and the Apple SDK ↵Gravatar lberki2017-10-18
| | | | | | | | | | | versions as flags. This will serve to replace AppleConfiguration#lateBoundOptionDefaults(). That one has to go away so that AppleConfiguration doesn't need to know the contents of the xcode_config rule anymore. Progress towards #3424. RELNOTES: None. PiperOrigin-RevId: 172569961
* Add aapt2 to Bazel-generated android_sdks.Gravatar ajmichael2017-10-18
| | | | | RELNOTES: None PiperOrigin-RevId: 172481590
* Windows: genenrate a fake CROSSTOOL when VC not foundGravatar Yun Peng2017-10-18
| | | | | | | | | | | | | | | | When Visual C++ build tools are not found on Windows, we generating a fake CROSSTOOL so that users can still build for other languages. In the fake CROSSTOOL, we point all tools to a batch script which prints error messages to notify users when they try to build any cc targets. Also, added an extra default_toolchain specification for x64_windows cpu value, so that users can use this cpu in select on non-Windows platforms. Fixed https://github.com/bazelbuild/bazel/issues/3853 Change-Id: Ib4d7a38fd4d98075f6b73ce310c28822e58af4e2 PiperOrigin-RevId: 172341985
* Removing the USER variable from test environment, unless explicitly provided.Gravatar olaola2017-10-16
| | | | | | TESTED=added remote test RELNOTES: Fixes #2574 PiperOrigin-RevId: 172294781
* Add a missing argument to the code in ↵Gravatar lberki2017-10-16
| | | | | | | | | https://github.com/bazelbuild/bazel/commit/aee6fb8d21e17c855025f0db6bb52e2cd7a2f642. Progress towards #3424. RELNOTES: None. PiperOrigin-RevId: 172293805
* Fix osx_cc_wrapper to also update dylibsGravatar hlopko2017-10-13
| | | | | | | | | | | | | | | In https://github.com/bazelbuild/bazel/commit/f426544e67170d31b9d228ecf4cdc4b6ce1ba00d I updated osx_cc_wrapper to work correctly in case both precompiled .so and cc_library-made .so are linked into a single binary. This cl makes osx_cc_wrapper work also when a precompiled .dylib is provided. This is roll-forward of https://github.com/bazelbuild/bazel/commit/0257c29f496719bb8414d012334155de6bbefa11. Fixes #3450 again for dylibs Fixes #407 One step closer to finishing #1576 RELNOTES: None. PiperOrigin-RevId: 171969333
* Update the Apple rules according to the new API because it was deemed better toGravatar lberki2017-10-12
| | | | | | | | | put the environment data behind apple_common as opposed to xcode_config. Progress towards https://github.com/bazelbuild/bazel/issues/3424 . RELNOTES: None. PiperOrigin-RevId: 171931324
* Automated rollback of commit 0257c29f496719bb8414d012334155de6bbefa11.Gravatar hlopko2017-10-11
| | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** I broke http://ci.bazel.io/view/Dashboard/job/bazel-tests/1079/testReport/junit/(root)/(empty)/test_osx_cc_wrapper_rpaths_handling/ *** Original change description *** Fix osx_cc_wrapper to also update dylibs In https://github.com/bazelbuild/bazel/commit/f426544e67170d31b9d228ecf4cdc4b6ce1ba00d I updated osx_cc_wrapper to work correctly in case both precompiled .so and cc_library-made .so are linked into a single binary. This cl makes osx_cc_wrapper work also when a precompiled .dylib is provided. Fixes #3450 again for dylibs Fixes #407 One step closer to finishing #1576 RELNOTES: None. PiperOrigin-RevId: 171806769
* Add tests for the Skylark-based implementation of git repository rules.Gravatar John Cater2017-10-11
| | | | | | | Fixes #3825. Change-Id: I59cb0edb50af30991153a1a684e613853df22dd2 PiperOrigin-RevId: 171687620
* Fix osx_cc_wrapper to also update dylibsGravatar hlopko2017-10-11
| | | | | | | | | | | | | In https://github.com/bazelbuild/bazel/commit/f426544e67170d31b9d228ecf4cdc4b6ce1ba00d I updated osx_cc_wrapper to work correctly in case both precompiled .so and cc_library-made .so are linked into a single binary. This cl makes osx_cc_wrapper work also when a precompiled .dylib is provided. Fixes #3450 again for dylibs Fixes #407 One step closer to finishing #1576 RELNOTES: None. PiperOrigin-RevId: 171683650
* Add a whitelist for packages that can contain android_devices rules. ↵Gravatar ajmichael2017-10-06
| | | | | | | Currently, this whitelist includes every package. RELNOTES: None PiperOrigin-RevId: 171192613
* Enable switching launcher's Windows target for remote execution.Gravatar xingao2017-10-06
| | | | | | | When --define EXECUTOR=remote is specified in bazel command, embedded tools 'launcher' will be compiled remotely from source. PiperOrigin-RevId: 171172084
* Use bundled proguard 5.3.3 instead of 4.7 from the SDKGravatar ajmichael2017-10-06
| | | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/3777 Also adds a proguard integration test so that hopefully we notice next time it breaks. RELNOTES: Updated Android proguard to 5.3.3. It now works with android-24+. PiperOrigin-RevId: 171162295
* Make the Apple Skylark rule be able to fetch environment data from theGravatar lberki2017-10-06
| | | | | | | | | | | | xcode_config rule in addition to ctx.fragments.apple . Subsequent Bazel versions won't support these methods on ctx.fragments.apple and thus need to be updated. Progress towards https://github.com/bazelbuild/bazel/issues/3424 . RELNOTES: None. PiperOrigin-RevId: 171021097
* Enable switching embedded tools target for remote execution.Gravatar xingao2017-10-06
| | | | | | | When --define EXECUTOR=remote is specified in bazel command, embedded tool zipper will be compiled remotely from source. PiperOrigin-RevId: 170874829
* Attempting to fix an occasionally missing stdout from test.xml.Gravatar olaola2017-10-06
| | | | | | | | | | 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 towards this fixing it, since for an unpatched Bazel it reproduced 7 times out of 293 runs. TESTED=ran Bazel test in a loop RELNOTES: None PiperOrigin-RevId: 170702015
* tools/build_defs/pkg/pkg.bzl: move load statement to the beginningGravatar Klaus Aehlig2017-10-02
| | | | | | | | ...so that bazel does not complain about internal files when run with --all_incompatible_changes. Change-Id: I9a12a7ab0cd6a92351fe17addd601d531f203aff PiperOrigin-RevId: 170694212
* Windows CROSSTOOL: remove c++-link-executable from ↵Gravatar pcloudy2017-09-29
| | | | | | | | | interface_library_output_path flag set We shouldn't apply this flag set to c++-link-executable action, it will only add a /IMPLIB:ignore option. RELNOTES: None. PiperOrigin-RevId: 170459781
* deps -> exports in bazel mobile-install stub app.Gravatar ajmichael2017-09-28
| | | | | RELNOTES: None PiperOrigin-RevId: 170198788
* Windows,Android: support long paths in toolGravatar Laszlo Csomor2017-09-28
| | | | | | | | | | | | //tools/android/aar_embedded_jars_extractor.py now supports long paths using the same junction-creating trick as aar_resources_extractor does. Fixes https://github.com/bazelbuild/bazel/issues/3808 Change-Id: I2db25b0536ac3a97f4a04191bc398eb236923a7c PiperOrigin-RevId: 170193093
* Windows, aar_resources_extractor: longpath bugfixGravatar Laszlo Csomor2017-09-27
| | | | | | | | | | | | | | | | | | Fix a bug in the Android tool aar_resources_extractor: open the compressed data and the target file as file descriptores, rather than using aar.extract. This way we can shorten the directories in the relative path of the extracted file, because we can open the target file via a junction and thus work around long path limitations. //tools/android:aar_resources_extractor_test now passes on Windows. Change-Id: I9f5c7de2279ad8769e53e015b8334a58a76cd989 PiperOrigin-RevId: 170181143
* Android, Python tools: bugfix in junction.pyGravatar Laszlo Csomor2017-09-27
| | | | | | | | | junction.TempJunction now can create all parent directories of the junction target if they don't exist. Change-Id: I3e9cf34e78a3eb1ef9415036b791843a3b37f7c1 PiperOrigin-RevId: 170176180
* Make gzipped pkg_tar outputs repeatableGravatar Philipp Schrader2017-09-27
| | | | | | | | | | | | | | | The current implementation allows the gzip module to use the current time as a timestamp. Python2 unfortunately doesn't expose this in the tarfile module so it's easy to overlook. This patch separates the gzip process by creating a separate file object manually and bypassing the gzip compression in the tarfile module. Fixes #1844 Change-Id: I19b265bf55314d38bdd53ccf20c49ecfe6d7618b PiperOrigin-RevId: 170077036
* Limit //external:android_sdk_for_testing to only the minimum files needed.Gravatar ajmichael2017-09-27
| | | | | | | | | | Note that the support libraries are excluded on Windows, because Windows runfiles are zipped and the support libraries are very big. First step towards https://github.com/bazelbuild/bazel/issues/3663 RELNOTES: None PiperOrigin-RevId: 170057391
* Windows: Add static_link_msvcrt and related featuresGravatar Yun Peng2017-09-26
| | | | | | | | | | | | | | | This is to replace using USE_DYNAMIC_CRT env variable to configure msvcrt linking in CROSSTOOL. If user applies static_link_msvcrt feature to a specific target, Bazel will choose the correct options for statically linking msvcrt. If static_link_msvcrt is not specified, Bazel uses options for dynamically linking msvcrt by default. https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx Change-Id: Ia078dfb528de9ffdd8a11d392db9eb3f34463b09 PiperOrigin-RevId: 170021927
* Update Bazel's android_device support to use new emulator paths.Gravatar ajmichael2017-09-26
| | | | | | | | | | | Also, bundle snapshots.img in Bazel since it was removed from the SDK. Part of the fix for https://github.com/bazelbuild/bazel/issues/3504 Note that this will require an update to unified launcher at https://github.com/google/android-testing-support-library RELNOTES: None PiperOrigin-RevId: 169937694
* Make control.tar.gz in pkg_deb repeatableGravatar Philipp Schrader2017-09-25
| | | | | | | | | | | This patch sets the mtime attribute of gzip explicitly to zero. Python2 doesn't expose this via the tarfile module so we have to create an explicit gzip instance. Fixes #3723 Change-Id: I4ce38a317bb92481562b67075d1272f1aebdf9d6 PiperOrigin-RevId: 169881504
* Don't emit an undeclared outputs MANIFEST if there are no files.Gravatar Googler2017-09-25
| | | | | | | Tested manually (with a test that doesn't emit undeclared outputs), and added a test that failed before and passes after the test-setup.sh change. RELNOTES: N/A PiperOrigin-RevId: 169687782
* Use FeatureConfiguration to compute linkstamping compile command lineGravatar hlopko2017-09-25
| | | | | | | | | Before, linkstamping compile actions were hardcoded in bazel and assumed gcc/clang and bash. This cl removes gcc/clang assumptions by using feature configuration. RELNOTES: None. PiperOrigin-RevId: 169685949
* docker_pull: rely on the main repository docker_buildGravatar Damien Martin-Guillerez2017-09-22
| | | | | | | | | | | | | The legacy docker_build was removed from bazel_tools but we need to use it for our integration test so refer to the one in the main repository. Also restore the visibility, just excluding it from bazel_tools is enough and docker_pull needs to call it from other repository. Change-Id: I8a8a5781859960030ae996db95fbaf9c54ec596a PiperOrigin-RevId: 169664916
* This time for sure: stop using --undefined dynamic_lookup in osx linking.Gravatar Googler2017-09-21
| | | | | | | | | | For the time being, all C++ links will provide ObjC core libraries on the command line, via having the link actions imply 'contains_objc_sources', which is a built-in feature that is in the process of being enabled automatically when objective-C/C++ sources are involved in the build. Once that happens, the 'imply' directives will be removed. RELNOTES: Stop using --undefined dynamic_lookup in Apple links. Enables unresolved symbol errors. PiperOrigin-RevId: 169437020
* Windows: Make dynamic libraries available to binary at runtimeGravatar Yun Peng2017-09-20
| | | | | | | | | | | When copy_dynamic_libraries_to_binary is enabled, we copy the shared libraries required by the binary to the binary's directory. Bazel will throw errors if there are confilct actions generating the same artifacts. Change-Id: I09a5a599ca0ec7a67efd49d5aa89481450fa4e90 PiperOrigin-RevId: 169364498
* Add support for writing undeclared outputs to TEST_UNDECLARED_OUTPUTS_DIR ↵Gravatar Googler2017-09-20
| | | | | | | | | | | | | | | | | | | and TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR to Bazel. After this change: - Any files written to the TEST_UNDECLARED_OUTPUTS_DIR directory will be zipped up and added to an outputs.zip file under bazel-testlogs. - Files will be listed in a MANIFEST file under bazel-testlogs. - Any files written to TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR will be concatenated together into an ANNOTATIONS file under bazel-testlogs. This provides a channel for tests to provide extra information outside of the test output itself. This is useful for things like verbose server logs. Note: The //src/test/shell/bazel:bazel_test_test target has a pre-existing breakage (see https://github.com/bazelbuild/bazel/issues/3727). But the new tests pass. RELNOTES: Tests can now write files to TEST_UNDECLARED_OUTPUTS_DIR and TEST_UNDECLARED_OUTPUTS_ANNOTATIONS_DIR and these will be reflected under bazel-testlogs. PiperOrigin-RevId: 169282528
* Toolchain type labels for c++ are filegroups instead of toolchain_type.Gravatar cpeyser2017-09-18
| | | | PiperOrigin-RevId: 168835640
* Automated rollback of commit f26e8694ae78599b3e2004e3360eaf3443fa53a6.Gravatar hlopko2017-09-18
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks clang_tidy. *** Original change description *** Introduce -c source_file -o output_file build variables Prior to this cl CompileCommandLine would (almost) unconditionally emit -c and -o flags. This cl removes this logic and relies on crosstool to emit these flags. This is another small step towards platform independent C++ rules. Memory use is not affected, since the build variables used by this cl are already exposed, this cl just forces crosstools to use it. RELNOTES: None. PiperOrigin-RevId: 168834576
* Bazel now can build dynamic library from cc_libraryGravatar Yun Peng2017-09-18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Working towards: https://github.com/bazelbuild/bazel/issues/3311 When building dynamic library on Windows, Bazel builds an import library and a DLL. Bazel provides a feature called windows_export_all_symbols, if this feature is enabled(and no_windows_export_all_symbols is not) for a cc_library, then Bazel parses object files of that cc_library to generate a DEF file that will be used during linking time to export symbols from DLL. This feature can be specified at crosstool, package, target and command line level. A few differences from Unix platforms: 1. We don't build the shared library on Windows by default, users have to specifiy --output_groups=dynamic_library for building dynamic libraries. This output group is also available on other platforms. 2. By default, cc_test is dynamically linked on Unix, but it will be statically linked on Windows by default. (meaning the default value of linkstatic in cc_test is 1 on Windows, and 0 on other platforms) 3. For global data symbols, __declspec(dllimport) must still be used in source files. Remaining issues: 1. Extensions for import library and DLL are not correct yet. 2. DLLs are not guaranteed to be available during runtime yet. 3. Diamond problem If a cc_library A is specified as linkstatic=0, then no dynamic library will be built for it, so if another cc_library B depends on it, A will be statically linked into B, and if a cc_binary C depends on B, A will also be statically linked into C and B will be dynamically linked to C. This is wrong because A is duplicated in both B and C. It is essentially a diamond problem describled in C++ Transitive Library. (https://docs.google.com/document/d/1-tv0_79zGyBoDmaP_pYWaBVUwHUteLpAs90_rUl-VY8/edit?usp=sharing) Hopefully, we can avoid this by using cc_shared_library rule in future. Change-Id: I23640d4caf8afe65d60b1522af6368536d7a8408 PiperOrigin-RevId: 168829958
* Automated rollback of commit ca216f5eb4b1f1892219db0f578495bbbdbaa875.Gravatar philwo2017-09-15
| | | | | | | | | | | | | | | *** Reason for rollback *** Breaks Bazel building itself on FreeBSD, also #3739. *** Original change description *** Introduce empty "toolchain_category" rule for labels that will be used as categories of toolchains for the purpose of toolchain selection. Up to now, we've used the native toolchain_type rule for this purpose. That rule depends on a number of configuration fragments that supply build variables - we don't want toolchains to need to depend on those fragments as well. E.g. toolchain_type depends on JvmConfiguration, but we would like toolchains to work with --experimental_disable_jvm. PiperOrigin-RevId: 168810566
* Set correct PWD in coverage ↵Gravatar Mansheng Yang2017-09-15
| | | | | | | | (https://docs.bazel.build/versions/master/test-encyclopedia.html) mentioned that when running tests the `PWD` should be `$TEST_SRCDIR/workspace-name` Closes #3616. PiperOrigin-RevId: 168806570
* Introduce -c source_file -o output_file build variablesGravatar hlopko2017-09-14
| | | | | | | | | | | | Prior to this cl CompileCommandLine would (almost) unconditionally emit -c and -o flags. This cl removes this logic and relies on crosstool to emit these flags. This is another small step towards platform independent C++ rules. Memory use is not affected, since the build variables used by this cl are already exposed, this cl just forces crosstools to use it. RELNOTES: None. PiperOrigin-RevId: 168671507
* Remove docker rules from @bazel_toolsGravatar Googler2017-09-14
| | | | | | | | | ... and lock down the visibility to only the Bazel project, please see https://github.com/bazelbuild/rules_docker instead. RELNOTES[INC]: @bazel_tools//tools/build_defs/docker:docker.bzl is no longer available, please see https://github.com/bazelbuild/rules_docker. PiperOrigin-RevId: 168650438
* Introduce empty "toolchain_category" rule for labels that will be used asGravatar cpeyser2017-09-14
| | | | | | | | categories of toolchains for the purpose of toolchain selection. Up to now, we've used the native toolchain_type rule for this purpose. That rule depends on a number of configuration fragments that supply build variables - we don't want toolchains to need to depend on those fragments as well. E.g. toolchain_type depends on JvmConfiguration, but we would like toolchains to work with --experimental_disable_jvm. PiperOrigin-RevId: 168577759
* Expose sysroot as a build variableGravatar hlopko2017-09-12
| | | | | | | | | This cl removes hardcoded --sysroot flag generation from bazel when constructing command line for C++ actions. The hardcoded flag is still exposed to Skylark (to stay backwards compatible). RELNOTES: None. PiperOrigin-RevId: 168346711
* Remove swift_library and tests, lives in the apple rules repo now.Gravatar thomasvl2017-09-11
| | | | | RELNOTES: The swift_library rule that is distributed with Bazel has been deleted. Users who wish to compile Swift should use the rules in https://github.com/bazelbuild/rules_apple instead. PiperOrigin-RevId: 168032330
* Remove the old copy of apple_genrule. It lives in apple rules.Gravatar thomasvl2017-09-11
| | | | | RELNOTES: The apple_genrule rule that is distributed with Bazel has been deleted. Users who wish to use genrules with Xcode's DEVELOPER_DIR set should use the rules in https://github.com/bazelbuild/rules_apple instead. PiperOrigin-RevId: 168027826