Github user JoshRosen commented on the pull request:

    https://github.com/apache/spark/pull/10071#issuecomment-161092480
  
    Actually, we might be able to get away with completely removing our 
dependency on the Scala compiler. It looks like the usage which broke the build 
is only used in some debugging code which is no longer used anywhere:
    
    ```scala
      /**
       * Dumps the bytecode from a class to the screen using javap.
       */
      object DumpByteCode {
        import scala.sys.process._
        val dumpDirectory = Utils.createTempDir()
        dumpDirectory.mkdir()
    
        def apply(obj: Any): Unit = {
          val generatedClass = obj.getClass
          val classLoader =
            generatedClass
              .getClassLoader
              .asInstanceOf[scala.tools.nsc.interpreter.AbstractFileClassLoader]
          val generatedBytes = classLoader.classBytes(generatedClass.getName)
    
          val packageDir = new java.io.File(dumpDirectory, 
generatedClass.getPackage.getName)
          if (!packageDir.exists()) { packageDir.mkdir() }
    
          val classFile =
            new java.io.File(packageDir, 
generatedClass.getName.split("\\.").last + ".class")
    
          val outfile = new java.io.FileOutputStream(classFile)
          outfile.write(generatedBytes)
          outfile.close()
    
          // scalastyle:off println
          println(
            s"javap -p -v -classpath ${dumpDirectory.getCanonicalPath} 
${generatedClass.getName}".!!)
          // scalastyle:on println
        }
      }
    ```
    
    As far as I know, that code may no longer even work in light of the recent 
Janino changes. Given this, my preference would be to simply remove that 
`DumpByteCode` class for now, then remove the `scala-compiler` dependency. 
@marmbrus @davies, any objections to this? Are you using that class?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to