sbt/sbt

clean does not seem to work with java projects

Aperta

#7187 aperta il 24 mar 2023

 (2 commenti) (0 reazioni) (0 assegnatari)Scala (1036 fork)batch import
area/incremental_compilerhelp wanted

Metriche repository

Star
 (4928 stelle)
Metriche merge PR
 (Merge medio 1g 15h) (66 PR mergiate in 30 g)

Descrizione

steps

  1. Make a minimal subproject in a multiproject build that has a few files of only java.
  2. compile the code: mysubproject/compile
  3. view that the class files are generated
  4. clean: mysubproject/clean
  5. verify that the classes are gone
  6. compile the code again and see that nothing happens.

problem

It seems that some in-memory state in sbt is failing to be synced with the disk state.

Workaround: exit sbt after the clean and restart and it works. Again this suggests it is memory state, not disk state that is incorrect.

expectation

javac should be invoked again on the sources.

notes

you can see an example of this in this repo: https://github.com/johnynek/bosatsu/pull/974

check it out at https://github.com/johnynek/bosatsu/pull/974/commits/c5a623de4a72ff6b9d29557afc46651d87f089e7 and try this set of steps:

  1. truffle/compile
  2. truffle/test (should pass)
  3. truffle/clean
  4. truffle/test (now it fails, and compile won't fix it. exit sbt and restart and it should work again).

Guida contributor