Skip to end of metadata
Go to start of metadata

Problem

Clojure today exists at a balance point between performance and dynamic flexibility. Some users would be willing to sacrifice dynamic features to gain more performance. Other users would be willing to sacrifice performance to gain better development error messages or debugging. The problem we aim to solve is to alter the Clojure build such that we can produce alternate versions of Clojure that are useful to smaller audiences while retaining Clojure as it is today.

Constraints 

Clojure users:

  • Build profile artifacts should be available in public Maven repositories for use with existing build systems (Leiningen, Maven)
    • Different artifacts:  [org.clojure/clojure-foo "1.6.0"]
    • Different qualifiers: [org.clojure/clojure "1.6.0-foo"]
  • Some features may require further compiler flags or metadata to activate

Build:

  • Different build profiles will create different classes that need to be packaged in different jars
  • Creating a custom build profile will require specifying compiler flags or environment variables to alter behavior and compilation
Integration / release infrastructure:
  • Hudson CI server must be able to build and test custom profiles as part of the dependency matrix
  • Hudson CI server must be able to perform releases for custom profiles

Compiler:

  • The compiler will need a standard way to determine which profile is active to make decisions during compilation.

Solution Alternatives

Maven build profiles

  • Build profiles allow setting custom environments at compile time
  • Need to investigate whether it is possible to produce different artifact and/or qualifier jars from a single build. Qualifiers are used similarly for things like javadoc and source jars.
    • The jar without a qualifier is "newer" than the jars with a qualifier for Maven sorting purposes. After that, they are reverse sorted lexically (1.2-c > 1.2-b > 1.2-a).
    • Because -SNAPSHOT is also a (special) qualifier, it is unclear whether we could release custom build profiles in snapshot form if both are used as qualifiers.

Maven custom assembly

  • The Maven assembly plugin allows for arbitrary customization of the artifacts created by the build. However, creating multiple artifacts with different Maven coordinates will likely require multiple builds to produce each artifact for deployment. 

Custom script (ant, make, etc)

 

 

Labels:
  1. Apr 09, 2013

    Build profiles for stripped down builds, and dev builds sound great; but a batteries included repl environment with bundled contrib libs, sounds like something that Leiningen could do.

    Bundling could be achieved with by creating a Maven or Leiningen artefact that just lists all approved contrib libs as dependencies, or by creating a Leiningen new project template, that creates a project listing all of the approved dependencies in the project.clj.