aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/runtime/BlazeModule.java
Commit message (Collapse)AuthorAge
* Refactor the FileSystem API to allow for different hash functions.Gravatar buchgr2017-11-30
| | | | | | | | | | | | | Refactor the FileSystem class to include the hash function as an instance field. This allows us to have a different hash function per FileSystem and removes technical debt, as currently that's somewhat accomplished by a horrible hack that has a static method to set the hash function for all FileSystem instances. The FileSystem's default hash function remains MD5. RELNOTES: None PiperOrigin-RevId: 177479772
* Fix typo in BlazeModule#blazeShutdown javadoc.Gravatar ajmichael2017-11-02
| | | | | RELNOTES: None PiperOrigin-RevId: 174229364
* Thread FileSystem through to a single Path#delete call site.Gravatar tomlu2017-10-30
| | | | | | This requires a fairly large amount of changes to fundamental objects like BlazeRuntime, Executor, and so on, as well as changing a lot of test code to thread the file system through. I expect future CLs to be much smaller. PiperOrigin-RevId: 173678144
* More BUILD file refactorings.Gravatar philwo2017-09-06
| | | | | | | | | Split collect, concurrent, vfs, windows into package-level BUILD files. Move clock classes out of "util", into their own Java package. Move CompactHashSet into its own Java package to break a dependency cycle. Give nestedset and inmemoryfs their own package-level BUILD files. PiperOrigin-RevId: 167702127
* Move OutputService to lib.skyframeGravatar ulfjack2017-08-11
| | | | | | | | | | | This isn't ideal, but is the fastest way to split analysis, execution, and rules into separate java libraries, with lib.skyframe still being in the analysis library. Ideally, we'd split up the lib.skyframe package, move the analysis stuff to the analysis library, the execution stuff to the execution library, and so on. That wouldn't require us moving OutputService out of lib.exec. PiperOrigin-RevId: 164856998
* Move core test classes to lib.analysis.testGravatar ulfjack2017-08-11
| | | | | | | | These are depended upon by analysis code, so need to live in the same library as lib.analysis. Moving them here makes it possible to split the build-base library into separate libraries for analysis, execution, and rules. PiperOrigin-RevId: 164847161
* Merge handleOptions into beforeCommandGravatar ulfjack2017-07-17
| | | | | | | Now that we have the options before calling beforeCommand, there's no need for a separate handleOptions method in the BlazeModule API. Remove it. PiperOrigin-RevId: 162002300
* BlazeModule.workspaceInit: also pass the BlazeRuntime to the callGravatar ulfjack2017-06-14
| | | | | | | | In order for BlazeModule.workspaceInit to be self-contained, also pass in the BlazeRuntime; we have use cases where this context is relevant, and there's currently no other way to get a reference to the BlazeRuntime. PiperOrigin-RevId: 158861142
* Simplify BlazeModule.beforeCommandGravatar ulfjack2017-06-14
| | | | | | | | | | | Don't pass the Command annotation explicitly, but add it to CommandEnvironment instead; most modules don't need it in the first place, so it was a lot of boilerplate for not much. Also change it so that the command is passed to the constructor. Add some documentation to the beforeCommand method. PiperOrigin-RevId: 158847128
* Extend BlazeModule to support listening to the console outputGravatar Klaus Aehlig2017-04-28
| | | | | | | | | | Besides writing console output to the console and the command log, allow modules to register other places where the output should be recorded to. This will allow the build-event protocol to also report on the console output. Change-Id: Ie700243120b0db7c3c68d192abeb0ab7033dc175 PiperOrigin-RevId: 154528369
* Add repository override optionGravatar kchodorow2017-04-20
| | | | | | | | | | | RELNOTES: Adds a --override_repository option that takes a repository name and path. This forces Bazel to use the directory at that path for the repository. Example usage: `--override_repository=foo=/home/user/gitroot/foo`. Fixes #1266 PiperOrigin-RevId: 153599291
* Merge the action input prefetcher into the ExecutorBuilder.Gravatar Ulf Adams2017-01-13
| | | | | | | | | This should be a no-op change, primarily intended to improve the BlazeModule API. The code simplification in the distributor code path is incidental. -- PiperOrigin-RevId: 144441458 MOS_MIGRATED_REVID=144441458
* Move some classes to lib.exec in preparation for layering enforcementGravatar Ulf Adams2016-12-21
| | | | | | | | | | | | This change is part of the mu-bazel effort, which aims to build a minimally useful Bazel binary with most extraneous functionality removed. As part of that, we want to enforce layering of packages. In particular, lib.actions must not depend on lib.rules or lib.exec. lib.rules must not depend on lib.exec. Moving these classes is a necessary step to enforce that layering. -- PiperOrigin-RevId: 142668172 MOS_MIGRATED_REVID=142668172
* Merge BlazeModule.getEnvironmentExtensions into serverInit / ServerBuilder.Gravatar Ulf Adams2016-11-02
| | | | | -- MOS_MIGRATED_REVID=137955061
* Move createActionCache to ExecutorBuilder.Gravatar Ulf Adams2016-11-02
| | | | | -- MOS_MIGRATED_REVID=137936478
* Refactor the module API to use the builder pattern for executor creation.Gravatar Ulf Adams2016-11-02
| | | | | | | This significantly simplifies several of our modules. -- MOS_MIGRATED_REVID=137713119
* Support per-module shutdown code on crash.Gravatar Julio Merino2016-10-17
| | | | | | | | | | | | | | Add a new "shutdown on crash" hook to the Blaze modules and call it when we exit due to a crash. This allows modules to perform necessary cleanup of internal state when exiting abruptly. Note that the need for implementing "shutdown on crash" is rare. As an example of when this may be useful is a module that has spawned background threads to communicate with a remote server and we want to shut down those connections in a controlled manner. -- MOS_MIGRATED_REVID=136330678
* Enable Bazel commands to exit at any time.Gravatar Michael Staib2016-10-05
| | | | | | | | | | | | | This is the first step on a journey toward allowing commands to AbruptExit wherever they please, similar to how the user can press Ctrl+C at any time and we (should) bail out as fast as we can. By interrupting the command's main thread, we at least offer the command the ability to see that an error requiring a bail has happened, and it should trigger at potentially more locations, rather than just between phases. -- MOS_MIGRATED_REVID=135152330
* Move the query output formatters to ServerBuilder.Gravatar Ulf Adams2016-08-29
| | | | | -- MOS_MIGRATED_REVID=131569674
* Move QueryFunctions and InfoItems to ServerBuilder.Gravatar Ulf Adams2016-08-29
| | | | | | | Initialize these from BlazeModule.serverInit instead of on-the-fly. -- MOS_MIGRATED_REVID=131564738
* Add a framework for prefetching input files (in case they come from remote ↵Gravatar Philipp Wollermann2016-08-25
| | | | | | | file systems). -- MOS_MIGRATED_REVID=131280794
* Drop BlazeModule.getOptionCategories, it's never used.Gravatar Ulf Adams2016-08-19
| | | | | -- MOS_MIGRATED_REVID=130742362
* Improve BlazeModule documentation.Gravatar Ulf Adams2016-08-18
| | | | | | | Also allow AbruptExitException from all server startup hooks. -- MOS_MIGRATED_REVID=130513167
* Remove the outputPath parameter from BlazeModule.getFileSystem.Gravatar Ulf Adams2016-08-10
| | | | | | | | It's never used, and it's tricky to run with multiple different file systems in the same process -> remove it to simplify. -- MOS_MIGRATED_REVID=129858142
* Pass in the command options to BlazeModule.getCoverageReportFactory.Gravatar Ulf Adams2016-08-10
| | | | | | | This allows us to make the coverage module stateless if it depends on options. -- MOS_MIGRATED_REVID=129852270
* Split BlazeDirectories into two classes.Gravatar Ulf Adams2016-08-09
| | | | | | | | | | | | | This is done in preparation for allowing multiple workspaces / commands in a single server. That requires changes to the module API, which currently hard-codes a 1:1 correspondence between workspaces and servers. Note how BlazeDirectories exists even when it runs outside a workspace. It's not ideal that the output base is in ServerDirectories, and the BlazeRuntime creation also still requires a BlazeDirectories instance. -- MOS_MIGRATED_REVID=129736613
* Add a ServerBuilder, and use that in the module API.Gravatar Ulf Adams2016-07-07
| | | | | | | This change is similar to a previous change that introduced WorkspaceBuilder. -- MOS_MIGRATED_REVID=126799657
* Rewrite workspace creation to use a builder class.Gravatar Ulf Adams2016-07-05
| | | | | | | | | An instance of the builder is passed to all modules, which can each add / set things on the builder. This reduces the BlazeModule API surface, while also being more flexible for future changes. -- MOS_MIGRATED_REVID=126613981
* Split BlazeModule.getCommandOptions into two; unify all implementations.Gravatar Ulf Adams2016-06-23
| | | | | | | | | | | Several modules now explicitly add common command options. Of the remaining ones, most add options to the build command, except one, which adds options to query. They now all use the canonical implementation. Also updated the documentation to clarify what this method actually does. -- MOS_MIGRATED_REVID=125560058
* Add a hook to Package.Builder.Helper that gets called by PackageFunction ↵Gravatar Nathan Harmata2016-06-07
| | | | | | | after the Package is fully loaded. -- MOS_MIGRATED_REVID=124260910
* Allow BlazeModules to expose a helper that PackageFactory will use for ↵Gravatar Nathan Harmata2016-05-27
| | | | | | | creating fresh Package instances. Also make a few Package methods public. -- MOS_MIGRATED_REVID=123247246
* Allow modules to inject a custom AttributeContainer.Gravatar Janak Ramakrishnan2016-05-12
| | | | | | | | | | | | | | | | | | | | | | | | | Rollback of commit cda4b4eae0c495a8f90f2a70a8db46e34062ee26. *** Reason for rollback *** Roll-forward with fixes (see ExternalPackageBuilder). *** Original change description *** Automated [] rollback of commit 178a3dfda8bf72abf22758597a90a4afb8eed181. *** Reason for rollback *** Broke ci.bazel.io. See #1234. *** Original change description *** Allow modules to inject a custom AttributeContainer. -- MOS_MIGRATED_REVID=122100417
* Rollback of commit 178a3dfda8bf72abf22758597a90a4afb8eed181.Gravatar Damien Martin-Guillerez2016-05-06
| | | | | | | | | | | | | | | *** Reason for rollback *** Broke ci.bazel.io. See #1234. *** Original change description *** Allow modules to inject a custom AttributeContainer. -- MOS_MIGRATED_REVID=121658474
* Allow modules to inject a custom AttributeContainer.Gravatar Janak Ramakrishnan2016-05-04
| | | | | -- MOS_MIGRATED_REVID=121497233
* Redesign InfoItem to use classes instead of the InfoKey enum. This way the ↵Gravatar Luis Fernando Pino Duque2016-05-03
| | | | | | | | | InfoItems can now take parameters. -- MOS_MIGRATED_REVID=121379097
* Remove documentation for "abi" and "abi_deps".Gravatar Greg Estren2016-05-03
| | | | | | | | | These attributes are going away imminently. select() is the new abi_deps. -- MOS_MIGRATED_REVID=121294764
* Refactor BlazeWorkspace creation to happen after BlazeRuntime construction.Gravatar Ulf Adams2016-04-13
| | | | | | | | As part of that, move a BinTools and the WorkspaceStatusActionFactory to the BlazeWorkspace. -- MOS_MIGRATED_REVID=119633702
* Move AbstractBlazeQueryEnvironment to a factory class, and have BlazeModule ↵Gravatar Nathan Harmata2016-03-21
| | | | | | | optionally expose a custom factory implementation. -- MOS_MIGRATED_REVID=117546934
* Update ANDROID_DEFAULT_CROSSTOOL to default to //external:android/crosstool. ↵Gravatar Luis Fernando Pino Duque2016-02-25
| | | | | | | Remove the constant. -- MOS_MIGRATED_REVID=115555161
* Don't treat external files as immutableGravatar Kristina Chodorow2015-12-08
| | | | | | | | | Fixes #352. RELNOTES: Files in external repositories are now treated as mutable, which will make the correctness guarantees of using external repositories stronger (existent), but may cause performance penalties. -- MOS_MIGRATED_REVID=109676408
* Open source SkyframeLabelVisitorTest.Gravatar Han-Wen Nienhuys2015-11-04
| | | | | -- MOS_MIGRATED_REVID=106961863
* Add a __workspace_dir__ variable alongside of __embedded_dir__ in the ↵Gravatar Lukacs Berki2015-10-09
| | | | | | | namespace of the WORKSPACE file. -- MOS_MIGRATED_REVID=104952808
* Rationalize copyright headersGravatar Damien Martin-Guillerez2015-09-25
| | | | | | | | | | | The headers were modified with `find . -type f -exec 'sed' '-Ei' 's|Copyright 201([45]) Google|Copyright 201\1 The Bazel Authors|' '{}' ';'` And manual edit for not Google owned copyright. Because of the nature of ijar, I did not modified the header of file owned by Alan Donovan. The list of authors were extracted from the git log. It is missing older Google contributors that can be added on-demand. -- MOS_MIGRATED_REVID=103938715
* Move Label from the lib.syntax to the lib.cmdline package so that:Gravatar Lukacs Berki2015-09-21
| | | | | | | | | | - Label parsing can be simplified - lib.syntax is only contains the code for Skylark and is reasonably independent from the problem domain of building things This change is mostly only changes to imports declarations. The rest is reversing the dependency between :cmdline and :syntax and moving a tiny amount of code between Printer and FilesetEntry and the addition of SkylarkPrintableValue that I couldn't be bothered to separate out into its own change. -- MOS_MIGRATED_REVID=103527877
* Rename ModuleEnvironment.getFileFromDepot to getFileFromWorkspace.Gravatar Ulf Adams2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103367814
* Remove the now-unused BlazeModule.beforeCommand variant.Gravatar Ulf Adams2015-09-17
| | | | | -- MOS_MIGRATED_REVID=103276489
* Change checkRuntime to take a CommandEnvironment instead.Gravatar Ulf Adams2015-09-16
| | | | | | | | | I wanted to merge it into beforeCommand, but the reporter isn't set up yet when we call beforeCommand. Hopefully we can refactor the code to merge it in the future. -- MOS_MIGRATED_REVID=103179268
* Introduce CommandEnvironment and pass it instead of BlazeRuntime.Gravatar Ulf Adams2015-09-15
| | | | | | | | The very long term plan is to make BlazeRuntime immutable, so that we can run multiple commands in the same server. -- MOS_MIGRATED_REVID=103080946
* Description redacted.Gravatar Marian Lobur2015-08-17
| | | | | -- MOS_MIGRATED_REVID=100814605
* Allow modules to specify additional nodes in the graph to be invalidated and ↵Gravatar Janak Ramakrishnan2015-07-29
| | | | | | | | | | | use this functionality to properly invalidate http download nodes if the downloaded zip file doesn't match the specified hash. This still means that the actual files downloaded may not match, but checking all such files may be too expensive. This helps with #336 but before that issue can be closed all remote repositories (git, etc.), should have similar functionality added. -- MOS_MIGRATED_REVID=99317085