Skip to content

Tasty stdlib cannot be loaded by the doctool #10143

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

Closed
abgruszecki opened this issue Nov 2, 2020 · 11 comments · Fixed by #10154
Closed

Tasty stdlib cannot be loaded by the doctool #10143

abgruszecki opened this issue Nov 2, 2020 · 11 comments · Fixed by #10154

Comments

@abgruszecki
Copy link
Contributor

When we try to load .tasty files generated by the stdlib-bootstrapped project in the doctool, we get a Tasty parse (!) exception:

https://github.com/lampepfl/dotty/runs/1341421259?check_suite_focus=true#step:10:970

scala.MatchError: 137 (of class java.lang.Integer)
	at dotty.tools.dotc.core.tasty.TastyClassName$TreeSectionUnpickler.readNames$1(TastyClassName.scala:46)
	at dotty.tools.dotc.core.tasty.TastyClassName$TreeSectionUnpickler.unpickle(TastyClassName.scala:57)
	at dotty.tools.dotc.core.tasty.TastyClassName$TreeSectionUnpickler.unpickle(TastyClassName.scala:26)
	at dotty.tools.dotc.core.tasty.TastyUnpickler.unpickle$$anonfun$1(TastyUnpickler.scala:96)
	at scala.Option.map(Option.scala:242)
	at dotty.tools.dotc.core.tasty.TastyUnpickler.unpickle(TastyUnpickler.scala:96)
	at dotty.tools.dotc.core.tasty.TastyClassName.readName(TastyClassName.scala:22)
	at dotty.tools.dotc.fromtasty.TastyFileUtil$.getClassName(TastyFileUtil.scala:29)
	at dotty.tools.dotc.Driver.$anonfun$1(Driver.scala:104)
	at scala.collection.immutable.List.flatMap(List.scala:293)
	at dotty.tools.dotc.Driver.fromTastySetup(Driver.scala:108)
	at dotty.tools.dotc.Driver.setup(Driver.scala:81)
	at dotty.tools.dotc.Driver.process(Driver.scala:193)
	at dotty.tools.dotc.Driver.process(Driver.scala:163)
	at dotty.tools.dotc.Driver.process(Driver.scala:175)
	at scala.tasty.inspector.TastyInspector.inspectFiles(TastyInspector.scala:95)
…

/cc @nicolasstucki

@abgruszecki
Copy link
Contributor Author

See changes in the linked PR to find the task responsible for loading stdlib .tasty files.

@nicolasstucki nicolasstucki self-assigned this Nov 2, 2020
@nicolasstucki
Copy link
Contributor

Maybe you should depend on it the same way we do on the tests

https://github.com/lampepfl/dotty/blob/master/project/Build.scala#L882

@abgruszecki
Copy link
Contributor Author

I don't think that's likely to be the source of the problem. What we do is that we pass Scala3doc the directory with the result of compiling stdlib-bootstrapped, and then we effectively pass every .tasty file there to TastyInspector. The error happens even if all other projects in the task are commented out.

I think it'd help if we discussed this tomorrow.

@nicolasstucki
Copy link
Contributor

There is a failure when trying to get the name of the class of scala/package.tasty

@nicolasstucki
Copy link
Contributor

Can be reproduced with

scalac -from-tasty out/bootstrap/stdlib-bootstrapped/scala-3.0.0-M2/classes/scala/package.tasty

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 3, 2020
@abgruszecki
Copy link
Contributor Author

@nicolasstucki is this expected? I don't remember seeing this error when we tested from-tasty compilation. Is there a gap in how we test stdlib-bootstrapped?

I guess that we can circumvent this by manually handling scala/package, but I think it's important to know why exactly this wasn't caught by anything other than the doctool.

@nicolasstucki
Copy link
Contributor

@abgruszecki I have a fix for this issue in #10153, but some other things fail afterward. Could you have a look at the new issues?

In stdlib-bootstrapped we used the jar an input which does not hit this code path. I'm going to extend stdlib-bootstrapped to also tests when we pass each .tasty individually. I will probably add it on top of #10154.

@abgruszecki
Copy link
Contributor Author

@nicolasstucki what do you exactly mean when you say "things fail afterward"? The CI succeeds and I can't see any commented-out tests, so I guess you mean that running the documentation task still fails when one enables it?

nicolasstucki added a commit to dotty-staging/dotty that referenced this issue Nov 3, 2020
@nicolasstucki
Copy link
Contributor

Yes, running the documentation tests still fails if we uncomment
ea0deda#diff-539d15a8d5ba9a01a1724604b56cadf6851c57ec68dcf75a5073b6255d182de7R1498

@abgruszecki
Copy link
Contributor Author

@nicolasstucki alright, I hit a snag with trying to read flags of symbol of Function, which asplodes after saying "unsupported operation: complete". Do you expect this is because I tried to read .tasty files for Function? Do you have hints on what the actual problem is?

@nicolasstucki
Copy link
Contributor

Does not ring a bell

nicolasstucki added a commit that referenced this issue Nov 3, 2020
…irectly-from-jar

Fix #10143 and test stdlib from TASTy directly from Jar and TASTy files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants