aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/python/PyBinary.java
Commit message (Collapse)AuthorAge
* C++: Refactors PyWrapCc to make it easier to migrate to SkylarkGravatar plf2018-06-19
| | | | | | | | | Rolls forward https://github.com/bazelbuild/bazel/commit/c720152ec1936a537c9519d522d3cb41d19cff77. This CL includes testing to make sure that linker parameters coming from every possible provider in Python rules is propagated. RELNOTES:none PiperOrigin-RevId: 201160720
* Automated rollback of commit c720152ec1936a537c9519d522d3cb41d19cff77.Gravatar janakr2018-06-18
| | | | | | | | | | | | | | | | | *** Reason for rollback *** See linked bug. *** Original change description *** C++: Refactors PyWrapCc to make it easier to migrate to Skylark Rolling forward https://github.com/bazelbuild/bazel/commit/6c87715b8ac6b32e636ba307440e2b7362b10a48. When I first tried to roll forward this CL I missed one place where PyCcLinkParamsProvider.TO_LINK_PARAMS should have been called. The target //production/midas/config:client_config_pb builds fine now. RELNOTES:none PiperOrigin-RevId: 201070354
* C++: Refactors PyWrapCc to make it easier to migrate to SkylarkGravatar plf2018-06-11
| | | | | | | | | Rolling forward https://github.com/bazelbuild/bazel/commit/6c87715b8ac6b32e636ba307440e2b7362b10a48. When I first tried to roll forward this CL I missed one place where PyCcLinkParamsProvider.TO_LINK_PARAMS should have been called. The target //production/midas/config:client_config_pb builds fine now. RELNOTES:none PiperOrigin-RevId: 200032805
* Automated rollback of commit 6c87715b8ac6b32e636ba307440e2b7362b10a48.Gravatar cpeyser2018-06-08
| | | | | RELNOTES:none PiperOrigin-RevId: 199840978
* C++: Refactors PyWrapCc to make it easier to migrate to SkylarkGravatar plf2018-06-08
| | | | | | | | Rolling forward https://github.com/bazelbuild/bazel/commit/6afc2eb67675e928bc8fa10c5d1745223186b6e0. This CL was only rolled back to make it easier to rollback https://github.com/bazelbuild/bazel/commit/d0982b905d93e219a0caccdcf5d6ae1e219387c2. RELNOTES:none PiperOrigin-RevId: 199779304
* Automated rollback of commit d0982b905d93e219a0caccdcf5d6ae1e219387c2.Gravatar janakr2018-06-07
| | | | | | | | | | | | | | | *** Reason for rollback *** See linked bug. *** Original change description *** C++: Delete PyCcLinkParamsProvider. No longer needed. RELNOTES:none PiperOrigin-RevId: 199710626
* Automated rollback of commit f137cea0ac74334013e7b064e59d1624cf032ac4.Gravatar janakr2018-06-07
| | | | | | | | | | | | | *** Reason for rollback *** See linked bug. *** Original change description *** C++: Refactors PyWrapCc to make it easier to migrate to Skylark RELNOTES:none PiperOrigin-RevId: 199702630
* C++: Refactors PyWrapCc to make it easier to migrate to SkylarkGravatar plf2018-06-07
| | | | | RELNOTES:none PiperOrigin-RevId: 199619637
* C++: Delete PyCcLinkParamsProvider.Gravatar plf2018-06-07
| | | | | | | No longer needed. RELNOTES:none PiperOrigin-RevId: 199593828
* C++: Deletes CcLinkParamsInfoGravatar plf2018-05-15
| | | | | | | | This class is not necessary anymore. We can use CcLinkParamsStoreImpl directly which has been renamed to CcLinkParamsStore. RELNOTES:none PiperOrigin-RevId: 196656488
* C++: Wrap CcLinkParamsInfo with CcLinkingInfo.Gravatar plf2018-04-16
| | | | | | | CcLinkingInfo will eventually wrap all C++ linking providers. CcLinkParamsInfo is no longer a provider and will be renamed in a later CL. RELNOTES:none PiperOrigin-RevId: 193011702
* Expose an actions provider on RuleConfiguredTarget instances.Gravatar cparsons2018-03-06
| | | | | | | | | Given a target (for example from a skylark aspect), one will be able to access a list of actions that the target generated using "target.actions". This is without additional memory footprint. Actions themselves are not fully exposed to skylark (and thus there isn't much meaning to gather from them in skylark yet). Access methods will follow soon. RELNOTES: None. PiperOrigin-RevId: 188098079
* Automated rollback of commit fa0fac2a4e8a2e5c01b8390878289d00dcc17dba.Gravatar lberki2018-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Remove example changes; those need to build with the last Bazel release. *** Original change description *** Automated rollback of commit 0f9c6ea574918dda094cf5423fa3822112846c30. *** Reason for rollback *** Breaks Kokoro and I accidentally submitted the change without presubmit checks. *** Original change description *** Make __init__.py files creation optional Introduce a new attribute to py_binary and py_test to control whether to create `__init__.py` or not. Fixes https://github.com/bazelbuild/rules_python/issues/55 Closes #4470. PiperOrigin-RevId: 185806241
* Automated rollback of commit 0f9c6ea574918dda094cf5423fa3822112846c30.Gravatar lberki2018-02-14
| | | | | | | | | | | | | | | | | | | *** Reason for rollback *** Breaks Kokoro and I accidentally submitted the change without presubmit checks. *** Original change description *** Make __init__.py files creation optional Introduce a new attribute to py_binary and py_test to control whether to create `__init__.py` or not. Fixes https://github.com/bazelbuild/rules_python/issues/55 Closes #4470. PiperOrigin-RevId: 185676592
* Make __init__.py files creation optionalGravatar Mouad Benchchaoui2018-02-14
| | | | | | | | | | | Introduce a new attribute to py_binary and py_test to control whether to create `__init__.py` or not. Fixes https://github.com/bazelbuild/rules_python/issues/55 Closes #4470. PiperOrigin-RevId: 185672243
* Remove the runfiles middleman from py_binary's data runfiles.Gravatar Benjamin Peterson2017-10-26
| | | | | | | | | | | | | | This requires polluting Runfiles and RuleConfiguredTargetBuilder with some custom infrastructure to lift a py_binary runfiles middleman into the FilesToRunProviders and output groups of its reverse dependency. That can all go away when the --experimental_build_transitive_python_runfiles transition is complete. This is another step towards https://bazel-review.googlesource.com/c/bazel/+/14010. Change-Id: Ib750d72d4be42324c8edec485707480690b9fc9c PiperOrigin-RevId: 173514090
* Make the state in RuleContext explicitGravatar ulfjack2017-09-28
| | | | | | | | | | | | | | | | | | | | | This isn't ideal - RuleContext should not have state, but this ended up happening between adding a cache and refactoring how make variables are discovered. I have carefully traced back all callers that provide custom make variable suppliers and added an init call to their rule initialization. Note that the ConfigurationMakeVariableContext is _cached_, so callers that call in without any make variable suppliers and then call again with them would get the context from the previous call. We now enforce that the ConfigurationMakeVariableContext is only initialized once, and that this happens before any usage, which is slightly better than the previous state, where initialization was silently ignored on any subsequent call. Progress on #2475. PiperOrigin-RevId: 170312285
* Simplify RuleContext APIGravatar ulfjack2017-09-27
| | | | | | | | | Use ConfigurationMakeVariableContext instead of passing in lists of MakeVariableSuppliers. Progress on #2475. PiperOrigin-RevId: 170182945
* Add an option to control building of transitive py_binary runfiles trees. ,Gravatar Benjamin Peterson2017-09-26
| | | | | | | | | | | | | | | | | ) Currently, "bazel build :script" constructs the bazel-bin/python-prog.runfiles tree. We'd like to do anyway with this behavior but doing so is a backwards-incompatible change. To facilitate a transition, this CL adds an option --experimental_build_transitive_python_runfiles to control the behavior. In the example above, "bazel build --noexperimental_build_transitive_python_runfiles :script" won't construct bazel-bin/python-prog.runfiles. Change-Id: If4d5a84c956a0bbac9067dcf38a00e5732c450f2 PiperOrigin-RevId: 170038245
* Move RuleConfiguredTarget to lib.analysis.configuredtargets.Gravatar gregce2017-09-19
| | | | | | This is a trivial change with a large file footprint. PiperOrigin-RevId: 169169864
* Rename some of native declared providers according to the new naming scheme.Gravatar dslomov2017-08-21
| | | | | RELNOTES: None PiperOrigin-RevId: 165910455
* Simplify RunfilesSupport interface by having it call ↵Gravatar Googler2017-08-21
| | | | | | | RuleContext.shouldCreateRunfilesSymlinks() itself. RELNOTES: None. PiperOrigin-RevId: 165774395
* Windows: Implement python native launcherGravatar Yun Peng2017-08-21
| | | | | | | | | | | | Now Bazel build a Windows exe to launch the python self-extracting zip file by default, using --windows_exe_launcher=0 to switch back to cmd wrapper. The extra zip file with shebang preprended is not built on Windows anymore, even when using cmd wrapper. Change-Id: Ic7060326f19ca6e2e73ea8d8211afd1c7618083c PiperOrigin-RevId: 165707076
* Move RuleConfiguredTargetFactory to lib.analysisGravatar ulfjack2017-08-07
| | | | | | | This is part of splitting up the build-base library into separate libraries for analysis, exec, and rules. PiperOrigin-RevId: 164446955
* Allow py_binary to be the executable of a Skylark action or anyGravatar Philipp Wollermann2017-07-18
| | | | | | | | | SpawnAction on Windows. RELNOTES: None. Change-Id: I2d926447511dab5fb804051abdbef9031cb089be PiperOrigin-RevId: 162201440
* Make native declared providers not implement TransitiveInfoCollection.Gravatar dslomov2017-07-12
| | | | | | | | | | | | (Almost) all native declared providers are accessed as such and not as native non-declared providers (inheritors of TransitiveInfoCollaction). There are still three providers that use TransitiveInfoCollection.WithLegacySkylarkName mechanism, I'll address them in the follow-up CL. RELNOTES: None. PiperOrigin-RevId: 161655315
* Use FeatureConfiguration to compute value of CC_FLAGS make variableGravatar hlopko2017-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | This cl introduces new action_config type for Crosstool named 'generic'. This can be used to set the value of CC_FLAGS make variable using much more expressive mechanism (action_configs + features) than previous make_variable Crosstool messages. This has been requested by the C++ LPT. However, as FeatureConfiguration needs RuleContext, CC_FLAGS cannot be computed using configuration only anymore. Also, FeatureConfiguration is C++ rules specific class, and Bazel build-base cannot depend on it. Therefore we cannot use FeatureConfiguration for ExtraActions, for example. Because it cannot be made perfect, this cl is not updating all the possible places that expand make variables but limits the scope to: * genrule (the only widely used rule that often expands make variables) * *_test (CC_FLAGS is used by Tensorflow in the 'args' attribute) * cc_rules (people sometimes set 'copts' to something like: "-DCC_STRING=\\\"$(CC)\\\" -DCC_FLAGS_STRING=\"$(CC_FLAGS)\"" The long term plan is to use Skylark C++ API to get C++ command lines, so CC_FLAGS together with this inconsistent solution will be removed. RELNOTES: CC_FLAGS can be defined using 'generic' action_config in CROSSTOOL PiperOrigin-RevId: 157202883
* Add mechanism to trigger Python type-stripping via a tag.Gravatar Googler2017-04-06
| | | | | | RELNOTES: none PiperOrigin-RevId: 152291766
* Remove some unused code from the Python rules.Gravatar Lukacs Berki2016-09-08
| | | | | -- MOS_MIGRATED_REVID=132433369
* Allow use of Exceptions to exit early out of configured-target creation, ↵Gravatar Chris Parsons2016-05-24
| | | | | | | | | | instead of passing and checking null in all helpers. Demonstrates this pattern usage in a few select rules (e.g. AndroidBinary) where this was particularly egregious. There are many places which can benefit from this pattern -- this change doesn't try to fix them all at once. -- MOS_MIGRATED_REVID=123012378
* 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
* 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
* 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
* Fixed indentation problem: 8 spaces -> 4 spacesGravatar Yun Peng2016-03-21
| | | | | -- MOS_MIGRATED_REVID=117583615
* Python provider is now available in SkylarkGravatar Yun Peng2016-03-03
| | | | | | | | | | | | | Using mandatoryProvidersList to validate python rules' dependency. Added a SkylarkProvider named 'py' which is a SkylarkClassObject in Java and a struct in Skylark. Native python rule and Skylark python rule should have this provider so that they can depend on each other. RELNOTES[NEW]: Native python rule can depend on skylark rule as long as skylark rule provides 'py' provider. -- MOS_MIGRATED_REVID=116241504
* Add imports attribute to Bazel native Python rules to allow adding ↵Gravatar David Chen2016-02-10
| | | | | | | | | | | directories to PYTHONPATH. Fixes #702 RELNOTES: Add imports attribute to native Python rules. -- MOS_MIGRATED_REVID=114314430
* Description redacted.Gravatar Googler2015-11-10
| | | | | -- MOS_MIGRATED_REVID=107379349
* 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
* Prevented catching/wrapping of InterruptedExceptions, especially in ↵Gravatar Florian Weikert2015-09-14
| | | | | | | BaseFunction. -- MOS_MIGRATED_REVID=102988766
* Fix C++ link order for py_library and py_binary rules.Gravatar Ulf Adams2015-08-28
| | | | | -- MOS_MIGRATED_REVID=101756783
* 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
* Enable simple compilation of Python artifacts for py_binary and py_library.Gravatar Googler2015-07-27
| | | | | -- MOS_MIGRATED_REVID=99163140
* Attach runfiles middlemen to py-binary data runfilesGravatar Michajlo Matijkiw2015-06-01
| | | | | -- MOS_MIGRATED_REVID=94758273
* 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
* Initial checkin of Python rules into Bazel.Gravatar Lukacs Berki2015-03-23
-- MOS_MIGRATED_REVID=89123900