These scripts automates the LinkStage3
building process and Assembly3 WB installation. In order to create a robust build environment, a Debian container is created and FreeCAD is built and run inside it.
This approach is like Docker, but the container creation (create-container.sh
) and target environment setup (setup-rootfs.sh
) is separated. Why? Because I don't understand Docker yet.
If you have Debian, you can simply download FreeCAD source, install the dependencies, compile FreeCAD, compile and install Assembly3 WB by:
git clone https://github.com/ceremcem/build-freecad-asm3
cd build-freecad-asm3
./install-fc-deps.sh || dpkg --configure -a
./build-fc.sh # Run whenever you need to update FreeCAD
To run FreeCAD: ~/fc-build/Release/bin/FreeCAD
TL;DR;
git clone https://github.com/ceremcem/build-freecad-asm3
cd build-freecad-asm3/tools
./create-container.sh --host debian # possible hosts: debian, arch
./setup-rootfs.sh
./freecad.sh # to run FreeCAD
./update-fc.sh # to update FreeCAD
Main intention of these scripts is to run them in a clean LXC container, just like Docker.
Similar to the list on FreeCAD Docker Wiki, using a virtual build/run environment has many invaluable advantages for a bleeding edge application:
You can always compile:
For manual installation steps, see manual-install.md.
create-container.sh
)earlyoom
: In order to prevent a total freeze during compilation, you are strongly adviced to install https://github.com/rfjakob/earlyoomgit clone https://github.com/ceremcem/build-freecad-asm3
cd build-freecad-asm3/tools
./create-container.sh --host debian # possible hosts: debian, arch
./setup-rootfs.sh
You can use an existing Debian container and/or an existing FreeCAD git clone on your host. See ./setup-rootfs.sh --help
for more options.
./tools/freecad.sh
If you need to provide more detailed backtrace in case of a crash, see debug-friendly-run.
When you want to pull new commits and update your FreeCAD binary, issue the following command:
./tools/update-fc.sh
This command will:
/var/lib/lxc/fc/rootfs/home/fc/FreeCAD
This tool is copied into the container on setup. Whenever you need to update that copy inside the container, issue the following command on your host:
./tools/update-builder.sh
If you need to compile the FreeCAD against a specific branch, remote or commit, edit the configuration file within the container and rebuild FreeCAD:
local:$ ./attach.sh
fc@debian:~$ nano build-freecad-asm3/config.sh # edit accordingly
fc@debian:~$ exit
local:$ ./update-fc.sh
You can create bind mounts within the LXC config file (/var/lib/lxc/fc/config
):
lxc.mount.entry = /home/ceremcem/.FreeCAD home/fc/.FreeCAD none bind,create=dir 0 0
lxc.mount.entry = /home/ceremcem/projects home/fc/projects none bind,create=dir 0 0
See also ./tools