aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* Remove BlazeModule.checkEnvironmentGravatar ulfjack2018-06-13
| | | | | | Do the work in beforeCommand instead. PiperOrigin-RevId: 200391086
* Add "toolchain-identifier" attribute to cc_toolchain ruleGravatar rosica2018-06-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the selection of C++ toolchain configuration depends on 2 different things: 1. CROSSTOOL file: a proto text file that contains multiple CrosstoolConfig.CToolchain messages, out of which we want to select the appropriate CToolchain; 2. cc_toolchain_suite rule, specified by --crosstool_top option: this rule contains "toolchains" map attribute. The map's keys are of type <cpu>|<compiler>, or just <cpu>, and the values are labels of cc_toolchain rules (which contain additional C++ information). If there is an entry in cc_toolchain_suite.toolchains that corresponds to the --cpu and --compiler options, we use it, otherwise we loop through all the CToolchains in the CROSSTOOL file, select the one that corresponds to the --cpu and --compiler options, and then get the cc_toolchain label from cc_toolchain_suite.toolchains[toolchain.targetCpu|toolchain.compiler]. In both cases we read the CROSSTOOL file and pass all its information forward, to be used in creation of CppConfiguration and CcToolchainProvider creation. As part of the efforts of rewriting CROSSTOOL in Skylark, we need to make obtaining the cc_toolchain label independent of the CROSSTOOL file and toolchain selection. As a step towards that goal, we add a new "toolchain_identifier" attribute to cc_toolchain, which uniquely identifies a CToolchain in the CROSSTOOL file. Now the process of getting the CToolchain goes as follows: Check for existence of cc_toolchain_suite.toolchains[<cpu>|<compiler>], if --compiler is specified, otherwise check for cc_toolchain_suite.toolchains[<cpu>]. 1. if a value is found, load the cc_toolchain rule and look for the toolchain_identifier attribute. 1.a if the attribute exists, loop through all the CToolchains in CROSSTOOL and select the one with the matching toolchain identifier. 1.b otherwise fall back to selecting the CToolchain from CROSSTOOL by matching the --cpu and --compiler values. 2. If a value is not found, select the CToolchain from CROSSTOOL by matching the --cpu and --compiler values, and construct the key as follows: <toolchain.cpu>|<toolchain.compiler>. In the future we will get rid of 2. by making sure that cc_toolchain_suite.toolchains[<cpu>|<compiler>] and cc_toolchain_suite.toolchains[<cpu>] are always defined. 1.b will be removed by making the cc_toolchain.toolchain_identifier attribute mandatory After this deriving the cc_toolchain label will be independent of the CROSSTOOL file 1.a will ultimately be replaced by an attribute that points to a skylark_crosstool rule, that will contain all the information that CROSSTOOL contains, allowing us to remove CROSSTOOL altogether. Work towards issue #5380 RELNOTES: None. PiperOrigin-RevId: 200388550
* Fix a bad path and remove the reference to the legacy path-based load() syntax.Gravatar lberki2018-06-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 200379060
* Skylark repos: for failed patch command, also report stdoutGravatar Klaus Aehlig2018-06-13
| | | | | | | | | | The patch(1) utility usually gives error messages on stdout. So it is not useful to report only stderr in case a patch failed. Report both. Fixes #5379. Change-Id: Ief198849e29ca989dfdefe2fadf495a0b0949972 PiperOrigin-RevId: 200377306
* Skylark repositories: support additional arguments for the patch toolGravatar Klaus Aehlig2018-06-13
| | | | | | | | | | | | Instead of hard-coding "-p0", allow the arguments for that patch tool to be overridden. In particular, this supports the use case of patches generated with `git format-patch` which are to be read as `-p1`. Improves on #5379. Closes #4974 as superseded. Change-Id: I809fde14beab21d8a755ba4f1706b602bae3c1bb PiperOrigin-RevId: 200373909
* Return Strings from C++ Skylark APIs, not PathFragmentsGravatar hlopko2018-06-13
| | | | | | | | | | PathFragments are not well supported in Skylark, quite the opposite, the Skylark team tries hard to not use path fragments if possible. All existing users I looked into had to convert the PathFragment to string using str() anyway. Because of that this cl should not break anybody. RELNOTES: None. PiperOrigin-RevId: 200372447
* C++: Continues renaming executionDynamicLibraries to dynamicLibrariesForRuntime.Gravatar plf2018-06-13
| | | | | RELNOTES:none PiperOrigin-RevId: 200366616
* Split AnalysisResult into a top-level classGravatar ulfjack2018-06-13
| | | | PiperOrigin-RevId: 200363345
* Change generated DEF file name from <target name>.def to <target name>.gen.defGravatar pcloudy2018-06-13
| | | | | | | | | This helps avoid name conflicts when users want to generate DEF files by themselves. For example, when using a genrule to do that, people naturally name the def file as <target name>.def. Fixed https://github.com/bazelbuild/bazel/issues/5357 RELNOTES: None PiperOrigin-RevId: 200354303
* Fix documentation in bazel_external_repository_test.pyGravatar pcloudy2018-06-13
| | | | | RELNOTES: None. PiperOrigin-RevId: 200351084
* Fix archive decompression with symlink on WindowsGravatar pcloudy2018-06-13
| | | | | | | | | On Windows, extracting file symlink in an archive would be performed as copy. To ensure the copy will be successful, we defer all symlink creation after all regular files are extracted. Fix https://github.com/bazelbuild/bazel/issues/5367 RELNOTES: None. PiperOrigin-RevId: 200345463
* Fix a bug with flush() not flushing on local writes in ActionFS, and add ↵Gravatar felly2018-06-12
| | | | | | | | | unit test coverage for this. Note that ActionFS is not generic enough to make use of FileSystemTest. RELNOTES: None PiperOrigin-RevId: 200304871
* Change the default value of ↵Gravatar dannark2018-06-12
| | | | | | | | --experimental_android_local_test_binary_resources to true. RELNOTES[NEW]: android_local_test now takes advantage of Robolectric's binary resource processing which allows for faster tests. PiperOrigin-RevId: 200296572
* Rename VariableContext to the more general purpose QueryExpressionContext ↵Gravatar shreyax2018-06-12
| | | | | | and thread it through to graph traversal functions. Some other light refactorings as well. PiperOrigin-RevId: 200292556
* Add more data to the exception thrown when putOnlyEntry's verification fails.Gravatar mstaib2018-06-12
| | | | | | | | | If this exception is thrown, performance no longer matters - we're detonating the place and riding the explosion out to stderr. So we might as well just dump everything we know. RELNOTES: None. PiperOrigin-RevId: 200290439
* Add --print_workspace_in_output_paths_if_needed flag.Gravatar mstaib2018-06-12
| | | | | | | | | | | | | | | | When this flag is turned on, and the user's working directory is beneath the workspace (but is not the workspace itself), the workspace's absolute path is printed as a prefix to the convenience symlink. With this flag off, the displayed convenience symlink path is always relative to the user's workspace, even if that isn't the current working directory. (This is the current behavior.) The new (flag-on) behavior will become default soon, and then this flag will be removed. RELNOTES: None. PiperOrigin-RevId: 200278355
* Change WorkspaceStatusAction incrementality logic. We no longer manually ↵Gravatar janakr2018-06-12
| | | | | | | | invalidate the BUILD_INFO_KEY node on --workspace_status_command and related flag changes. Instead, the action has a supplier that allows it to retrieve the correct values at execution time. This does not sacrifice correctness because the action executes unconditionally on every build, so it will never have stale data. PiperOrigin-RevId: 200265375
* Create skylarkbuildapi bootstrap for android-related top level skylark objectsGravatar cparsons2018-06-12
| | | | | RELNOTES: None. PiperOrigin-RevId: 200260766
* CROSSTOOLS wrapped_clang: handle spaces in pathsGravatar Oscar Bonilla2018-06-12
| | | | | | | | | | | | | | | | When bazel calls wrapped_clang, it single-quotes all arguments. However it passes flags with arguments quoted as a whole. That is, wrapped_clang will be called with arguments like these: wrapped_clang '-isysroot /a/path/with spaces' '/a/file with spaces.m' Before this commit, wrapped_clang was blindly splitting on space and calling clang with invalid arguments. Now it only splits on the _first_ space, and only if the argument starts with '-'. Closes #5147. PiperOrigin-RevId: 200259496
* Add support for the Json trace file formatGravatar ulfjack2018-06-12
| | | | | | | | | | | | | | | | | Add a --experimental_generate_json_trace_profile option that puts a file into the output base (or uses --profile if set). There are still a lot of problems with this. - unexplained holes - way too many threads - nonsensical event titles - too many detail events, too little overview - it may also cause unnecessary load - it silently overwrites the existing file on subsequent invocations The format is documented here: goo.gl/oMZPLh PiperOrigin-RevId: 200259431
* Automated rollback of commit a1c9f8d33457cd1f3b01299863bcab2667c13a52.Gravatar Googler2018-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** PY3 does not support Python proto1. *** Original change description *** Automated rollback of commit 4c72a82ada742bd369185cd07c57f96c497ce440. *** Reason for rollback *** Breaks, at least, //ads/aswan/tools:format_mr_results. *** Original change description *** Remove python3/ prefix to generated .pyc files. That makes: (a) merging PY2 and PY3 .runfiles impossible (which is incorrect anyway) and (b) generated .py source files incompatible with 2to3 (src_version=PY2) - that's OK as we deprecate 2to3. RELNOTES: n/a PiperOrigin-RevId: 200256210
* Enable rules to inherit the ExecutionPlatformConstraintsAllowed value.Gravatar jcater2018-06-12
| | | | PiperOrigin-RevId: 200247872
* Add skylarkbuildapi bootstraps for apple, cpp, platform, and testing packagesGravatar cparsons2018-06-12
| | | | | RELNOTES: None. PiperOrigin-RevId: 200246780
* Skylark debugger: Fix NPE listing frames.Gravatar brendandouglas2018-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Environment$Continuation#caller is most definitely nullable in practice. I suspect it's a bug in skylark itself, but for now, just properly mark it nullable and handle it in the debugger. Stack trace from NPE: Caused by: java.lang.NullPointerException at com.google.devtools.build.lib.syntax.Environment.listFrames(Environment.java:1197) at com.google.devtools.build.lib.syntax.Environment.listFrames(Environment.java:81) at com.google.devtools.build.lib.skylarkdebug.server.ThreadHandler.listFrames(ThreadHandler.java:236) at com.google.devtools.build.lib.skylarkdebug.server.ThreadHandler.getThreadProto(ThreadHandler.java:345) at com.google.devtools.build.lib.skylarkdebug.server.ThreadHandler.pauseCurrentThread(ThreadHandler.java:289) at com.google.devtools.build.lib.skylarkdebug.server.ThreadHandler.pauseIfNecessary(ThreadHandler.java:203) at com.google.devtools.build.lib.skylarkdebug.server.SkylarkDebugServer.pauseIfNecessary(SkylarkDebugServer.java:158) at com.google.devtools.build.lib.skylarkdebug.server.SkylarkDebugServer$DebugAwareEval.exec(SkylarkDebugServer.java:262) at com.google.devtools.build.lib.syntax.UserDefinedFunction.call(UserDefinedFunction.java:91) at com.google.devtools.build.lib.syntax.BaseFunction.callWithArgArray(BaseFunction.java:462) at com.google.devtools.build.lib.syntax.BaseFunction.call(BaseFunction.java:440) at com.google.devtools.build.lib.analysis.skylark.SkylarkRuleConfiguredTargetUtil.lambda$buildRule$1(SkylarkRuleConfiguredTargetUtil.java:105) at com.google.devtools.build.lib.skylarkdebug.server.SkylarkDebugServer.runWithDebugging(SkylarkDebugServer.java:142) at com.google.devtools.build.lib.syntax.DebugServerUtils.runWithDebuggingIfEnabled(DebugServerUtils.java:70) at com.google.devtools.build.lib.analysis.skylark.SkylarkRuleConfiguredTargetUtil.buildRule(SkylarkRuleConfiguredTargetUtil.java:100) PiperOrigin-RevId: 200229036
* Remap repository names inside load statements in BUILD files if the ↵Gravatar dannark2018-06-12
| | | | | | | | | | | | | | | | | | | repository name is remapped. For example if main/WORKSPACE contains: local_repository( name = "a", path = "../a", repo_mapping = {"@x" : "@y"}, ) a/BUILD load("@x//:sample.bzl", "sample") Then the load in a/BUILD will be resolved as "@y//:sample.bzl" RELNOTES: None PiperOrigin-RevId: 200227431
* Disable flaky testGravatar ulfjack2018-06-12
| | | | | | Temporary workaround for #5328. PiperOrigin-RevId: 200224317
* Fix xdot command example in cpp tutorialGravatar Naresh2018-06-12
| | | | | | | | | | | | [Documentation fix] In recent versions of xdot, piping the output of `bazel query` no longer displays the visualization due to an unrelated change in xdot. So, use redirection instead of pipe. Closes #5316. PiperOrigin-RevId: 200220180
* Platform documentation fixes.Gravatar jcater2018-06-12
| | | | PiperOrigin-RevId: 200218884
* Fix some missing cases from ↵Gravatar Googler2018-06-12
| | | | | | | | | | | | | | | | https://github.com/bazelbuild/bazel/commit/bbf3e421ed8b2b431a72cd3ab4ba591dc8833634. For languages that use launchers, there are some requirements about files other than the main executable being co-located with the executable: 1. For Python, the .zip file must be alongside the executable. 2. For Shell, the shell file must be alongside the exe. In addition, a .exe suffix is needed for launchers. Tested that cc_test (non-launcher), java_test, py_test, sh_test (all launchers) work remotely when using the TEST_SHORT_EXEC_PATH env var. RELNOTES: N/A PiperOrigin-RevId: 200216308
* Support delete() in ActionFS.Gravatar felly2018-06-12
| | | | | RELNOTES: None PiperOrigin-RevId: 200213204
* Refactor profilerGravatar ulfjack2018-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | - move the save method to an inner class - don't use a timer, use a blocking queue instead - add a format enum (in anticipation of adding a json output format) - update the test to use an in memory buffer, and avoid FoundationTestCase Compared to the original https://github.com/bazelbuild/bazel/commit/15b8c259db111012b4642287172cb4d1d82151f3, it contains these changes: - Make it so we don't create a queue if we are not going to write any data! The queue is now owned by the writer, and if there is no writer, there is no queue. This was causing a memory regression because slowest task profiling is enabled by default, in which case the profiler is started with no output file. In that case, there's no thread that is emptying the queue, but the queue was still created by default. - add additional tests for slowest task and histogram handling; these also provide coverage for the case where the profiler is started without an output stream - move all the writer thread handling into the inner class - make writer access thread-safe - add a bunch of documentation PiperOrigin-RevId: 200212978
* Always run toolchain resolution, even when no toolchain types are requested, ↵Gravatar John Cater2018-06-12
| | | | | | | in order to properly choose the execution platform from the available execution platforms. Change-Id: I05dc84403e0db765865e9b91c4222894fa867cd9 PiperOrigin-RevId: 200211635
* Remove LoadingPhaseRunner, inline the only implementationGravatar ulfjack2018-06-12
| | | | PiperOrigin-RevId: 200210007
* Add hash sum for mount_path_toolchainGravatar Klaus Aehlig2018-06-12
| | | | | | | | Even for tests we should not download random files from the internet without ensuring that we get what we expect. Change-Id: I4b9ef3f89c1ea12a4b883d833fb598196f9a7db3 PiperOrigin-RevId: 200201636
* Split TargetPatternEvaluator into two interfacesGravatar ulfjack2018-06-12
| | | | | | | | | | | | | | | | | - the TargetPatternPreloader is still used for query in all its forms - the remaining TargetPatternEvaluator part is no longer used except in tests - also make both implementations stateless and pass the offset to the methods instead; note that they both modify the underlying skyframe graph, so there are side effects to the calls even if there's no direct state anymore The intent is to migrate the relevant tests to LoadingPhaseRunnerTest (which could also now be renamed since it's not doing a loading phase), and then delete the TargetPatternEvaluator interface. This depends on the previous commit that removed the last direct use of TPE from an internal command. PiperOrigin-RevId: 200198067
* docs: don't list all attribute types in build-refGravatar Laszlo Csomor2018-06-12
| | | | | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/5362 Change-Id: I41d7b78e8d31d4a08ba0aba35c81723cbb315c40 Closes #5364. Change-Id: I41d7b78e8d31d4a08ba0aba35c81723cbb315c40 PiperOrigin-RevId: 200182384
* docs: fix broken link on tutorial/java.htmlGravatar Laszlo Csomor2018-06-12
| | | | | | | | | | | Fixes https://github.com/bazelbuild/bazel/issues/5358 Change-Id: I0c9eca59349069a41e3613600df25ed2b678b34c Closes #5363. Change-Id: I0c9eca59349069a41e3613600df25ed2b678b34c PiperOrigin-RevId: 200182247
* Enable AnalysisTestCases to set LoadingOptions.Gravatar mstaib2018-06-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 200144845
* Enable mock rules to set their types.Gravatar mstaib2018-06-11
| | | | | | | This enables, e.g., TEST rules to be created. RELNOTES: None. PiperOrigin-RevId: 200138491
* Skylark debugging protocol: include a 'stop reason' in ThreadPausedEvent.Gravatar brendandouglas2018-06-11
| | | | | | | | | | | | Pulls out a ThreadPausedState message, containing the previously separate 'isPaused' and 'locationIfPaused' information, as well as the stack frames and the reason for pausing, which is useful for debugging clients (e.g. IDEs might change focus when a breakpoint is hit, but not when all threads are paused). TAG_CHANGE_OK=This proto has never yet been used TYPE_CHANGE_OK=This proto has never yet been used PiperOrigin-RevId: 200109927
* Automated rollback of commit 15b8c259db111012b4642287172cb4d1d82151f3.Gravatar jmmv2018-06-11
| | | | | | | | *** Reason for rollback *** Breaks internal performance tests. PiperOrigin-RevId: 200103033
* Migrate remaining assorted skylark types to skylarkbuildapiGravatar cparsons2018-06-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 200100871
* Only remove 'repo_mapping' from kwargs if experimental_enable_repo_mapping ↵Gravatar dannark2018-06-11
| | | | | | | is set. Repository rules should throw an attribute not found error if repo_mapping is used but the flag isn't set, otherwise it silently fails. RELNOTES: None PiperOrigin-RevId: 200097695
* Migrate android providers to use BuiltinProvider instead of NativeProviderGravatar cparsons2018-06-11
| | | | | RELNOTES: None. PiperOrigin-RevId: 200096226
* Allow delegation to the underlying filesystem only for the source tree.Gravatar felly2018-06-11
| | | | | | | The on-disk execRoot/blaze-out is now off limits to ActionFS. RELNOTES: None PiperOrigin-RevId: 200080287
* Create a bootstrap for repository-related skylark build API.Gravatar cparsons2018-06-11
| | | | | | | Also remove the old ConfiguredRuleClassProvider.addSkylarkModule() method, as it, after this change, has no callers. RELNOTES: None. PiperOrigin-RevId: 200078816
* Add some more logging to the debug server.Gravatar brendandouglas2018-06-11
| | | | | | Mostly 'debug' level logs that won't appear by default. PiperOrigin-RevId: 200072597
* Consolidate filesystem metadata operations in ActionFS by extending ↵Gravatar felly2018-06-11
| | | | | | | AbstractFileSystemWithCustomStat. RELNOTES: None PiperOrigin-RevId: 200071031
* Refactor profilerGravatar ulfjack2018-06-11
| | | | | | | | | - move the save method to an inner class - don't use a timer, use a blocking queue instead - add a format enum (in anticipation of adding a json output format) - update the test to use an in memory buffer, and avoid FoundationTestCase PiperOrigin-RevId: 200065404
* ReformatingGravatar laurentlb2018-06-11
| | | | | | | | Switch statements were poorly formatted. Fixing it in a separate commit so that it doesn't clutter the diff. RELNOTES: None. PiperOrigin-RevId: 200062930