aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/Runfiles.java
Commit message (Collapse)AuthorAge
* Reorganize Skylark Reference documentation.Gravatar Dmitry Lomov2016-06-29
| | | | | -- MOS_MIGRATED_REVID=126081020
* Rollback of commit bdfd58a8ca2ed5735d6aaa5b238fb0f689515724.Gravatar Laurent Le Brun2016-06-20
| | | | | -- MOS_MIGRATED_REVID=125160288
* Make the execution root match the runfiles tree structure for external ↵Gravatar Kristina Chodorow2016-06-17
| | | | | | | | | | | | | | | | | | | | | repositories One interesting side effect of how this is implemented is that for external repositories, bin/ and genfiles/ are combined. External repo output is under bazel-out/local-fastbuild/repo_name for each repo. Fixes #1262. RELNOTES[INC]: Previously, an external repository would be symlinked into the execution root at execroot/local_repo/external/remote_repo. This changes it to be at execroot/remote_repo. This may break genrules/Skylark actions that hardcode execution root paths. If this causes breakages for you, ensure that genrules are using $(location :target) to access files and Skylark rules are using http://bazel.io/docs/skylark/lib/File.html's path, dirname, etc. functions. -- MOS_MIGRATED_REVID=125095799
* Create runfiles at both .runfiles/ws/external/repo and .runfiles/repoGravatar Kristina Chodorow2016-04-26
| | | | | | | | | The major piece of #848. RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles. -- MOS_MIGRATED_REVID=120722312
* Add a --legacy_external_runfiles optionGravatar Kristina Chodorow2016-04-25
| | | | | | | | This isn't hooked up to anything yet, but is another piece of getting #848 rolled forward. -- MOS_MIGRATED_REVID=120582973
* Make suffix a PathFragmentGravatar Kristina Chodorow2016-04-22
| | | | | | | | | Breaking up the runfiles tree change into some smaller changes this time around. First step of rolling forward #848. -- MOS_MIGRATED_REVID=120553288
* Automated [] rollback of commit 857cda2c45a5cc68c3fa398311c48c571a64915d and ↵Gravatar Damien Martin-Guillerez2016-04-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | commit 790d2f6009d47fe92cf0cd92a1473bbf0141f32e. *** Reason for rollback *** Broke non-Bazel projects on ci.bazel.io Fixes #1168 *** Original change description *** Move the runfiles for external repositories to under the x.runfiles/ directory This also sets the Bazel workspace name to io_bazel_source. Fixes #848. Relevant to #1116, #1124, RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles.... *** -- MOS_MIGRATED_REVID=120535721
* Make source manifest caching catch external runfile changesGravatar Kristina Chodorow2016-04-21
| | | | | -- MOS_MIGRATED_REVID=120442698
* Clean up the runfiles / files-to-run related code a bit.Gravatar Ulf Adams2016-04-21
| | | | | -- MOS_MIGRATED_REVID=120433463
* Refactor the Event class; always construct through static methods.Gravatar Ulf Adams2016-04-21
| | | | | -- MOS_MIGRATED_REVID=120418505
* Move the runfiles for external repositories to under the x.runfiles/ directoryGravatar Kristina Chodorow2016-04-20
| | | | | | | | | | | | | | | This also sets the Bazel workspace name to io_bazel_source. Fixes #848. Relevant to #1116, #1124, RELNOTES[INC]: All repositories are now directly under the x.runfiles directory in the runfiles tree (previously, external repositories were at x.runfiles/main-repo/external/other-repo. This simplifies handling remote repository runfiles considerably, but will break existing references to external repository runfiles. --- Furthermore, if a Bazel project does not provide a workspace name in the WORKSPACE file, Bazel will now default to using __main__ as the workspace name (instead of "", as previously). The repository's runfiles will appear under x.runfiles/__main__/. -- MOS_MIGRATED_REVID=120224534
* Expose __init__.py filenames to SkylarkGravatar Brian Silverman2016-04-15
| | | | | | | | | | | | This is important for packaging Python code in a way which is compatible with the way Bazel builds its standard runfiles directory. Refs #671 -- Change-Id: Ica2adab481cfecabb84b608cd952b0cae5a8653c Reviewed-on: https://bazel-review.googlesource.com/#/c/2900/ MOS_MIGRATED_REVID=119945845
* Expose runfiles symlink functionality in SkylarkGravatar Googler2016-03-11
| | | | | | | | | | | | | | | | | | | | | The Skylark rule context object has a runfiles method. This adds two optional parameters to that method, "symlinks" and "root_symlinks", that expose functionality from the underlying Runfiles java class. With this functionality, one can construct links in the runfiles tree where the source and destination of the link have different names and/or relative directories. This might be useful for things like AppEngine rules where a file in a subdirectory of the source tree needs to appear in the root directory of the runfiles tree. If either new parameter is used, the runfiles is subject to stricter validity checking. This checking propagates to other runfiles that depend on it. RELNOTES: Added "root_symlinks" and "symlinks" parameters to Skylark runfiles() method. -- MOS_MIGRATED_REVID=116879064
* Detect and warn about runfiles conflicts.Gravatar Googler2016-03-08
| | | | | | | | | A runfile conflict is when two different artifacts have been added to a Runfiles object under the same relative path. Conflict resolution is unchanged (last artifact wins). -- MOS_MIGRATED_REVID=116584195
* Move annotation classes used for referencing framework Java classes from ↵Gravatar John Field2015-12-16
| | | | | | | | | | | | | | Skylark into their own package. This allows, e.g., classes in the syntax package to access classes in the cmdline package without creating circular dependencies. While we're here: - Removed a couple of unused BUILD deps flagged in []. - Updated SkylarkRuleImplementationFunctionsTest to remove non-ASCII characters and clarify the intent of the test. -- MOS_MIGRATED_REVID=110360763
* Use Bazel Preconditions variant which avoids varargs array creationGravatar Mark Schaller2015-12-10
| | | | | | | Reduces garbage. -- MOS_MIGRATED_REVID=109914243
* Close some streams that we didn'tGravatar Miguel Alcon Pinto2015-11-05
| | | | | -- MOS_MIGRATED_REVID=107048547
* Add ctor commentGravatar Kristina Chodorow2015-10-27
| | | | | -- MOS_MIGRATED_REVID=106410161
* 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
* Separate build-specific types and types inherent to Skylark.Gravatar Lukacs Berki2015-09-21
| | | | | -- MOS_MIGRATED_REVID=103374106
* Always inject the runfiles prefix into the Runfiles.Builder.Gravatar Ulf Adams2015-09-03
| | | | | | | The other constructor is now private. -- MOS_MIGRATED_REVID=102252544
* Add a @deprecated annotation to Runfiles#addArtifacts.Gravatar Carmi Grushko2015-08-28
| | | | | -- MOS_MIGRATED_REVID=101730178
* Set the workspace suffix for runfilesGravatar Kristina Chodorow2015-08-13
| | | | | | | This CL covers the "easy" cases. Followup CLs will take care of couple dozen remaining gnarly ones. -- MOS_MIGRATED_REVID=100479410
* Skylark documentation fixesGravatar Laurent Le Brun2015-07-29
| | | | | -- MOS_MIGRATED_REVID=99283744
* Allow Skylark to access information about runfiles.Gravatar Brian Silverman2015-06-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is important to build packages of bazel-built code, especially python. Simple example usage: def _runfiles_test_impl(ctx): runfiles_provider = provider(ctx.attr.src, 'analysis.RunfilesProvider') runfiles = runfiles_provider.default_runfiles.artifacts commands = [] for f in runfiles: commands += [ 'mkdir -p $(dirname %s/%s)' % (ctx.outputs.outdir.path, f.short_path), 'cp %s %s/%s' % (f.path, ctx.outputs.outdir.path, f.short_path), ] ctx.action( outputs = [ ctx.outputs.outdir ], inputs = list(runfiles), command = ' && '.join(commands) ) '''A simple rule which copies all the runfiles from src into outdir.''' runfiles_buildtest = rule( implementation = _runfiles_test_impl, attrs = { 'src': attr.label(allow_files=False, mandatory=True), 'outdir': attr.output(mandatory=True), }, ) -- Change-Id: I8fbd4c6ea462685142cf199dfe3348bc4436cdcb Reviewed-on: https://bazel-review.googlesource.com/1530 MOS_MIGRATED_REVID=96576360
* Add runfiles to metadata caches and make them isFile awareGravatar Michajlo Matijkiw2015-05-26
| | | | | -- MOS_MIGRATED_REVID=94318260
* Return all mappings in one Map from Runfiles#getRunfilesInputs(...)Gravatar Michajlo Matijkiw2015-05-08
| | | | | | | | | We wind up combining them anyway in the manifest file and it seems that this is consistent with how we read them back. Return them all at once to avoid tedious duplication in handling of them. -- MOS_MIGRATED_REVID=93058482
* Become more restrictive around Runfiles#manifestExpanderGravatar Michajlo Matijkiw2015-04-16
| | | | | | | | | | | | Previously the contract was pretty liberal and could allow addition of extra Artifacts. Create a more restrictive interface allowing the bare minimum- adding empty files to the tree. This makes the contract of Runfiles#getAllArtifacts() more sound, since arbitrary artifacts can't be added, and it makes it easier to figure out what implementations of manifest expansion exist out there. -- MOS_MIGRATED_REVID=91233821
* VisibleForTesting cleanup in RunfilesGravatar Michajlo Matijkiw2015-04-16
| | | | | | | | | Many of the @VisibleForTesting annotations didn't actually apply. Remove them, apply the annotation to places where it applies, and change visibility of mttehods to be more restrictive. -- MOS_MIGRATED_REVID=91208297
* remove support for supplying relative root for runfilesGravatar Michajlo Matijkiw2015-03-16
| | | | | | | | | | SourceManifestAction.Builder#setTopLevel is the only way the relative roots was capable of being supplied. Its documentation states "Most likely, you don't need this". As it is unused removing the extra code and interpreting as "you don't need this". -- MOS_MIGRATED_REVID=88574913
* Make the semantics of runfiles trees saner by always using the entry that ↵Gravatar Lukacs Berki2015-03-13
| | | | | | | | | comes last in the iteration order for a particular path. Before, if there were three entries for the same path with the middle one being different, the first one would be overridden by the middle one, and the last one would be omitted because it is .equals() to the first. -- MOS_MIGRATED_REVID=88377253
* Remove the unused and weird "omit a random symlink from the runfiles being ↵Gravatar Lukacs Berki2015-03-10
| | | | | | | merged" functionality from Runfiles.Builder. -- MOS_MIGRATED_REVID=87954443
* Change the name of the runfiles constantGravatar Kristina Chodorow2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87621601
* Get runfiles prefix from the WORKSPACE fileGravatar Kristina Chodorow2015-03-05
| | | | | -- MOS_MIGRATED_REVID=87513766
* Update from Google.Gravatar Han-Wen Nienhuys2015-02-25
-- MOE_MIGRATED_REVID=85702957