aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/android/NativeLibs.java
Commit message (Collapse)AuthorAge
* Make SymlinkTreeAction properly use the configuration's environmentGravatar ulfjack2018-05-22
| | | | | | | | In particular, fix its use of client make variables. Fixes #4750. PiperOrigin-RevId: 197545415
* Makes ApkActionsBuilder honor --nobuild_runfile_manifests.Gravatar shahan2018-04-18
| | | | PiperOrigin-RevId: 193422658
* Make RuleContext#getSplitPrerequisiteConfiguredTargetAndTargets public and ↵Gravatar janakr2018-03-10
| | | | | | use it in android/NativeLibs. PiperOrigin-RevId: 188625886
* Automatic formatting cleanup of Android *.java files.Gravatar jingwen2017-12-18
| | | | | RELNOTES: None. PiperOrigin-RevId: 179425421
* Move native deps collection code out of android_binary.Gravatar ajmichael2017-12-09
| | | | | | | Also remove a TODO that was addressed in unknown commit. RELNOTES: None PiperOrigin-RevId: 178489151
* Remove some deadish Windows-related runfiles code.Gravatar Benjamin Peterson2017-12-04
| | | | | | | | | | | | | | | In particular, SymlinkTreeAction no longer needs to accept artifacts as an input. --experimental_enable_runfiles now immediately reports an error on Windows. This mostly unwinds e4974e4cc6aeb437d36b3b36eb20142b7120fb16 ("Separate runfiles middlemen into two layers") and 41f4456ac2348bef66739194853a1ddadcbb887e ("Make runfiles tree creation on Windows depend on the artifacts of the actual runfiles."). See https://groups.google.com/d/msg/bazel-dev/btOAgxv434g/bDhTOOePAgAJ. Change-Id: Iac3308669bfc07abfd1c91445922269d8fdc2a26 PiperOrigin-RevId: 177837504
* Pass CppSemantics down to the CppLinkActionBuilderGravatar hlopko2017-09-29
| | | | | | | | | Currently CppLinkActionBuilder is not using CppSemantics, but it will when we use full CppCompileAction for linkstamp compiles. This cl is a preparation for that. RELNOTES: None. PiperOrigin-RevId: 170467826
* Expose the native libs of the android_binary rule to skylark.Gravatar Googler2017-04-18
| | | | | RELNOTES: none PiperOrigin-RevId: 153223511
* Refactor all ctor callsites of PathFragment to instead call a static ↵Gravatar nharmata2017-04-05
| | | | | | | | | | | | 'create' method. This paves the way for changing PathFragment to e.g. an abstract class with multiple subclasses. This way we can split out the windows-specific stuff into one of these concrete classes, making the code more readable and also saving memory (since the shallow heap size of the NonWindowsPathFragment subclass will hopefully be smaller than that of the current PathFragment). This also lets us pursue gc churn optimizations. We can now do interning in PathFragment#create and can also get rid of unnecessary intermediate PathFragment allocations. RELNOTES: None PiperOrigin-RevId: 152145768
* Switch to RunfilesSuppliers for communicating runfilesGravatar Michajlo Matijkiw2017-01-30
| | | | | | | | | | | | | | | | | | | | | | | ActionSpawn/SpawnAction now deal exclusively in RunfilesSuppliers, manifests maps are no more. There is some lingering awkwardness, in particular: - Manifests still need to be tracked in some places, we can work out if this is still necessary on a case by case basis. - Skylark makes actions' runfiles available via 'resolve_command' where they are consumed by 'action'. I've updated the documentation, though the name isn't entirely accurate anymore. That being said these interfaces _are_ marked as experimental, so we _should_ be able to be flexible here. Overall, I think the benefits consolidating runfiles into suppliers, from both code cleanliness and performance perspectives (no longer needing to parse manifests), outweights the awkwardnesses. RELNOTES: resolve_command/action's input_manifest return/parameter is now list -- PiperOrigin-RevId: 145817429 MOS_MIGRATED_REVID=145817429
* Update call sites to FileWriteAction to use the ↵Gravatar Jon Brandvein2016-12-20
| | | | | | | | | | --experimental_transparent_compression flag Also add test to ensure lazy strings aren't forced. -- PiperOrigin-RevId: 142496520 MOS_MIGRATED_REVID=142496520
* Move some actions to language-specific packages, where they belong.Gravatar Lukacs Berki2016-11-23
| | | | | -- MOS_MIGRATED_REVID=140024976
* Rollback of commit b5ac354867c4d8deb543285e87e636504078fb69.Gravatar Michael Staib2016-08-25
| | | | | | | | | *** Reason for rollback *** Roll forward with fixes. -- MOS_MIGRATED_REVID=131224077
* Allow Skyframe graph lookups and value retrievals to throw InterruptedException.Gravatar Janak Ramakrishnan2016-08-16
| | | | | | | The only place we now don't handle InterruptedException is in the action graph created after analysis, since I'm not sure that will be around for that much longer. -- MOS_MIGRATED_REVID=130327770
* Add the repository name as a parameter to the output path functionsGravatar Kristina Chodorow2016-08-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This doesn't do anything yet, it's in preparation for the execroot rearranging change. The execroot will have one bazel-out per repo, so it'll look like: execroot/ repo1/ bazel-out/ local-fastbuild/ bin/ repo2/ bazel-out/ local-fastbuild/ bin/ genfiles/ repo3/ bazel-out/ local-fastbuild/ testlogs/ and so on. Thus, any output path (getBinDirectory() & friends) needs to know what the repo name is. This changes so many places in the code I thought it would be good to do separately, then just flip the functionality in the execroot-rearranging commit. While I was poking around, I changed all of the refs I could from getPackageRelativeArtifact() to getBin/GenfilesArtifact(), so that 1) rule implementation don't have to know as much about roots and 2) they'll be more isolated from other output dir changes. `bazel info` and similar just return roots for the main repository. The only "change" is passing around a target label in the Java rules. Continues work on #1262. -- MOS_MIGRATED_REVID=129985336
* Sets SONAME on shared objects in Android binaries.Gravatar Adam Michael2016-08-11
| | | | | | | | | | | | | | | Adds a linker flag to set the internal DT_SONAME. This fixes #1578 for SDK 24 and removes the warnings for previous SDKs. There is no need to set the linker flag for android_librarys that depend on native code, because the linker flag will be set by the android_binarys that depend on that android_library. Testing is done via `readelf` executable that is shipped with the NDK. -- Change-Id: I16fdfe6522c8694ce51554289122bf035a61d9ec Reviewed-on: https://bazel-review.googlesource.com/#/c/4302/ MOS_MIGRATED_REVID=129920256
* Short-circuit runfiles tree creation if runfiles are disabled (for example, ↵Gravatar Lukacs Berki2016-08-04
| | | | | | | on Windows by default) -- MOS_MIGRATED_REVID=129319018
* Rollback of commit 49dfc29a40764ae48f2343007f88f3a4938498f1.Gravatar Yun Peng2016-08-02
| | | | | | | | | | | | | | | | | | | | *** Reason for rollback *** This change causes android_integration_test failing on Mac. *** Original change description *** Sets SONAME on shared objects in Android binaries. Adds a linker flag to set the internal DT_SONAME. This fixes #1578 for SDK 24 and removes the warnings for previous SDKs. There is no need to set the linker flag for android_librarys that depend on native code, because the linker flag will be set by the android_binarys that depend on that android_library. -- MOS_MIGRATED_REVID=129074607
* Sets SONAME on shared objects in Android binaries.Gravatar Adam Michael2016-08-01
| | | | | | | | | | | | | Adds a linker flag to set the internal DT_SONAME. This fixes #1578 for SDK 24 and removes the warnings for previous SDKs. There is no need to set the linker flag for android_librarys that depend on native code, because the linker flag will be set by the android_binarys that depend on that android_library. -- Change-Id: If6422f2c2677ec974a3682e3038d7fe159ed4978 Reviewed-on: https://bazel-review.googlesource.com/#/c/4210/ MOS_MIGRATED_REVID=128833820
* Revert "Sets SONAME on shared objects in Android binaries."Gravatar Damien Martin-Guillerez2016-07-29
| | | | | | | | This reverts commit e65876a28965c72f7a48a16be3390ba7c5c97a6f. This commit have not gone through the proper workflow. Fixes #1582.
* Sets SONAME on shared objects in Android binaries.Gravatar Adam2016-07-28
| | | | | | | | | | Adds a linker flag to set the internal DT_SONAME. This fixes #1578 for SDK 24 and removes the warnings for previous SDKs. There is no need to set the linker flag for android_librarys that depend on native code, because the linker flag will be set by the android_binarys that depend on that android_library. Change-Id: I0d4fd78ffaf03c19ae3712bdeb28a52722a22f6f
* Rollback of commit 588a6a04c748a02f583d552660434d74190bb3ba.Gravatar Florian Weikert2016-07-04
| | | | | | | | | *** Reason for rollback *** Broke some targets -- MOS_MIGRATED_REVID=126574275
* Support copy-only native code in modern native support for android_binary.Gravatar Michael Staib2016-06-30
| | | | | | | | | | | | | | | | | | | | | | | legacy_native_support makes it so that Bazel copies .so's instead of linking. This allows Bazel to include third-party native code without running an NDK. Turning it off allows Bazel to actually compile native code, but at the cost of this copy case no longer working without an NDK, and creating an unnecessary shared library which will most likely never be used. This CL makes it so that if no actual source code or static libraries are in the transitive closure, the linker is not run at the android_binary level. This means that legacy_native_support as a separate concept can be removed, and it is - the attribute remains, but is a no-op. This will be removed in a future change. The matching flag (--legacy_android_native_support) has already been removed. RELNOTES: The link mode for Android native code is now automatically determined based on the transitive closure of cc_libraries, and legacy_native_support is now a no-op. --legacy_android_native_support has been removed. -- MOS_MIGRATED_REVID=126244755
* Disable runfiles on Windows.Gravatar Dmitry Lomov2016-06-21
| | | | | | | | | | | | This adds a new configuration option that allows disabling the creation of symlink forest for runfiles. On Windows, symlink forest is disabled by default; only the runfiles manifest is created. For shell tests, a function 'rlocation' is provided that converts from runfiles location to a real location. Work towards #1212. -- MOS_MIGRATED_REVID=125439553
* Adds the text output parameter and a partial manifest to the action key for ↵Gravatar Alex Humesky2016-04-29
| | | | | | | ApkManifestAction, so that the key correctly changes when the structure of the manifest changes. -- MOS_MIGRATED_REVID=121058425
* 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
* Review a number of action subclasses and update them according to the spec.Gravatar Ulf Adams2016-04-19
| | | | | | | | Consists of adding @Immutable annotations, adding final modifiers, and changing the types of fields to immutable types. -- MOS_MIGRATED_REVID=120221067
* Use the local shell environment for invoking build-runfiles.Gravatar Lukacs Berki2016-03-30
| | | | | | | This is necessary because build-runfiles depends on the msys shared library, which (as per DLL lookup rules on Windows) is checked under the entries of PATH. -- MOS_MIGRATED_REVID=118556684
* Windows: execute build-runfiles through shell.Gravatar Dmitry Lomov2016-02-12
| | | | | | | Needed for #276. -- MOS_MIGRATED_REVID=114529775
* Make runfiles tree creation on Windows depend on the artifacts of the actual ↵Gravatar Lukacs Berki2016-01-26
| | | | | | | | | | | | | | | runfiles. This is necessary because the plan for Windows calls for knowing if the target of the symlink is a directory or a file, thus, we cannot create runfiles trees before the artifacts in them are built. This probably comes with a performance hit due to the extra scheduling constraints. This makes almost every test pass save: - test_tmpdir in bazel_test_test, which I hereby dismiss as a fluke - test_http_archive_tgz in external_integration_test (Maybe a permissions issue due to copying things?) - A bunch of test in external_correctness_test, probably related to the fact that since we are copying things, we don't notice changes to the original files. -- MOS_MIGRATED_REVID=113050025
* 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
* Always inject the runfiles prefix into the Runfiles.Builder.Gravatar Ulf Adams2015-09-03
| | | | | | | The other constructor is now private. -- MOS_MIGRATED_REVID=102252544
* Copies shared object dependencies when building Android native binaries.Gravatar Michael Staib2015-08-25
| | | | | | | | | | | | Previously, shared objects in the transitive closure of an Android binary would be linked in, but not be sent to the apkbuilder. This sends all the shared objects used for linking to join the other native libraries in the APK, so they will be loadable when the main library created by the link step is loaded. Fixes #357. -- MOS_MIGRATED_REVID=101365491
* Build a symlink tree for Android native library symlinks so that libraries ↵Gravatar Lukacs Berki2015-08-04
| | | | | | | | | from previous builds with a different CPU do not end up in the APK. Fixes #344. -- MOS_MIGRATED_REVID=99550457
* Check that most output artifacts are under a directory determined by the ↵Gravatar Lukacs Berki2015-07-29
| | | | | | | | | repository and package of the rule being analyzed. Currently this directory is PACKAGE for rules in the main repository and external/REPOSITORY_NAME/PACKAGE for rules in other repositories. This is a plan to fix #293. Ideally, we would simply make it impossible to create artifacts not under that location, but in practice, we cannot do that because some rules do want to do this, mostly those that are already problematic due to shared actions. So the battle plan is to eliminate as many calls to AnalysisEnvironment.getDerivedArtifact() as I possibly can and audit the rest. -- MOS_MIGRATED_REVID=99351151
* Use the -nf option of ApkBuilder (which is available in the Android SDK) ↵Gravatar Lukacs Berki2015-06-01
| | | | | | | | | instead of the -nl one (which is not) to include native libraries. The alternative implementation uses a symlink tree, but given that we never have many native libraries, I opted for the simpler approach. -- MOS_MIGRATED_REVID=94891099
* Move the source code of the Android rules to the Bazel tree.Gravatar Lukacs Berki2015-05-19
This is mostly a "[] mv", except for the extra constant that specifies the location of the Android SDK and moving the $zip attribute. They are minor enough to be included in this CL. Tested by creating a Bazel tree, compiling it and verifying that the Android classes are in libblaze.jar. I also eyeballed the source as a final check that nothing sensitive gets leaked. -- MOS_MIGRATED_REVID=93971892