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.

Distinguish between compile-time and runtime classpaths

See original GitHub issue

Currently, Bloop doesn’t make any distinction between compilation-time and runtime classpaths. This situation brings several problems for projects that expect to have different runtime and compile-time classpath:

  • Some code may compile in Bloop, but not in the tool that generated the config (for instance, my code references a symbol that appears only on my runtime classpath)
  • Some code may compile in the tool that generated the config, but not in Bloop (for instance, a name became ambiguous because of 2 wildcard imports)
  • We cannot faithfully represent builds that use Gradle’s api vs implementation, sbt’s Provided or Pants’ strict_deps for instance.

The Bloop configuration file should include different fields for these different classpaths. Finally, Bloop should use the right classpath to perform the right action.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (10 by maintainers)

github_iconTop GitHub Comments

2reactions
jvicancommented, Apr 8, 2020

Even if we compress the files, the duplicate runtime/classpath fields result in higher memory usage.

Not if we intern them. In fact, we don’t need to intern them manually, Paths.get interns them right when they are created at parsing time.

Do we have an agreement to add a “runtimeClasspath” field to the JVM platform section?

Yes, but let’s call it classpath.

1reaction
jvicancommented, Apr 7, 2020

Would it make sense to move runtimeClasspath into the JVM “platform” field? It’s not possible to encode runtime classpaths for JS/Native projects. We may also want to rename the field into something like runtimeExtraClasspath to stress that these are additional classpath entries that are added on top of the classpath field.

I like the fact that you scope it to the JVM platform. It eases some of my concerns with this approach and I could make my peace with a classpath field added under runtime JVM platform. This would mean we would add a resources field there too.

But note that you cannot encode it as extraClasspath because the runtime and compile classpath can be disjoint sets of URIs. You can add new URIs to the compile classpath as well as you can remove them or even change the order of the URIs. So if you want to encode the extra classpath to avoid repeating some of the URI entries in the compile classpath and save space, we need a way for you to express that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Runtime Classpath vs Compile-Time Classpath
compile-time classpath. Contains the classes that you've added in your IDE (assuming you use an IDE) in order to compile your code. ·...
Read more >
Compile time vs Run time Dependency - Java - Stack Overflow
Compiletime dependencies are only the dependencies (other classes ) which you use directly in the class you're compiling.
Read more >
How is CompileTime classpath different from RunTime ...
What is a Classpath? Classpath refers to the Path where all the classes/jars are available. What is Compile-time classpath? This classpath has ...
Read more >
Runtime Classpath vs Compile-Time Classpath - DZone
compile-time classpath. Contains the classes that you've added in your IDE (assuming you use an IDE) in order to compile your code. ·...
Read more >
Runtime vs. Compile Time | Baeldung on Computer Science
Compile time is the period when the programming code (such as C#, Java, C, Python) is converted to the machine code (i.e. binary...
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