-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modified names for (class) is empty #292
Comments
Hey @stuhood, thanks for reporting. It seems that there are some Zinc invariants that are being violated. It's surprising that this change happened from last X6. Can you provide more information on this? Perhaps a way to reproduce? If you can reproduce, I can fix! 😄. |
@jvican : The last version that was widely deployed with pants was Will be on the lookout for a repro. |
I remember now that this invariant existed to check that the name hashing algorithm worked well. I guess Gregorz didn't consider the possibility that branches could be switched. The best thing would be to remove this assertion and make sure that it works correctly. Next version will have this change @stuhood. |
In #118 (which I'm closing in favour of this more commented issue) it would appear Martin fixed this in 0.13.11 with sbt/sbt#2441? Or maybe not. It's got 36 comments. Have a little look. |
There's a duplicate report sbt/sbt#3579 with a very minimised test case. |
I experienced the same problem in 1.0.2
I don't have minimised version yet |
and in 1.0.3
|
Can you provide more information how that happened? @marekzebrowski A way to reproduce would be greatly appreciated. |
Well, I just ran my build (multi-project, rather large). It works with 0.13.16, but fails with 1.0.[2,3]. |
Can you please run |
I had the same issue, it got fixed after running |
hmm, after removing all targets I can't reproduce it as well. |
Sorry, I didn't realise this issue still exists in 1.0.3, must be another (related) bug. |
Still an issue with 1.0.4
|
I Had the same issue here and the only solution was to clean up all target folders and recompile everything again: $ find . -regex ".*/target" -exec rm -r {} +
$ sbt compile |
I'll try to look at this again next week. |
Ran into this after overriding hashcode and equals method on a class. Removing target folders as described above allowed compilation. For intellij I also had to invalidate and restart the IDE to get the application to run |
|
It's not minimal, but I think I've got a version of it reproduced over here:
Running Maybe because I'm dealing with a ScalaTest subclass with no methods, here's how I clear out the error:
|
@dcecile sbt/sbt#3579 has a minimal reproduction :) |
Also seeing these with 1.1.0-RC4 when moving methods around Simpler reproducer below trait T2{
}
trait T1 extends T2{
def foo: String
}
class C1 extends T1{
def foo = "test"
}
now move
|
I'm experiencing this issue too, but only when I try to compile from IntelliJ IDEA. From the command line, everything works fine. |
Just encountered the same issue, and like the example from @francisdb moved a method from a trait down to the concrete implementation. Possibly the change detection isn't accounting for exactly which class / trait a method is defined on? So after a move, the complete set of method names and signatures is identical, but the declaration sites have changed. |
This assertion dates from the time where the whole Zinc 1.x was under development. As I understand it, it was put in place to make sure that the names invalidation was correct. However, the assertion itself is not correct. It violates some legit scenarios that are valid, where there are changes in APIs but there are no changes in the names. One of these examples is the following one, provided by @francisdb, where the original code is: ``` trait T2 trait T1 extends T2 { def foo: String } class C1 extends T1 { def foo = "test" } ``` And moving `foo` from `T1` to `T2` causes the assertion to fail. In this concrete scenario, we can see how the API has changed (the hashes are not the same than the previous scenario) but the names are identical. There are more examples, some of them I have occassionally run into. Therefore, this commit should fix sbt#292 once and for all, and end the pain of those who have kindly complained about it in the ticket. :)
PR is up #484. Thank you for your patience. |
This assertion dates from the time where the whole Zinc 1.x was under development. As I understand it, it was put in place to make sure that the names invalidation was correct. However, the assertion itself is not correct. It violates some legit scenarios that are valid, where there are changes in APIs but there are no changes in the names. One of these examples is the following one, provided by @francisdb, where the original code is: ``` trait T2 trait T1 extends T2 { def foo: String } class C1 extends T1 { def foo = "test" } ``` And moving `foo` from `T1` to `T2` causes the assertion to fail. In this concrete scenario, we can see how the API has changed (the hashes are not the same than the previous scenario) but the names are identical. There are more examples, some of them I have occassionally run into. Therefore, this commit should fix sbt#292 once and for all, and end the pain of those who have kindly complained about it in the ticket. :)
This assertion dates from the time where the whole Zinc 1.x was under development. As I understand it, it was put in place to make sure that the names invalidation was correct. However, the assertion itself is not correct. It violates some legit scenarios that are valid, where there are changes in APIs but there are no changes in the names. One of these examples is the following one, provided by @francisdb, where the original code is: ``` trait T2 trait T1 extends T2 { def foo: String } class C1 extends T1 { def foo = "test" } ``` And moving `foo` from `T1` to `T2` causes the assertion to fail. In this concrete scenario, we can see how the API has changed (the hashes are not the same than the previous scenario) but the names are identical. There are more examples, some of them I have occassionally run into. Therefore, this commit should fix sbt#292 once and for all, and end the pain of those who have kindly complained about it in the ticket. :)
Fixed in #484. |
I'm on I'm able to compile the code and build fat-JAR ( |
Okay so it turns out that the culprit is conflict(s) between one of the following (still not sure who the real culprit is)
In short, it's a mess right now and the word ' |
Please try sbt 1.1.1. |
Sorry for all the chaos; turns out that the issue was completely unrelated with this thread or even While the problem that I described above (identifier Rather strangely, my fault was that I had accidently invoked an Please correct me if I'm wrong. |
@y2k-shubham Feel free to open a new ticket describing the reproduction steps and the error message you see. |
Pants
1.3.0.dev16
is using zinc1.0.0-X7
, and users have reported the following exception:...while recompiling after switching branches. The affected class was changed in the branch, it's possible others were as well.
The text was updated successfully, but these errors were encountered: