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

Update metabrowse to 0.2.8 #886

Merged
merged 5 commits into from
Aug 18, 2022

Conversation

kiendang
Copy link
Collaborator

@kiendang kiendang commented Oct 13, 2021

Attempt to update metabrowse to 0.2.6

Close #764

steps to run

./mill -i all "__.publishLocal"

SCALA_VERSION="2.13.6" ALMOND_VERSION="0.11.2-47-434d403c-SNAPSHOT"

coursier bootstrap \
  sh.almond:scala-kernel_$SCALA_VERSION:$ALMOND_VERSION \
  -M almond.ScalaKernel --embed-files=false \
  -r central -r ivy2local -r jitpack \
  --default=true --sources -o almond -f

./almond --install \
  --id almond-snapshot_$SCALA_VERSION --display-name "Scala $SCALA_VERSION (snapshot)" \
  --force \
  --log debug \
  --log-to "$HOME/log.txt" \
  --metabrowse yes

might need to tee the log to another file, e.g tail -f "$HOME/log.txt" > "$HOME/log-retain.txt" because when almond crashes the log got deleted.

Currently kind of works for Scala 2.12 but still runs into this issue similar to #246 (comment). Did you solve this earlier @alexarchambault?

Exception in thread "main" java.lang.AssertionError: assertion failed:
  Race condition detected: You are running a presentation compiler method outside the PC thread.[phase: <no phase>] Please file a ticket with the current stack trace at https://w
ww.assembla.com/spaces/scala-ide/support/tickets
     while compiling: Current.sc
        during phase: globalPhase=<no phase>, enteringPhase=parser
     library version: version 2.12.15
    compiler version: version 2.12.15
  reconstructed args: -nowarn -Xmaxwarns 0 -Yresolve-term-conflict:object -Ymacro-expand:discard

  last tree to typer: Literal(Constant(()))
       tree position: line 5 of Current.sc
            tree tpe: Unit
              symbol: null
           call site: <none> in <none>

== Source file context for tree position ==

     2   x
     3 }
     4
     5 object InspectWrapper{
     6 val x = 2
     7 }
     8
        at scala.reflect.internal.SymbolTable.throwAssertionError(SymbolTable.scala:185)
        at scala.tools.nsc.interactive.Global.assertCorrectThread(Global.scala:533)
        at scala.reflect.internal.Symbols$Symbol.transformInfos(Symbols.scala:1653)
        at scala.reflect.internal.Symbols$Symbol.rawInfo(Symbols.scala:1642)

Doesn't work for Scala 2.13

Exception in thread "main" jar:file:///home/kien/.cache/coursier/v1/https/repo1.maven.org/maven2/com/lihaoyi/pprint_3/0.6.6/pprint_3-0.6.6-sources.jar!/TPrintImpl.scala:15: error
: unclosed character literal
      '{ $expr + $other }
      ^
        at scala.meta.internal.tokenizers.Reporter.syntaxError(Reporter.scala:23)
        at scala.meta.internal.tokenizers.Reporter.syntaxError$(Reporter.scala:23)
        at scala.meta.internal.tokenizers.Reporter$$anon$1.syntaxError(Reporter.scala:33)

Looks like some of the Scala 3 source jars got included. Checked the log and those are fansi, pprint, sourcecode and scala3-library.

TODO

  • include metabrowse for all Scala versions, without the need for scala-has-metabrowse/scala-has-metabrowse and manually specifying.
  • add --metabrowse-port cli option to manually specify a port for metabrowse

@alexarchambault
Copy link
Member

Thanks for opening this @kiendang. To address the issue you're seeing, it should now be possible to depend on metabrowse via "full cross version scala suffix", like org.scalameta:::metabrowse-server:0.2.6. This should workaround the Scala version mismatch issues.

We should also be able to get rid of the metabrowse available or not code. Thanks to this full cross scala version, metabrowse should work with all scala versions now.

@alexarchambault
Copy link
Member

I should be able to have a closer look at this if needed in the coming days.

@alexarchambault alexarchambault changed the title Update metabrowse to 0.2.6 Update metabrowse to 0.2.8 Aug 18, 2022
@alexarchambault
Copy link
Member

Merging this, thanks again @kiendang!

@alexarchambault alexarchambault merged commit 7ec9507 into almond-sh:main Aug 18, 2022
@kiendang
Copy link
Collaborator Author

I still consistently ran into the "You are running a presentation compiler method outside the PC thread" error though. Probably the problem is with metabrowse coz I don't remember getting that bug in #779 where I took out metabrowse and implemented inspection with mtags directly.

@kiendang kiendang deleted the update-metabrowse-0.2.6 branch August 24, 2022 14:48
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

Successfully merging this pull request may close these issues.

Error starting metabrowse server
3 participants