-
Notifications
You must be signed in to change notification settings - Fork 4
Update & Deployment
This procedure describes how to update Arcadia's compiler or Clojure core source tree without introducing regressions. The compiler implementation and Clojure core source tree on the unity
branch of this repository are the canonical ones, and the files that end up in Arcadia itself should be perceived as derived artifacts. Changes to the Clojure source tree in the Arcadia repository are ephemeral and will not survive a compiler update.
You will need the msbuild
and make
commands. msbuild
is installed with Mono, and make
is installed with your platform's standard compiler tools.
To get started, clone the arcadia/clojure-clr
repository locally and check out the unity
branch.
$ git clone https://github.com/arcadia-unity/clojure-clr.git
$ cd clojure-clr
$ git checkout unity
After making changes to the C# implementation of the compiler or the Clojure source, you will have to rebuild the compiler. The ClojureCLR compiler is a network of interrelated C# projects that do not build correctly for Unity by default, so trying to build from e.g. your IDE will not work. The unity
branch of our fork maintains a Makefile as a replacement.
You will need internet access the clojure.spec
submodules. They are pulled from the master
branches of arcadia-unity/clr.spec.alpha and arcadia-unity/clr.core.specs.alpha. The Makefile handles this automatically and no additional action is required.
The default target of the Makefile will build the whole compiler
$ make
Microsoft (R) Build Engine version 15.1.8.0 ( Wed Sep 5 19:29:56 UTC 2018) for Mono
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 12/7/2018 12:37:38 PM.
Project "/home/nasser/projects/clojure-clr/arcadia.proj" on node 1 (default targets).
Project "/home/nasser/projects/clojure-clr/arcadia.proj" (1) is building "/home/nasser/projects/clojure-clr/Clojure/ClojureCLR.sln" (2) on node 1 (default targets).
ValidateSolutionConfiguration:
... many lines omitted for brevity ...
6 Warning(s)
0 Error(s)
Time Elapsed 00:00:13.71
A number of warnings is normal, but there should be zero errors. The compiled .dll
files can be found in bin/4.0/Release
and the final Clojure source tree can be found in bin/4.0/Release/clojure
bin/4.0/Release/Clojure.Main.exe
and bin/4.0/Release/Clojure.Compile.exe
can be used for quick local tests or analysis with e.g. illness
$ mono bin/4.0/Release/Clojure.Main.exe
Clojure 1.10.0-master-SNAPSHOT
user=>
$ cat foo.clj
(ns foo)
(defn a-function [a b c]
(+ a b (* b c)))
$ mono bin/4.0/Release/Clojure.Compile.exe foo
Compiling foo to .8 -- 6 milliseconds.
$ illness foo.clj.dll bin/4.0/Release/
Illness 0.1.6855.21652
Ramsey Nasser, Jan 2016
Listening on http://localhost:2718/
Updating Arcadia's Clojure installation involves a few things:
- Replace all the
*clj.dll
files in Arcadia'sInfrastructure
folder with the*.clj.dll
files from the compiler'sbin/4.0/Release
- Replace all the
Microsoft*.dll
files in Arcadia'sInfrastructure
folder with theMicrosoft*.dll
files from the compiler'sbin/4.0/Release
- Replace all the
Clojure.dll
files in Arcadia'sInfrastructure
folder with theClojure.dll
files from the compiler'sbin/4.0/Release
- Replace Arcadia's
Source/clojure
folder with the compiler'sbin/4.0/Release/clojure
folder
The unity branch has a deploy
script that automates this. It expects a single argument, the path to the Arcadia repository to deploy to (i.e. the Arcadia
folder under Assets
in a Unity project).
$ ./deploy.sh /path/to/arcadia
deployed to /path/to/arcadia
Once a change is confirmed working and ready to be finalized, it must be committed into both the Compiler and Arcadia repositories.
- Commit and push any changes to the compiler on the
unity
branch. Make a note of the commit hash. - Deploy the compiler files into Arcadia as described above. In the Arcadia repository, commit the changes to the
Infrastructure
andSource/clojure
folders as a separate commit using the following commit message template:
<describe changes>
Brings in compiler built from arcadia-unity/clojure-clr@<compiler commit hash>
This connects the compiler's history to Arcadia's history and makes tracking down bugs down the line more reasonable.
Because of the circular dependency between the language and the spec
library, updating spec
must be treated differently. The canonical spec
sources are in https://github.com/arcadia-unity/clr.spec.alpha and https://github.com/arcadia-unity/clr.core.specs.alpha and everything else is ephemeral.
To update spec
- Commit and push changes to the appropriate canonical
spec
repository on themaster
branch - Run
git submodule update
in the compiler repository to pull in your changes - Commit the updated submodules in the compiler repository
- Rebuild and redeploy the compiler as above
- Make sure not to commit spec sources to the compiler source tree