Add Nix flake dev shell, custom build/run commands, and CI build/test via nix develop without Conan#1
Conversation
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/829ff235-ab93-4a48-b177-df68ede96dc3 Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/829ff235-ab93-4a48-b177-df68ede96dc3 Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/829ff235-ab93-4a48-b177-df68ede96dc3 Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/829ff235-ab93-4a48-b177-df68ede96dc3 Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
nix develop
BrandonTang89
left a comment
There was a problem hiding this comment.
The CI builds are failing. Let's just install the necessary libraries via the flake.nix.
Strip out anything regarding the Conan parts from the repo, including the code and docs.
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/cbf221a6-fd7c-41d5-bf29-2851b5505f79 Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Done in commit I removed Conan from the repository and CI flow, updated CI now builds/tests via |
nix developnix develop without Conan
BrandonTang89
left a comment
There was a problem hiding this comment.
There are some build issues related to importing the relevant catch2 headers. Help fix this. Ideally try to ensure it can build before asking me to review again (or inform me if this isn't possible)
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/547548b8-5f10-4d7a-b3e9-411e46b92c25 Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Fixed in commit I updated the flake to use I also verified the configure step locally with GCC 14 ( No UI changes in this update, so there is no UI screenshot to provide. |
BrandonTang89
left a comment
There was a problem hiding this comment.
Looking better. How about getting custom shell scripts
build
Should configure and do an parallel build with 8 workers for the specified variant (debug or release)
run
should build then run the debug/release variant
Then update the read me with proper docs about how to build and test
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/6d7ca4ec-6a25-4166-8295-cd5b1276731c Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/6d7ca4ec-6a25-4166-8295-cd5b1276731c Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/6d7ca4ec-6a25-4166-8295-cd5b1276731c Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/6d7ca4ec-6a25-4166-8295-cd5b1276731c Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Implemented in commit
I validated script syntax and invocation locally; full Nix-path execution isn’t possible in this sandbox ( No UI changes in this update, so there is no UI screenshot. |
nix develop without Conannix develop without Conan
BrandonTang89
left a comment
There was a problem hiding this comment.
I think I wasn't clear. I want 2 custom commands within the dev shell
build debug/release
run debug/release
That configure+build and configure+build+run the relevant variants of the binary
These should be executable from any directory within the workspace and still build the binary in the right placea and run it from the directory the command is run at
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/9d25f303-d2c6-4053-88a6-6a1658e594fc Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/9d25f303-d2c6-4053-88a6-6a1658e594fc Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Implemented in commits You can now use No UI changes in this update, so there is no UI screenshot. |
nix develop without Conannix develop without Conan
BrandonTang89
left a comment
There was a problem hiding this comment.
Almost there. Remove the build_and_test shell script and replace it's use within the CI with just using the newly implemented build command and cmake test
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/31866aa3-350a-4ad3-8a8c-76b9d6dc780b Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Agent-Logs-Url: https://github.com/BrandonTang89/bdd_engine/sessions/31866aa3-350a-4ad3-8a8c-76b9d6dc780b Co-authored-by: BrandonTang89 <43487872+BrandonTang89@users.noreply.github.com>
Done in commits CI no longer uses |
There was a problem hiding this comment.
Pull request overview
This PR migrates the project’s developer/CI build environment from Conan/apt-based provisioning to a Nix flake dev shell, and introduces repo-local build/run helper commands to standardize local workflows and CI execution.
Changes:
- Add
flake.nixproviding a GCC14/CMake/Ninja/Abseil/Catch2 dev shell and PATH wiring forscripts/. - Introduce
scripts/buildandscripts/runcommands and update CI to build/test vianix develop. - Remove Conan integration files and clean up related presets/editor configs/docs/ignore rules.
Reviewed changes
Copilot reviewed 11 out of 13 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/build |
Adds a build helper to configure/build Debug or Release into fixed build dirs. |
scripts/run |
Adds a run helper to build then execute the compiled bdd_engine binary. |
flake.nix |
Introduces Nix flake dev shell with toolchain and dependencies. |
.github/workflows/cmakeBuildTest.yml |
Updates CI to build/test inside nix develop instead of apt/Conan. |
CMakeLists.txt |
Requires Catch2 v3 and adds an Abseil target alias fallback. |
CMakePresets.json |
Removes Conan vendor integration and Conan-specific top-level include. |
README.md |
Updates build/test documentation to Nix + build/ctest flow and removes Conan profile guidance. |
.gitignore |
Adds ignore rules for new build directories and flake.lock. |
.vscode/c_cpp_properties.json |
Removes Conan include path reference. |
.idea/cmake.xml |
Removes Conan top-level include from IDE generation options. |
conan_provider.cmake |
Removed (Conan provider no longer used). |
conanfile.py |
Removed (Conan no longer used). |
conandata.yml |
Removed (Conan no longer used). |
Files not reviewed (1)
- .idea/cmake.xml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if command -v git >/dev/null 2>&1; then | ||
| REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)" | ||
| if [ -n "$REPO_ROOT" ] && [ -d "$REPO_ROOT/scripts" ]; then | ||
| export PATH="$REPO_ROOT/scripts:$PATH" | ||
| fi | ||
| fi |
There was a problem hiding this comment.
The shellHook only adds scripts/ to PATH when git is available and git rev-parse succeeds. That contradicts the README claim that build/run work from anywhere, and can break in minimal environments or source exports without .git (where build won’t be found). Consider adding git to the devShell packages or using a non-git fallback repo-root detection (e.g., walking up from $PWD for flake.nix/scripts/).
| if command -v git >/dev/null 2>&1; then | |
| REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)" | |
| if [ -n "$REPO_ROOT" ] && [ -d "$REPO_ROOT/scripts" ]; then | |
| export PATH="$REPO_ROOT/scripts:$PATH" | |
| fi | |
| fi | |
| REPO_ROOT="" | |
| if command -v git >/dev/null 2>&1; then | |
| REPO_ROOT="$(git rev-parse --show-toplevel 2>/dev/null || true)" | |
| fi | |
| if [ -z "$REPO_ROOT" ]; then | |
| search_dir="$PWD" | |
| while [ "$search_dir" != "/" ]; do | |
| if [ -d "$search_dir/scripts" ]; then | |
| REPO_ROOT="$search_dir" | |
| break | |
| fi | |
| search_dir="$(dirname "$search_dir")" | |
| done | |
| fi | |
| if [ -n "$REPO_ROOT" ] && [ -d "$REPO_ROOT/scripts" ]; then | |
| export PATH="$REPO_ROOT/scripts:$PATH" | |
| fi |
| find_package(absl) | ||
| find_package(Catch2) | ||
| find_package(Catch2 3 REQUIRED) | ||
|
|
||
| if(NOT TARGET abseil::abseil) | ||
| add_library(abseil::abseil INTERFACE IMPORTED) | ||
| set(_absl_components | ||
| absl::base |
There was a problem hiding this comment.
find_package(absl) is not marked REQUIRED, but the project unconditionally includes Abseil headers and links against abseil::abseil. With the fallback target below, CMake can configure successfully even when Abseil isn’t found (leading to later, harder-to-debug compile/link failures). Make Abseil discovery fail fast (e.g., find_package(absl REQUIRED) / CONFIG REQUIRED) and/or emit a fatal error if the expected absl::* targets are missing before creating abseil::abseil.
This PR introduces a Nix flake-based development environment for
bdd_engineand updates CI to build/test through that same environment. The goal is to make dependency/toolchain provisioning explicit and consistent between local dev and GitHub Actions.Build environment: add
flake.nixgcc14(for C++26 support)cmakeninjaabseil-cppcatch2_3CC/CXXto GCC 14 in the shell hook.scripts/toPATHin the dev shell when the repo root is detectable.CI: run configure/build/test inside flake dev shell
.github/workflows/cmakeBuildTest.ymlwith Nix-based setup.nix develop.build releasectest --test-dir cmake_build_release --output-on-failureCustom shell scripts
build debug|release: configure + build intocmake_build_debugorcmake_build_releaserun debug|release [args...]: configure + build + runbdd_enginescripts/build_and_test.shscript in favor of the newbuildcommand +ctestflow.Conan removal from repository
conan_provider.cmakeconanfile.pyconandata.ymlCMake compatibility update
abseil::abseillinkage working by adding a fallback alias target when onlyabsl::*targets are available in the environment.find_package(Catch2 3 REQUIRED)) to match imported headers/targets.Docs/config cleanup
README.mdto document Nix-based commands, includingbuild/runvariants and test invocation withctest.CMakePresets.json,.vscode/c_cpp_properties.json, and.idea/cmake.xmlto remove Conan-specific settings.cmake_build/,cmake_build_debug/, andcmake_build_release/to.gitignoreto avoid committing local build artifacts.Original prompt
💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.