felix
felix copied to clipboard
Portable build instructions.
The nix-shell build instructions doesn't work on Ubuntu 20.04 with current version of nix-shell.
This would appear to be more portable:
git clone https://github.com/felix-lang/felix --depth=1
chmod a+rw -R felix
cd felix
docker run --rm -v `pwd`:/usr/src -ti archlinux bash
pacman -Sy fakeroot binutils git ocaml sdl2_image sdl2_gfx sdl2_ttf sdl2 gsl gcc python3 make
useradd user
su user
cd /usr/src/felix/src/misc
# ln -s /usr/src/felix src/ # makepkg doesn't allow this ... better solution is to copy this misc folder somewhere else first
sed -i s@url=.*@url=/usr/src/felix@ PKGBUILD # otherwise whole git repo gets pulled AGAIN
makepkg
...
exit
This ends with this:
[fbuild] [Felix] TEST BUILD
looking for bootflx : ok build/release/host/bin/bootflx
[fbuild] [Felix] BUILDING PLUGINS
BUILDING PLUGINS
* build/release/host/bin/bootflx --test=build/release: build/release/share/lib/plugins/toolchain_clang_macosx.flx -> build/release/share/lib/plugins/toolchain_clang_macosx.so
+ build/release/host/bin/bootflx -Ibuild/release/share/lib/plugins --test=build/release -c --test=build/release -od build/release/host/lib/rtl build/release/share/lib/plugins/toolchain_clang_macosx.flx
BOOTFLX
[bootflx] build/release/host/bin/bootflx -Ibuild/release/share/lib/plugins --test=build/release -c --test=build/release -od build/release/host/lib/rtl build/release/share/lib/plugins/toolchain_clang_macosx.flx
Cache may be out of date due to grammar upgrade!
Grammar time stamp =1638111295.000
Automaton.syntax time stamp =BIG BANG
Delete cache /home/c3/.felix/cache/text
Delete cache /home/c3/.felix/cache/binary
Error running 'build/release/host/bin/bootflx -Ibuild/release/share/lib/plugins --test=build/release -c --test=build/release -od build/release/host/lib/rtl build/release/share/lib/plugins/toolchain_clang_macosx.flx' exited with -11
make: *** [GNUmakefile:128: do-fbuild] Error 1
==> ERROR: A failure occurred in build().
Aborting...
[c3@cabe3d5e1fd3 misc]$
If you rm -rf all the osx* directories, it compiles and installs fine... but I'm sure there's a configuration option to do the same.
What does the log say?
build/release/fbuild.log
Removing the osx directories should have no impact at all. The bootstrap builder builds all the toolchains. The error isn't visible and not enough of the script before that is shown to see what the default toolchain selected is. However, the bootflx program has built. The toolchain used to build bootflx is unrelated to the one used BY bootflx to rebuild the system, although they should be the same toolchain.
The bootflx and flx_pkgconfig programs are built by Python using the fbuild build system. A cut down run time library is also built. The config database in
build/release/host/config
is established. It controls subsequent build steps.
Then, bootflx is used to rebuild itself and several tools including tools to build the compiler flxg, and the runtime system.
Once it is built, make rebuild
should rebuild it.
Interestingly the "init before use" checker I'm working on found a bug in the buildtool where the code was copying C++ header files based on a list in a variable headers
which was only initialised afterwards. I am guessing the only reason this every worked is (a) the initial value of the list was Empty
and (b) the files were already in place due to the bootstrap build.
// setup header files to copy
// os/bits/compiler config
var headers = ([(cmd.os+cmd.bits)/cmd.compiler/'rtl'/'([^/]*\\.hpp)']);
// socket config
headers += (cmd.os+cmd.bits)/'rtl'/'([^/]*\\.hpp)';
println$ 'Copying C++ headers ..';
for pattern in headers perform
CopyFiles::copyfiles(cmd.repo/'src'/'config', pattern,
cmd.target_dir/cmd.target_bin/'lib'/'rtl'/'${1}',true,cmd.debug);