Skip to content
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

assertion failed: When nameHashing is disabled names relation should be empty: $names #1071

Closed
OlegYch opened this issue Jan 10, 2014 · 9 comments
Assignees
Labels
Milestone

Comments

@OlegYch
Copy link
Contributor

OlegYch commented Jan 10, 2014

using 0.13.2-M1 with incOptions := incOptions.value.withNameHashing(true)
i get the error on incremental compilation
last doesn't show stacktrace for some reason

@ghost ghost assigned gkossakowski Jan 10, 2014
@gkossakowski
Copy link
Contributor

What about last compile?

Also, I assume you did run clean after turning on name hashing, right?

@OlegYch
Copy link
Contributor Author

OlegYch commented Jan 10, 2014

same for 'last compile' and 'last tehproject/compile:compile' , yes i did clean all projects
the tehproject contains one single source file (which was not modified in any way) and doesn't depend on any other subprojects btw

@gkossakowski
Copy link
Contributor

It's really strange. Can you share this project or reproduce it in a sample project so I can have a look into it?

@OlegYch
Copy link
Contributor Author

OlegYch commented Jan 10, 2014

i'll try to minimize it but it was too weird and spurious, so can't promise anything

@gkossakowski
Copy link
Contributor

Thanks a lot! Is your project a Play project or just a plain sbt project?

Also, it's really strange if this problem is not deterministic. The whole incremental compiler is deterministic.

@gkossakowski
Copy link
Contributor

Hi @OlegYch! Did you have a chance to minimize a sample reproducing this problem?

@OlegYch
Copy link
Contributor Author

OlegYch commented Jan 30, 2014

sorry, i haven't managed to minimize it yet
will try again over the weekend
that's not a play project btw

@OlegYch
Copy link
Contributor Author

OlegYch commented Feb 7, 2014

dunno, really
when i start minimizing it goes away and doesn't come back even if you do clean
but it randomly comes back later
even when i do clean checkout and compile it reappears
i'm not using macros or anything like that..

@gkossakowski
Copy link
Contributor

Actually, I finally reproduced it deterministically. The way to reproduce is very simple. Create a project with just one source file:

// Foo.scala
class Foo

then:

  1. Enable nameHashing
  2. Run compile
  3. Restart sbt (this is important)
  4. Run compile again

It will crash with the error from this ticket. You could observe that (non-deterministically) without restarting sbt if GC happened to clean hacky Analysis cache we have. See #1081 for details.

@gkossakowski gkossakowski added this to the 0.13.2 milestone Feb 17, 2014
gkossakowski added a commit to gkossakowski/sbt that referenced this issue Feb 17, 2014
The CompileSetup class is being used to detect changes to arguments of
incremental compiler that affect result of compilation and trigger
recompilation. Examples of such arguments include, the target (output)
directory, Scala compiler options, Scala compiler version, etc.

By adding `nameHashing` to CompileSetup we have a chance to handle change
to that flag smoothly by throwing away old Analysis object and starting
with an empty one. That's implemented in AggressiveComile by extending
the logic that was responsible for detection of changes to CompileSetup
values. Thanks to this change we fix sbt#1081.

Analysis formats has been updated to support persisting of newly added
value in CompileSetup. We used to not store the value of `nameHashing`
flag in persisted Analysis file and infer it from contents of relations
but that leads to issue sbt#1071 when empty relations are involved. Given
the fact that CompileSetup stores `nameHashing` value now, we can just
use it when reading relations and fix sbt#1071. This requires reading/writing
compile setup before reading relations. I decided to make that change even
if there's a comment saying that reading/writing relations first was done
intentionally.
eed3si9n pushed a commit to eed3si9n/sbt that referenced this issue Mar 21, 2014
The CompileSetup class is being used to detect changes to arguments of
incremental compiler that affect result of compilation and trigger
recompilation. Examples of such arguments include, the target (output)
directory, Scala compiler options, Scala compiler version, etc.

By adding `nameHashing` to CompileSetup we have a chance to handle change
to that flag smoothly by throwing away old Analysis object and starting
with an empty one. That's implemented in AggressiveComile by extending
the logic that was responsible for detection of changes to CompileSetup
values. Thanks to this change we fix sbt#1081.

Analysis formats has been updated to support persisting of newly added
value in CompileSetup. We used to not store the value of `nameHashing`
flag in persisted Analysis file and infer it from contents of relations
but that leads to issue sbt#1071 when empty relations are involved. Given
the fact that CompileSetup stores `nameHashing` value now, we can just
use it when reading relations and fix sbt#1071. This requires reading/writing
compile setup before reading relations. I decided to make that change even
if there's a comment saying that reading/writing relations first was done
intentionally.
gkossakowski added a commit to gkossakowski/sbt that referenced this issue Sep 23, 2014
The CompileSetup class is being used to detect changes to arguments of
incremental compiler that affect result of compilation and trigger
recompilation. Examples of such arguments include, the target (output)
directory, Scala compiler options, Scala compiler version, etc.

By adding `nameHashing` to CompileSetup we have a chance to handle change
to that flag smoothly by throwing away old Analysis object and starting
with an empty one. That's implemented in AggressiveComile by extending
the logic that was responsible for detection of changes to CompileSetup
values. Thanks to this change we fix sbt#1081.

Analysis formats has been updated to support persisting of newly added
value in CompileSetup. We used to not store the value of `nameHashing`
flag in persisted Analysis file and infer it from contents of relations
but that leads to issue sbt#1071 when empty relations are involved. Given
the fact that CompileSetup stores `nameHashing` value now, we can just
use it when reading relations and fix sbt#1071. This requires reading/writing
compile setup before reading relations. I decided to make that change even
if there's a comment saying that reading/writing relations first was done
intentionally.
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants