Skip to content

Instantly share code, notes, and snippets.

Avatar

Jorge jvican

View GitHub Profile
View spurious-macro-error-jsoniter.md

Here's an error that I got spuriously but rerunning the compilation made it go away.

[E] [E1] config/src/main/scala-2.11-13/bloop/config/ConfigCodecs.scala:119:42
[E]      Cannot evaluate a parameter of the 'make' macro call for type 'bloop.config.Config.JvmConfig'. It should not depend on code from the same compilation module where the 'make' macro is called. Use a separated submodule of the project to compile all such dependencies before their usage for generation of codecs. Cause:
[E]      java.lang.AssertionError: assertion failed: pkgClass = package <root>, sym = package com, existing = package com (depth=0)
[E]      L119:     JsonCodecMaker.make[Config.JvmConfig](CodecMakerConfig.withTransientEmpty(false))
[E]                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[E] config/src/main/scala-2.11-13/bloop/config/ConfigCodecs.scala: L119 [E1]
@jvican
jvican / metals1.log
Created Oct 24, 2019
jstack traces for three Metals processes, out of which two are zombie and one is healthy
View metals1.log
2019-10-24 21:58:09
Full thread dump OpenJDK 64-Bit GraalVM CE 19.2.0 (25.222-b08-jvmci-19.2-b02 mixed mode):
"Attach Listener" #450 daemon prio=9 os_prio=0 tid=0x00007f5a1c001000 nid=0x29dee waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"DestroyJavaVM" #449 prio=5 os_prio=0 tid=0x00007f5a8c010800 nid=0x4b72 waiting on condition [0x0000000000000000]
java.lang.Thread.State: RUNNABLE
"Scala Presentation Compiler []" #434 daemon prio=5 os_prio=0 tid=0x00007f599409b800 nid=0x19419 in Object.wait() [0x00007f58f8bf1000]
@jvican
jvican / RuntimeUtils.scala
Last active Nov 22, 2019
Some Scala code that uses Java APIs present in tools.jar (only JDKs) to programmatically produce a jstack-like thread dump. Useful to debug application and test deadlocks.
View RuntimeUtils.scala
object RuntimeUtils {
def requestThreadDump: String = {
// Get the PID of the current JVM process
val selfName = java.lang.management.ManagementFactory.getRuntimeMXBean().getName()
val selfPid = selfName.substring(0, selfName.indexOf('@'))
// Attach to the VM
import com.sun.tools.attach.VirtualMachine
import sun.tools.attach.HotSpotVirtualMachine;
val vm = VirtualMachine.attach(selfPid);
View herringbone-impala.json
{
"version" : "1.1.2",
"project" : {
"name" : "herringbone-impala",
"directory" : "/home/jvican/Code/herringbone/herringbone-impala",
"workspaceDir" : "/home/jvican/Code/herringbone",
"sources" : [
"/home/jvican/Code/herringbone/herringbone-impala/src/main/scala"
],
"dependencies" : [
@jvican
jvican / gist:0f4778e809331ecf15a53b4bb8f381b5
Created Sep 25, 2019
coursier-graalvm-native-error.txt
View gist:0f4778e809331ecf15a53b4bb8f381b5
➜ bloop git:(topic/bloopgun) ✗ coursier fetch org.scalameta:sbt-mdoc_2.12:1.3.2 --sbt-plugin --sbt-version 1.0
Exception in thread "main" scala.MatchError: [Ljava.lang.String;@7fa34bbb3580 (of class [Ljava.lang.String;)
at coursier.parse.DependencyParser$.javaOrScalaDependencyParams(DependencyParser.scala:176)
at coursier.parse.DependencyParser$.$anonfun$javaOrScalaDependenciesParams$1(DependencyParser.scala:351)
at coursier.util.Traverse$TraverseOps.$anonfun$validationNelTraverse$1(Traverse.scala:33)
at scala.collection.LinearSeqOptimized.foldLeft(LinearSeqOptimized.scala:126)
at scala.collection.LinearSeqOptimized.foldLeft$(LinearSeqOptimized.scala:122)
at scala.collection.immutable.List.foldLeft(List.scala:89)
at coursier.util.Traverse$TraverseOps.validationNelTraverse(Traverse.scala:26)
at coursier.parse.DependencyParser$.javaOrScalaDependenciesParams(DependencyParser.scala:350)
View bloopgun.sbt
lazy val bloopgunNative: Project = project
.dependsOn(bloopgun)
.disablePlugins(ScriptedPlugin)
.enablePlugins(SbtProguard)
.enablePlugins(GraalVMNativeImagePlugin)
.settings(testSuiteSettings)
.settings(
name := "bloopgun-native",
proguardOptions in Proguard ++=
Seq("-dontnote", "-dontwarn", "-ignorewarnings", "-dontoptimize"),
View exception-bloop
[E] java.nio.file.FileSystemException: /var/folders/8z/cdtg5zv95t92h32y30_pdh5c0000gn/T/bloop-test-workspace1019801879423377160/target/A/bloop-bsp-clients-classes: Invalid argument
[E] at sun.nio.fs.UnixException.translateToIOException(UnixException.java:91)
[E] at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
[E] at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
[E] at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:384)
[E] at java.nio.file.Files.createDirectory(Files.java:674)
[E] at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781)
[E] at java.nio.file.Files.createDirectories(Files.java:767)
[E] at bloop.data.ClientInfo$BspClientInfo.$anonfun$getUniqueClassesDirFor$1(ClientInfo.scala:144)
[E] at bloop.data.ClientInfo$BspClientInfo.$anonfun$getUniqueClassesDirFor$1$adapted(ClientInfo.scala:132)
View frontend-test.json
{
"version" : "1.1.2",
"project" : {
"name" : "frontend-test",
"directory" : "/home/jvican/Code/bloop/frontend",
"sources" : [
"/home/jvican/Code/bloop/frontend/src/test/scala-2.12",
"/home/jvican/Code/bloop/frontend/src/test/scala",
"/home/jvican/Code/bloop/frontend/src/test/java",
"/home/jvican/Code/bloop/frontend/target/scala-2.12/src_managed/test"
@jvican
jvican / Cli.scala
Created Jun 26, 2019
Nailgun CLI implementation **prototype** via Caseapp for Sailgun (Scala based client)
View Cli.scala
package sailgun.caseapp
import _root_.caseapp.core.Parser
import _root_.caseapp.core.Messages
import _root_.caseapp.core.WithHelp
import java.io.PrintStream
import java.io.InputStream
import sailgun.protocol.Defaults
import sailgun.protocol.Streams
@jvican
jvican / frontend.json
Created Jun 15, 2019
An example of a real-world config file for one of the main bloop modules
View frontend.json
{
"version" : "1.1.2",
"project" : {
"name" : "frontend",
"directory" : "/Users/jvican/Code/bloop/frontend",
"sources" : [
"/Users/jvican/Code/bloop/frontend/src/main/scala-2.12",
"/Users/jvican/Code/bloop/frontend/src/main/scala",
"/Users/jvican/Code/bloop/frontend/src/main/java",
"/Users/jvican/Code/bloop/frontend/target/scala-2.12/src_managed/main"
You can’t perform that action at this time.