Giter Club home page Giter Club logo

Comments (15)

cessationoftime avatar cessationoftime commented on June 14, 2024

the compiler interface is cached at:

~/.ivy2/cache/org.scala-sbt/org.scala-sbt-compiler-interface-0.13.12-bin_2.10.6__52.0/

to cause it to be rebuilt

rm ~/.ivy2/cache/org.scala-sbt/org.scala-sbt-compiler-interface-0.13.12-bin_2.10.6__52.0 -r
rm ~/.sbt -r
rm target -r

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

The compiler interface is compiled by Zinc. The "not yet compiled" message originates here:
https://github.com/sbt/zinc/blob/f87221c25d8c543dad47fd029e44bba93bf6a5fb/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/AnalyzingCompiler.scala#L149

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

Example of how to compile the Compiler Interface Jar:
Base class for test suites that must be able to fetch and compile the compiler bridge.

https://github.com/sbt/zinc/blob/de1b60801ec831caafce93e77dedf58964997869/internal/zinc-ivy-integration/src/test/scala/sbt/internal/inc/BridgeProviderSpecification.scala

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

The Sbtix global plugin should supply a command that allows one to build the compiler bridge against a given project. Maybe 'sbtix-gen-bridge'.

from sbtix.

nightkr avatar nightkr commented on June 14, 2024

Hm. Couldn't we make this a separate derivation instead of doing this outside of Nix?

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

I think we'd need three components.

  • An sbtix command to gather the inputs. Mainly the ScalaVersion that the bridge is targeting, the scalaCompilerBridgeSource and maybe some information from bootIvyConfiguration. A separate command initially, but eventually part of sbtix-gen after the repo.nix files get merged and some of the other commands are discarded.
  • A tool, maybe as a separate sbt project from the Sbtix plugin that compiles the jar for the compiler-bridge using the gathered inputs.
  • A derivation that given the gathered inputs will use the tool to build the compiler bridge. The output jar from this derivation can then be an input to the user's sbt project, and should only need to be built the first time nix-build is executed.

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

sbt seems to be interfacing with Zinc to create the compiler bridge here:
https://github.com/sbt/sbt/blob/57a655478f2fdf1de3e90acf2755b50c0459fd50/main-actions/src/main/scala/sbt/Compiler.scala#L128

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

this project seems to be attempting something similar, though it is a year old: https://github.com/Duhemm/compiler-bridge

Though I don't think I like its approach of gutting SBT to do this.

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

running inspect compile and following it's dependencies lead me to compile:compileIncremental and compile:compile::compileInputs.

compile:compileIncremental - builds the compiler bridge without building the project.

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

(compileInputs in compile).value and scalaCompilerBridgeSource.value may provide additional dependencies currently provided by the manual-repo

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

scalaCompilerBridgeSource.value (sbt version), java version, and scala version are the inputs that determine the compiler-bridge jar.

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

compiler-interface is used in SBT 0.13 and 1.0

compiler-bridge is only used in sbt 1.0

I had been getting the two confused. Much of my information applies to sbt 1.0 and not sbt 0.13.

In sbt 0.13 scalaCompilerBridgeSource.value gives the compiler-interface module, while in 1.0 it gives the compiler-bridge module

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

sbt 0.13 compiles the compiler-interface here:
https://github.com/typesafehub/zinc/blob/2fc849c7fdf36341f0a9ede02e6827d82fa71282/src/main/scala/com/typesafe/zinc/Compiler.scala#L148

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

In sbt 0.13 the ComponentCompiler that compiles the interface is here: https://github.com/sbt/sbt/blob/v0.13.12/compile/ivy/src/main/scala/sbt/compiler/ComponentCompiler.scala#L29

from sbtix.

cessationoftime avatar cessationoftime commented on June 14, 2024

Use this repo for searching sbt 0.13: https://github.com/sbt/sbt-zero-thirteen

from sbtix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.