-
Notifications
You must be signed in to change notification settings - Fork 0
Setup
Download and run the nix install script:
curl -L https://raw.githubusercontent.com/steppercontrol/scon_build/master/sh/nix_install_2.18.2 | sh -s -- --daemon
The expected output ends with:
Installation finished! To ensure that the necessary environment
variables are set, either log in again, or type
. /home/boss/.nix-profile/etc/profile.d/nix.sh
in your shell.
Source the environment as instructed above, or:
. $HOME/.nix-profile/etc/profile.d/nix.sh
mkdir -p ~/.config/nix
echo "max-jobs = 4" >> ~/.config/nix/nix.conf
echo "experimental-features = nix-command flakes" >> ~/.config/nix/nix.conf
cd $planer_repository_path
git fetch
git checkout master
nix develop
Copy the contents of a configuration to a file (referred to as $config_file below).
scon configure --config $config_file
scon init --shell --arduino-ide
cd $planer_repository_path
git fetch
git checkout master
nix develop
scon build
scon upload
scon monitor
nix serves to provide reproducible development shells with the software
prerequisites for building the scon system. The flake.nix file in the
planer repository describes the system's dependencies and build environment.
With nix installed, the command nix develop enters a development shell with
these dependencies available.
The scon_build system provides a scon command with subcommands used to
take planer-related actions. For example:
-
scon initis used to initialize the development environment, including installing the Arduino CLI and configuring the Arduino IDE. -
scon configureis used to initialize a build directory. -
scon buildis used to build the system into a configured directory.
Before building the system, a build directory must be initialized. The build directory is where all artifacts are placed, including Arduino programs, test programs, and debug information. After initialization, a build directory need not be reinitialized until a breaking change in the scon system or hardware or software reconfiguration.
- The command
scon configureinitializes the build directory_buildinside - the current shell directory.
- On initialization, the file
config.toml.defaultis used as the configuration template. It is copied to_build/config.tomlwith more specific information added. - Subsequent invocations of
scon builduse_build/config.toml. Any changes to this file are propagated the next timescon buildis run.