Interface for IDE support

375 views
Skip to first unread message

Dan Fabulich

unread,
Feb 22, 2016, 5:45:10 PM2/22/16
to bazel-discuss
The Bazel roadmap http://bazel.io/roadmap.html says that a feature is scheduled for March, "Interface for IDE Support." No link.

Is there some documentation or a PR or something talking about this interface? What will the interface be like? 

Is the intention that Bazel will include IDE support directly, or that IDE support would be supported via external plugins?

Is there a prototype I could play around with?

Alex Humesky

unread,
Feb 22, 2016, 7:22:26 PM2/22/16
to Dan Fabulich, bazel-discuss, Dmitry Lomov
On Mon, Feb 22, 2016 at 5:45 PM Dan Fabulich <danfa...@gmail.com> wrote:
The Bazel roadmap http://bazel.io/roadmap.html says that a feature is scheduled for March, "Interface for IDE Support." No link.

Is there some documentation or a PR or something talking about this interface? What will the interface be like? 
Dmitry can probably give a better answer than I can, but the idea is that an aspect (a mechanism in bazel that attaches itself to each rule in a build and performs some action) creates IDE-specific information that is output for each package. The aspect is enabled by adding some extra command line arguments to bazel.
 

Is the intention that Bazel will include IDE support directly, or that IDE support would be supported via external plugins?
Could you elaborate on what you mean by supporting an IDE directly? I image it would be IDE-specific. The aspect could be written to directly output a file that's consumable by the IDE, or you could have some additional program that converts the output files of the aspect to something consumable by the IDE, or there could be an IDE plugin that consumes the aspect output directly.
 

Is there a prototype I could play around with?

We currently have this:
That's the Android Studio aspect written in java ("native aspect"), and we also have this one for testing the skylark aspect:

That will work for java targets (java_* and android_*). You can invoke it like this:

bazel build --aspects AndroidStudioInfoAspect --output_groups "ide-info" <java target>

and you'll get .aswb-build files in the genfiles tree, which contain binary serialized protos of https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/android_studio_ide_info.proto

If you specify "ide-info-text" for the output_group, you'll get text serialized proto. There is also "ide-resolve" which builds only the files that are required for the ide (e.g. if you specify an android_binary target, the apk won't be built because the ide doesn't need it until it wants to deploy). If you do "+ide-info", that will cause all the normal outputs of the specified target to build built plus the ide files.

One thing that I think is missing at the moment is nice way to discover all the .aswb-build files, I'm not sure if we have something better than walking the genfiles tree and looking for them.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/2146df0c-f96b-4864-aff5-5c1c68ba1a20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Damien Martin-guillerez

unread,
Feb 22, 2016, 7:24:31 PM2/22/16
to Alex Humesky, Dan Fabulich, bazel-discuss, Dmitry Lomov
On Tue, Feb 23, 2016 at 1:22 AM 'Alex Humesky' via bazel-discuss <bazel-...@googlegroups.com> wrote:
On Mon, Feb 22, 2016 at 5:45 PM Dan Fabulich <danfa...@gmail.com> wrote:
The Bazel roadmap http://bazel.io/roadmap.html says that a feature is scheduled for March, "Interface for IDE Support." No link.

Is there some documentation or a PR or something talking about this interface? What will the interface be like? 
Dmitry can probably give a better answer than I can, but the idea is that an aspect (a mechanism in bazel that attaches itself to each rule in a build and performs some action) creates IDE-specific information that is output for each package. The aspect is enabled by adding some extra command line arguments to bazel.
 

Is the intention that Bazel will include IDE support directly, or that IDE support would be supported via external plugins?
Could you elaborate on what you mean by supporting an IDE directly? I image it would be IDE-specific. The aspect could be written to directly output a file that's consumable by the IDE, or you could have some additional program that converts the output files of the aspect to something consumable by the IDE, or there could be an IDE plugin that consumes the aspect output directly.
 

Is there a prototype I could play around with?

We currently have this:
That's the Android Studio aspect written in java ("native aspect"), and we also have this one for testing the skylark aspect:

That will work for java targets (java_* and android_*). You can invoke it like this:

bazel build --aspects AndroidStudioInfoAspect --output_groups "ide-info" <java target>

and you'll get .aswb-build files in the genfiles tree, which contain binary serialized protos of https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/android_studio_ide_info.proto

If you specify "ide-info-text" for the output_group, you'll get text serialized proto. There is also "ide-resolve" which builds only the files that are required for the ide (e.g. if you specify an android_binary target, the apk won't be built because the ide doesn't need it until it wants to deploy). If you do "+ide-info", that will cause all the normal outputs of the specified target to build built plus the ide files.

One thing that I think is missing at the moment is nice way to discover all the .aswb-build files, I'm not sure if we have something better than walking the genfiles tree and looking for them.

--experimental_show_artifacts :)

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/2146df0c-f96b-4864-aff5-5c1c68ba1a20%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.

Alex Humesky

unread,
Feb 22, 2016, 7:33:40 PM2/22/16
to Damien Martin-guillerez, Dan Fabulich, bazel-discuss, Dmitry Lomov
On Mon, Feb 22, 2016 at 7:24 PM Damien Martin-guillerez <dmar...@google.com> wrote:
On Tue, Feb 23, 2016 at 1:22 AM 'Alex Humesky' via bazel-discuss <bazel-...@googlegroups.com> wrote:
On Mon, Feb 22, 2016 at 5:45 PM Dan Fabulich <danfa...@gmail.com> wrote:
The Bazel roadmap http://bazel.io/roadmap.html says that a feature is scheduled for March, "Interface for IDE Support." No link.

Is there some documentation or a PR or something talking about this interface? What will the interface be like? 
Dmitry can probably give a better answer than I can, but the idea is that an aspect (a mechanism in bazel that attaches itself to each rule in a build and performs some action) creates IDE-specific information that is output for each package. The aspect is enabled by adding some extra command line arguments to bazel.
 

Is the intention that Bazel will include IDE support directly, or that IDE support would be supported via external plugins?
Could you elaborate on what you mean by supporting an IDE directly? I image it would be IDE-specific. The aspect could be written to directly output a file that's consumable by the IDE, or you could have some additional program that converts the output files of the aspect to something consumable by the IDE, or there could be an IDE plugin that consumes the aspect output directly.
 

Is there a prototype I could play around with?

We currently have this:
That's the Android Studio aspect written in java ("native aspect"), and we also have this one for testing the skylark aspect:

That will work for java targets (java_* and android_*). You can invoke it like this:

bazel build --aspects AndroidStudioInfoAspect --output_groups "ide-info" <java target>

and you'll get .aswb-build files in the genfiles tree, which contain binary serialized protos of https://github.com/bazelbuild/bazel/blob/master/src/main/protobuf/android_studio_ide_info.proto

If you specify "ide-info-text" for the output_group, you'll get text serialized proto. There is also "ide-resolve" which builds only the files that are required for the ide (e.g. if you specify an android_binary target, the apk won't be built because the ide doesn't need it until it wants to deploy). If you do "+ide-info", that will cause all the normal outputs of the specified target to build built plus the ide files.

One thing that I think is missing at the moment is nice way to discover all the .aswb-build files, I'm not sure if we have something better than walking the genfiles tree and looking for them.

--experimental_show_artifacts :)

Oh yeah, I forgot about that one. The help text gives this warning though:

        category = "undocumented",
        help = "Output a list of all top level artifacts produced by this build."
            + "Use output format suitable for tool consumption. "
            + "This flag is temporary and intended to facilitate Android Studio integration. "
            + "This output format will likely change in the future or disappear completely."
 
So we might replace it with something else.

Dmitry Lomov

unread,
Feb 23, 2016, 4:04:07 AM2/23/16
to Alex Humesky, Damien Martin-guillerez, Dan Fabulich, bazel-discuss
Hi Dan,
even though we were not publishing much about our IDE support plans, we were not sitting idly either.
What Alex and Damien described is correct, I just want to give a broader picture and update on current status.

Our broader plan for IDE support is as follows:
- Bazel will provide necessary information from build targets via Skylark API
- IDE integration implementors will write an aspect in Skylark to communicate that information to the IDE. This will probably require some plugin in the IDE as well (intellij_info.bzl is an example of such aspect).

We have also achieved some success with integrating with IntelliJ, but see this message for some details: https://groups.google.com/d/msg/bazel-discuss/LJOZGSz2B8k/JGdZR45EIAAJ

Many things around this are not yet fully finalized, but that much is clear:
- IDE support via aspects is viable, and using Skylark aspects for that is viable too.
- We do not intend IDE-specific aspects to be part of Bazel longer term, hence AndroidStudioInfoAspect is going away, to be replaced by its Skylark counterpart, so do not rely on its continued existence.
- Something like --experimental_show_artifacts is vital.

As we finalize this entire story, we will document APIs and publish guidance and examples for IDE integration.

I am sure the lack of information on IDE support progress might have been frustrating, but as you can see this is a fairly complex thing (as an incremental build process reflection API is bound to be!), requiring further implementation of aspects, Skylark aspects, API exposure to Skylark and many other things, so just bear with us a little more here :)

Hope this helps and warm regards,
Dmitry
--
Google Germany GmbH
Dienerstr. 12, 80331 München., DE 

Dan Fabulich

unread,
Apr 5, 2016, 3:38:02 PM4/5/16
to bazel-discuss, ahum...@google.com, dmar...@google.com, danfa...@gmail.com
Seeing as about six weeks have come and gone, and so too has March come and gone (the roadmap now predicts IDE integration in April), I thought I might bump this thread to inquire as to an estimate as to when documentation would be available.

I know it's hard to predict when software will be done, but I'm hoping that somebody already has documentation and just needed a polite reminder to share it publicly. :-)

Damien Martin-guillerez

unread,
Apr 5, 2016, 4:05:17 PM4/5/16
to Dan Fabulich, bazel-discuss, dsl...@google.com, ahum...@google.com
Sorry for the delay, I am almost done with an example of usage and then +Dmitry Lomov will do a series of blog post. Hopefully in a few weeks it will be there.

Steven Johnson

unread,
Apr 12, 2016, 7:44:12 PM4/12/16
to Damien Martin-guillerez, Dan Fabulich, bazel-discuss, dsl...@google.com, ahum...@google.com
I'll +1 this request -- the vague summary of aspects sounds like exactly what I need for a particular task, but AFAICT, documentation, examples, or even a clear definition of What Aspects Can And Cannot Do are pretty much non-existent. 

Brian Silverman

unread,
Apr 12, 2016, 8:06:53 PM4/12/16
to Steven Johnson, Damien Martin-guillerez, Dan Fabulich, bazel-discuss, dsl...@google.com, ahum...@google.com
Another +1 here :) I think some similar information for extra actions would be nice too, while it's being discussed.

Also, even though extra actions and aspects work very differently, I can imagine doing a lot of tasks with either. Would it make sense to include some examples of things that are best done with each?

Dmitry Lomov

unread,
Apr 13, 2016, 3:44:22 AM4/13/16
to Brian Silverman, Steven Johnson, Damien Martin-guillerez, Dan Fabulich, bazel-discuss, Alex Humesky
I hear y'all - real SOON now, sorry :(
--
Google Germany GmbH
Erika-Mann-Straße 33, 80636 München, Germany

Dan Fabulich

unread,
May 4, 2016, 5:01:35 PM5/4/16
to bazel-discuss, bsilve...@gmail.com, s...@google.com, dmar...@google.com, danfa...@gmail.com, ahum...@google.com
May the 4th be with you!

I promise not to post about this more often than once a month, but, Dmitry, when you said "real soon now," did you mean that you would deliver the actual interface for IDE support real soon now, or just the documentation?

Should I expect to see documentation in May? Should I expect to see any working code in May?

Damien Martin-guillerez

unread,
May 5, 2016, 1:55:10 AM5/5/16
to Dan Fabulich, bazel-discuss, bsilve...@gmail.com, s...@google.com, ahum...@google.com

We plan to publish documentation as well as some working IDE support. We still have some small blockers for the later. Sorry for the delay. You can follow on GitHub, the list of blockers are marked for milestone 0.3.

Reply all
Reply to author
Forward
0 new messages