Better bootstrapping process

This commit is contained in:
Edwin Brady 2020-05-19 21:05:52 +01:00
parent 9213b65ee1
commit 7defc40c47
4 changed files with 33 additions and 28 deletions

View File

@ -23,38 +23,23 @@ Make sure that:
1a: Installing without an existing Idris 2 1a: Installing without an existing Idris 2
------------------------------------------ ------------------------------------------
If you *don't* have Idris-2-in-Idris-1 installed, you can still build a If you *don't* have Idris-2-in-Idris-1 installed, you can buld from pre-built
bootstrapping compiler, as long as you have Chez Scheme installed. This is a Chez Scheme source, as long as you have Chez Scheme installed. To do this,
bit more fiddly than if you have Idris 2 installed (for the moment - it should enter:
be scriptable) but you only have to do it once.
To begin, enter: * `make bootstrap SCHEME=chez`
* `make init-bootstrap SCHEME=chez` `chez` is the executable name of the Chez Scheme compiler. You may need to
(`chez` 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 replace this with the executable for Chez Scheme on your system. This could be
`chez`, `chezscheme` or `chezscheme9.5` or something else, depending on your `scheme`, `chezscheme` or `chezscheme9.5` or something else, depending on your
system and the Chez Scheme version). system and the Chez Scheme version.
This builds an Idris 2 compiler from scheme code output from a working Idris 2 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 compiler (which isn't necessarily up to date, but is up to date enough to
build the current repository). build the current repository). It then rebuilds using the result.
Then, to build the libraries using this generated compiler, again using your Then to install, type:
local variant for `chez`.
* `make libs SCHEME=chez`
* `make install SCHEME=chez`
At this point, check that `$PREFIX/bin` is in your `PATH`.
Then, go to the Self-hosting step below, but you'll also need to add
`SCHEME=chez` (with the appropriate name for `chez`) so that the bootstrapping
script knows where to look. That is:
* `make clean` -- clean the build artefacts
* `make all IDRIS2_BOOT=idris2sh SCHEME=chez`
* `make install` * `make install`
1b: Installing with an existing Idris 2 1b: Installing with an existing Idris 2

View File

@ -103,7 +103,7 @@ install-libs: libs
${MAKE} -C libs/network install IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_VERSION=${IDRIS2_VERSION} ${MAKE} -C libs/network install IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} IDRIS2_VERSION=${IDRIS2_VERSION}
${MAKE} -C libs/contrib install IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH} ${MAKE} -C libs/contrib install IDRIS2=../../${TARGET} IDRIS2_PATH=${IDRIS2_BOOT_PATH}
init-bootstrap: support bootstrap: support
cp support/c/${IDRIS2_SUPPORT} bootstrap/idris2sh_app cp support/c/${IDRIS2_SUPPORT} bootstrap/idris2sh_app
sed s/libidris2_support.so/${IDRIS2_SUPPORT}/g bootstrap/idris2sh_app/idris2sh.ss > bootstrap/idris2sh_app/idris2-boot.ss sed s/libidris2_support.so/${IDRIS2_SUPPORT}/g bootstrap/idris2sh_app/idris2sh.ss > bootstrap/idris2sh_app/idris2-boot.ss
ifeq ($(OS), darwin) ifeq ($(OS), darwin)

View File

@ -1,9 +1,29 @@
#!/bin/sh #!/bin/sh
if [ -z "$SCHEME" ]
then
echo "SCHEME not set. Invoke with SCHEME=[name of chez executable]"
exit 1
fi
# Compile the bootstrap scheme
cd bootstrap cd bootstrap
${SCHEME} --script compile.ss ${SCHEME} --script compile.ss
# Put the result in the usual place where the target goes
mkdir -p ../build/exec mkdir -p ../build/exec
mkdir -p ../build/exec/idris2sh_app mkdir -p ../build/exec/idris2sh_app
install idris2-boot ../build/exec/idris2sh install idris2-boot ../build/exec/idris2sh
install idris2sh_app/* ../build/exec/idris2sh_app install idris2sh_app/* ../build/exec/idris2sh_app
# Install with the bootstrap directory as the PREFIX
DIR="`realpath $0`"
PREFIX="`dirname $0`"/bootstrap
cd ..
# Now rebuuld everything properly
make libs SCHEME=${SCHEME} PREFIX=${PREFIX}
make install SCHEME=${SCHEME} PREFIX=${PREFIX}
make clean
make all IDRIS2_BOOT=${PREFIX}/bin/idris2sh SCHEME=${SCHEME}

View File

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