Add bootstrapping instructions

Added a known good scheme output which can be used to start the
bootstrapping process.
This commit is contained in:
Edwin Brady 2020-05-18 14:43:12 +01:00
parent 2968681063
commit 555f522ad0
6 changed files with 6925 additions and 10 deletions

47
INSTALL.md Normal file
View File

@ -0,0 +1,47 @@
0. Fix hard coded prefix (sorry)
--------------------------------
This isn't easily configurable yet - I will deal with it soon. So, before
you start:
* Change the `prefix` which is currently hard coded in `Idris.Main`.
1a. Installing without an existing Idris 2
------------------------------------------
If you *don't* have Idris-2-in-Idris-1 installed, you can build a bootstrapping
compiler from the files in `bootstrap/` as follows:
* `sh ./init-bootstrap scheme`
(`scheme` is the executable name of the Chez Scheme compiler. You may need to
replace this with the executable for Chez Scheme on your system. This could be
`chezscheme` or `chezscheme9.5` or something else, depending on your system and
the Chez Scheme version).
This builds an Idris 2 compiler from scheme code output from a working Idris 2
compiler (which isn't necessarily up to date, but is up to date enough to
build the current repository).
Then, to build Idris 2
* `make all IDRIS2_BOOT=bootstrap/idris2-boot`
* `make install`
1b. Installing with an existing Idris 2
---------------------------------------
If you have Idris-2-in-Idris-1 installed:
* `make all && make install`
2. Self-hosting step
--------------------
Then, to build from the newly installed `idris2sh`
* `make clean` -- to make sure you're building everything with the new version
* `make all IDRIS_BOOT=idris2sh && make install`
For amusement, try using `time` on the above. I get about 3m for installing
from `idris2`, and about 1m45 for installing from `idris2sh`.

View File

@ -1,12 +1,7 @@
To build and install from Idris 2 in Idris 1:
Self-hosted Idris 2
-------------------
* Change the `prefix` which is currently hard coded in `Idris.Main`
* `make all && make install`
See `INSTALL.md` for installation instructions.
Then, to build from the newly installed `idris2sh`
* make clean
* `make all IDRIS_BOOT=idris2sh && make install`
For amusement, try using `time` on the above. I get about 3m for installing
from `idris2`, and about 1m45 for installing from `idris2sh`.
This repository might move or be renamed or anything at no notice. It will
eventually turn into the real Idris 2 repository, one way or another.

1
bootstrap/compile.ss Normal file
View File

@ -0,0 +1 @@
(parameterize ([optimize-level 3]) (compile-program "idris2-boot_app/idris2sh.ss"))

4
bootstrap/idris2-boot Executable file
View File

@ -0,0 +1,4 @@
#!/bin/sh
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`dirname $0`/"idris2-boot_app""
`dirname $0`/"idris2-boot_app/idris2sh.so" "$@"

File diff suppressed because one or more lines are too long

6
init-bootstrap Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
make support
cp support/c/libidris2_support.so bootstrap/idris2-boot_app
cd bootstrap
$1 --script compile.ss