Skip to content

Bloop server reports incorrect compile errors when client requests every target be compiled. #2779

@jackkoenig

Description

@jackkoenig

Given Project B depends on Project A. If my client sends compile requests in order, e.g.

  1. Compile A
  2. Wait for compile response
  3. Compile B

The compilation will fail [incorrectly] in a way that clearly shows something wrong with the classpath from A. The two failure modes I've seen are:

  • Null pointer exception in scalac looking at the classpath directories
  • Simple compile error that shows something is missing (e.g. foo is not a member of Bar where Bar comes from A and foo is definitely a val on the class)

Now this doesn't happen for most things, but does happen consistently in a very large codebase with lots of build units.

A similar issue I'm seeing that happens much more frequently is if we issue the compile requests out-of-order. I can't be sure it's the same issue but the errors manifest in similar ways so I assume this is just a quicker way to hit the same problem:

  1. Compile B
  2. Compile A

If I just compile B, it compiles both no problem, but sometimes (reproducibly in my code base but not on every pair of dependent projects) following up quickly with the request to compile A will cause the B compilation to fail with an error suggesting that A is missing from the classpath (or at least is partially missing).

Other potentially relevant information:

  • I use incrementing TaskIds for each request with no parent ids (I don't yet understand what the child-parent relationship is for)
  • I use different OriginIds for each request

I'm trying to debug to get more information and reproduce on a smaller, open-source code base. Will report back with anything I figure out.

Note that for each of these if I reissue the Compile B request after the initial failure, it will compile successfully. I think there's something going on with Bloop moving or deleting the classes of A while B is compiling.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions