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

Publish error: Error while reading InlineInfoAttribute from scala.meta.transversers.Transformer #3338

Open
hugo-vrijswijk opened this issue Sep 11, 2023 · 12 comments

Comments

@hugo-vrijswijk
Copy link
Contributor

hugo-vrijswijk commented Sep 11, 2023

Hi, I've been having an error while publishing a 2.12/2.13 project with Scalameta >=4.8.3:

[info] Main Scala API documentation to /home/runner/work/stryker4s/stryker4s/core/target/jvm-2.12/api...
model contains 220 documentable templates
[error] Error while reading InlineInfoAttribute from scala.meta.transversers.Transformer
[error] Index 1002 out of bounds for length 1002
[error] Error while reading InlineInfoAttribute from scala.meta.Term$ArgClause$
[error] Index 157 out of bounds for length 157
[error] Error while reading InlineInfoAttribute from scala.meta.internal.trees.package$
[error] Index 150 out of bounds for length 150
[error] Error while reading InlineInfoAttribute from scala.meta.Defn$Val$
[error] Index 246 out of bounds for length 246
[error] Error while reading InlineInfoAttribute from scala.meta.Init$
[error] Index 175 out of bounds for length 175
[error] 5 errors found

The failing build is here:
https://github.com/stryker-mutator/stryker4s/actions/runs/5514939543/job/14930905758

With the full log:
https://gist.github.com/hugo-vrijswijk/add7af87f6c70056cd1c53bc2f324495

The build right before it was successful:
https://github.com/stryker-mutator/stryker4s/actions/runs/5514929961

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 11, 2023

Thanks for reporting! I am not sure why InlineInfoAttribute would be needed during the publishing the documentation 🤔 We don't have any such class and it seems very much a compiler internal thing. Those are macro generated classes, which may be an issue, but we haven't changed anything in 4.8.4 version, so I am not sure how would it pop up there 🤔

Scalafmt seems to publish alright we the newest versions.

@hugo-vrijswijk
Copy link
Contributor Author

Oops, I meant >=4.8.3, not >. Could there be anything in that release which broke things?

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 13, 2023

We did add automatic shading for fastparse and geny modules, but no idea how that would influence anything 🤔

Will need to take a closer look when I have some time.

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 18, 2023

This seems to be a warning in the Scala compiler though, so not sure why it's being shown as error for you or why those particular classes 🤔

https://github.com/scala/scala/blob/0d0d2195d7ea31f44d979748465434283c939e3b/src/compiler/scala/tools/nsc/backend/jvm/opt/ByteCodeRepository.scala#L323

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 18, 2023

Any chance that it's fatal warnings issue? Is it possible to turn it off for scaladoc?

Something like:

Compile / doc / scalacOptions := {
    val old = (Compile / doc / scalacOptions).value
      old.filterNot(_ == "-Xfatal-warnings")
  }

?

@hugo-vrijswijk
Copy link
Contributor Author

I don't think it is docs-related. I tried debugging it myself a bit more, and it is related to release mode method-local optimisation. The error doesn't occur when running doc, but does for publishLocal with the release options enabled.

I'm guessing it tries to inline some macros or something, which then breaks? I don't think there's much harm in disabling the 'release mode' for me. That at least unblocks releases for me. I'm not sure if this issue should stay open, though I guess the bug is still there (but maybe not in Scalameta)

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 19, 2023

I think there is something shady in the sbt-shading plugin, which is something a bit too complicated for me to try to dig into.

Also, that seems to be a warning only in the compiler, why would it show as error?

@hugo-vrijswijk
Copy link
Contributor Author

I do have fatal-warnings turned on. But I'd prefer not to disable it for releases

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 19, 2023

Sure, but could we disable it for doc only?

@hugo-vrijswijk
Copy link
Contributor Author

hugo-vrijswijk commented Sep 19, 2023

doc runs fine, it's publish/publishLocal where it fails (or package to be precise)

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 19, 2023

Looks like it's something we should fix in coursier/sbt-shading or https://github.com/eed3si9n/jarjar-abrams 🤔 I don't see how exactly to fix it currently :/

@tgodzik
Copy link
Collaborator

tgodzik commented Sep 19, 2023

Though those classes do not touch any kind of shading, it's super wierd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants