question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add entrypoint for compile progress notifications

See original GitHub issue

Build tools have ways to hook into compilers to get progress notifications. For example, this is Zinc’s interface:

/*
 * Zinc - The incremental compiler for Scala.
 * Copyright 2011 - 2017, Lightbend, Inc.
 * Copyright 2008 - 2010, Mark Harrah
 * This software is released under the terms written in LICENSE.
 */

package xsbti.compile;

/**
 * An API for reporting when files are being compiled.
 *
 * This design is tied to the Scala compiler but it is used
 * by the Java compiler too, check the docs of the methods.
 */
public interface CompileProgress {

	/**
	 * Start the progress of a concrete phase for the path of a given
	 * compilation unit.
	 *
	 * @param phase The phase of the compiler being run.
	 * @param unitPath The path of the compilation unit. It will be empty
	 *                 when a Java compiler is reporting the progress.
	 */
	void startUnit(String phase, String unitPath);

	/**
	 * Advance the progress of the current unit.
	 *
	 * @param current The current progress.
	 * @param total The total of the progress that has to be achieved.
	 *
	 * @return Whether the user has cancelled compilation or not.
	 */
	boolean advance(int current, int total);
}

Progress notifications are useful to notify users of IDEs and editors how is compilation going, and have a feeling of what are the slow phases (or even the slow compilation units) to compile. The best way to know that you have a slow project to compile is to expose this information to the users!

This ticket registers my intention of adding such an entrypoint in BSP, under the name of buildTarget/showCompileProgress. I haven’t yet figured out the right interface, but it would look similar to Zinc’s interface. We may even need to define two events to support every method, and then an event kind to the ShowCompileProgressParams.

This entrypoint would allow IntelliJ, for example, to mimic the same user experience than the built-in “Build Project” which shows compilation progress notifications in a small event window at the bottom right.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:14 (14 by maintainers)

github_iconTop GitHub Comments

2reactions
jasticecommented, Oct 25, 2018

For reference, the progress API in the IntelliJ build tool window looks like this:

public StartEventImpl(
    @NotNull Object eventId, 
    @Nullable Object parentId, 
    long eventTime, 
    @NotNull String message)

public ProgressBuildEventImpl(
    @NotNull Object eventId,
    @Nullable Object parentId,
    long eventTime,
    @NotNull String message,
    long total,
    long progress,
    @NotNull String unit) 

public FinishEventImpl(
    @NotNull Object eventId,
    @Nullable Object parentId,
    long eventTime,
    @NotNull String message,
    @NotNull EventResult result)
1reaction
jasticecommented, Oct 25, 2018

Yes that seems better. We can define standard data objects that will be sent for compile, test and other builtins, but allow the server to define their own.

In that vein, should we replace compileResult / testResult notifications with taskFinish notifications with result data object?

Read more comments on GitHub >

github_iconTop Results From Across the Web

`mvn compile jib:build` no further progress after log ... - GitHub
So, I added jib-maven-plugin and set docker image url. ... and check no further progress is being made after Container entrypoint set to...
Read more >
ERROR in Failed to compile entry-point mat-progress-buttons ...
It seems like there was some kind of error with the versions of the installed modules. I resolved it by deleting the node_module...
Read more >
Build Your Own Processing Container (Advanced Scenario)
This command runs the ENTRYPOINT command configured in your Docker image. You can also override the entrypoint command in the image or give...
Read more >
Developing inside a Container - Visual Studio Code
A progress notification provides status updates. You only have to build a dev container the first time you open it; opening the folder...
Read more >
Tutorial: Build and run a custom image in Azure App Service
Push a custom Docker image to Azure Container Registry · Deploy the custom image to App Service · Configure environment variables · Pull...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found