Skip to content

fix: move doctest to buildInputs to enable aarch64 cross-compilation - #35

Merged
gfauredev merged 2 commits into
mainfrom
copilot/fix-nix-build-errors-smart-piano-engine-aarch64
Mar 14, 2026
Merged

fix: move doctest to buildInputs to enable aarch64 cross-compilation#35
gfauredev merged 2 commits into
mainfrom
copilot/fix-nix-build-errors-smart-piano-engine-aarch64

Conversation

Copilot AI commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

nix build .#packages.x86_64-linux.smart-piano-engine-aarch64 fails because CMake cannot find the doctest package during cross-compilation configure.

Root cause

doctest was in nativeBuildInputs, which in a cross-compilation context means it's only available to host-side tools. CMake's find_package(doctest REQUIRED) searches CMAKE_PREFIX_PATH for the target sysroot, where doctest was absent.

Change

In engine.nix, move doctest from nativeBuildInputs to buildInputs:

nativeBuildInputs = [ cmake cppcheck llvm ninja pkg-config ];
buildInputs = [ doctest rtmidi ] ++ lib.optionals stdenv.isLinux [ alsa-lib libjack2 ];

doctest is a C++ header library linked into test executables compiled for the target — it belongs in buildInputs for both native and cross builds.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

…pilation

Co-authored-by: gfauredev <19304085+gfauredev@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix errors on nix build for smart piano engine aarch64 fix: move doctest to buildInputs to enable aarch64 cross-compilation Mar 14, 2026
Copilot AI requested a review from gfauredev March 14, 2026 01:16
@gfauredev
gfauredev marked this pull request as ready for review March 14, 2026 01:35
@github-actions

Copy link
Copy Markdown

📊 Coverage Report

Coverage Summary

Filename                      Regions    Missed Regions     Cover   Functions  Missed Functions  Executed       Lines      Missed Lines     Cover    Branches   Missed Branches     Cover
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
include/GameEngine.hpp              4                 0   100.00%           2                 0   100.00%           7                 0   100.00%           0                 0         -
include/IGameMode.hpp               3                 0   100.00%           2                 0   100.00%           2                 0   100.00%           0                 0         -
include/IMidiInput.hpp              1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
include/ITransport.hpp              1                 0   100.00%           1                 0   100.00%           1                 0   100.00%           0                 0         -
include/Logger.hpp                 27                 2    92.59%           7                 0   100.00%          46                 1    97.83%          16                 2    87.50%
include/Message.hpp                11                 0   100.00%           5                 0   100.00%          10                 0   100.00%           2                 0   100.00%
include/Note.hpp                    8                 0   100.00%           2                 0   100.00%           7                 0   100.00%           4                 0   100.00%
include/RtMidiInput.hpp             4                 0   100.00%           4                 0   100.00%           7                 0   100.00%           0                 0         -
include/UdsTransport.hpp            4                 0   100.00%           3                 0   100.00%           8                 0   100.00%           0                 0         -
src/AnswerValidator.cpp            67                 7    89.55%           5                 0   100.00%          99                 7    92.93%          48                12    75.00%
src/ChallengeFactory.cpp           19                 0   100.00%           5                 0   100.00%          58                 0   100.00%          10                 0   100.00%
src/ChordGame.cpp                  53                 0   100.00%           4                 0   100.00%         104                 0   100.00%          40                 1    97.50%
src/GameEngine.cpp                 64                 2    96.88%           7                 0   100.00%         128                 3    97.66%          42                 4    90.48%
src/NoteGame.cpp                   39                 1    97.44%           4                 0   100.00%          76                 0   100.00%          28                 3    89.29%
src/RtMidiInput.cpp                56                 7    87.50%          16                 6    62.50%         136                16    88.24%          32                 7    78.12%
src/UdsTransport.cpp               82                 3    96.34%           8                 0   100.00%         126                12    90.48%          51                 6    88.24%
src/main.cpp                       25                 2    92.00%           3                 0   100.00%          52                10    80.77%          14                 6    57.14%
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
TOTAL                             468                24    94.87%          79                 6    92.41%         868                49    94.35%         287                41    85.71%

@gfauredev
gfauredev merged commit 00c3188 into main Mar 14, 2026
8 checks passed
@gfauredev
gfauredev deleted the copilot/fix-nix-build-errors-smart-piano-engine-aarch64 branch March 14, 2026 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants