Another attempt at making the bootstrap step work

This commit is contained in:
Edwin Brady 2020-05-18 16:02:30 +01:00
parent 052713b645
commit 155dddb5f3
6 changed files with 34 additions and 15 deletions

View File

@ -1,6 +1,9 @@
Installing
==========
Requirements: Chez Scheme (with threading support) and bash. On a Mac, you
will need to install `coreutils` to have access to `realpath`.
0: Fix hard coded prefix (sorry)
--------------------------------
@ -12,23 +15,28 @@ you start:
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:
If you *don't* have Idris-2-in-Idris-1 installed, you can still build a
bootstrapping compiler, as long as you have Chez Scheme installed. This is a
bit more fiddly than if you have Idris 2 installed (for the moment) but you
only have to do it once.
* `sh ./init-bootstrap scheme`
To begin, enter:
* `make init-bootstrap SCHEME=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).
`chez`, `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
Then, to build Idris 2 (again using your local variant for `scheme`)
* `make all IDRIS2_BOOT=bootstrap/idris2-boot`
* `make libs IDRIS2_BOOT=bootstrap/idris2-boot SCHEME=scheme`
* `make all IDRIS2_BOOT=bootstrap/idris2-boot SCHEME=scheme`
* `make install`
1b: Installing with an existing Idris 2

View File

@ -23,13 +23,14 @@ ifeq ($(shell git status >/dev/null 2>&1; echo $$?), 0)
endif
endif
export IDRIS2_SUPPORT := libidris2_support${SHLIB_SUFFIX}
export IDRIS2_VERSION := ${MAJOR}.${MINOR}.${PATCH}
IDRIS2_VERSION_TAG := ${IDRIS2_VERSION}${VER_TAG}
export IDRIS2_CURDIR = $(CURDIR)
export IDRIS2_BOOT_PATH = ${IDRIS2_CURDIR}/libs/prelude/build/ttc:${IDRIS2_CURDIR}/libs/base/build/ttc:${IDRIS2_CURDIR}/libs/network/build/ttc
.PHONY: all support clean support-clean ${TARGET}
.PHONY: all support clean support-clean init-bootstrap ${TARGET}
all: support ${TARGET} libs
@ -88,3 +89,6 @@ install-libs: libs
${MAKE} -C libs/base install IDRIS2=../../${TARGET}
${MAKE} -C libs/network install IDRIS2=../../${TARGET} IDRIS2_VERSION=${IDRIS2_VERSION}
${MAKE} -C libs/contrib install IDRIS2=../../${TARGET}
init-bootstrap:
./init-bootstrap

View File

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

View File

@ -1,4 +1,5 @@
#!/bin/sh
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`dirname $0`/"idris2-boot_app""
`dirname $0`/"idris2-boot_app/idris2sh.so" "$@"
DIR=`realpath $0`
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:`dirname $DIR`/"idris2-boot_app""
${SCHEME} --script `dirname $DIR`/"idris2-boot_app/idris2-boot.so" "$@"

View File

@ -1,5 +1,3 @@
#!/usr/bin/chezscheme9.5 --script
(import (chezscheme))
(case (machine-type)
[(i3le ti3le a6le ta6le) (load-shared-object "libc.so.6")]
@ -6859,4 +6857,4 @@
(define StringTrie-Data-empty (lambda (arg-0) (vector 1 (StringMap-Data-empty 'erased))))
(define REPL-IDEMode-Idris-replIDE (lambda (arg-0 arg-1 arg-2 arg-3 arg-4 ext-0) (Core-Core-throw_Catchable__Core_Error 'erased (vector 54 "Not implemented yet") ext-0)))
(load-shared-object "libidris2_support.so")
(PrimIO-unsafePerformIO 'erased (lambda (eta-0) (Main-main eta-0))))
(PrimIO-unsafePerformIO 'erased (lambda (eta-0) (Main-main eta-0))))

View File

@ -1,6 +1,14 @@
#!/bin/sh
echo $IDRIS2_SUPPORT
make support
cp support/c/libidris2_support.so bootstrap/idris2-boot_app
cd bootstrap
$1 --script compile.ss
sed s/libidris2_support.so/$IDRIS2_SUPPORT/g idris2-boot_app/idris2sh.ss > idris2-boot_app/idris2-boot.ss
${SCHEME} --script compile.ss
mkdir -p ../build/exec
mkdir -p ../build/exec/idris2-boot_app
install idris2-boot ../build/exec/idris2sh
install idris2-boot_app/* ../build/exec/idris2-boot_app