Skip to content

Make bolt-cppml build, run and package on Windows and Linux - #27

Merged
drzo merged 27 commits into
mainfrom
claude/loving-archimedes-r7fcwy
Nov 19, 2026
Merged

drzo merged 27 commits into
mainfrom
claude/loving-archimedes-r7fcwy

Conversation

@drzo

@drzo drzo commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Description

Several workflows were failing on main (CMake on multiple platforms, Cross-Platform Build and Test, MSBuild, Deno, Xcode) and E2E CI was failing on pull requests. This PR fixes the build on Windows and Linux, then goes further: it fixes defects found by actually running the built programs (command line, GUI and a real model), and makes the release pipeline produce working packages. macOS is disabled in CI for now (see below).

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • Build/CI configuration change
  • Test addition or modification

Changes Made

Build system

  • Default BUILD_SHARED_LIBS to OFF on MSVC. The vendored llama.cpp turned it ON, making bolt_lib a DLL with no exports, so about 45 targets failed with LNK1181.
  • Portable builds by default. -march=native (in cmake/platforms/Linux.cmake) and llama.cpp's GGML_NATIVE tied binaries to the build machine's CPU; CI artifacts died with "Illegal instruction" on another runner, and release packages would have done the same on user machines. New option BOLT_NATIVE_OPTIMIZATIONS (default OFF) controls both; the default targets a fixed x86-64 baseline (AVX2).
  • Linux programs start from the build tree. The rpath only suited an installed bin/ + lib/ layout, so a fresh build failed with libbolt_lib.so.1: cannot open shared object file unless LD_LIBRARY_PATH was set. The rpath now also covers the build directory and an unpacked tarball; test programs get a matching one, so ./test/bolt_unit_tests works as the README says.
  • The GUI builds against distribution packages (libimgui-dev, libstb-dev) when vcpkg's ImGui is not available, instead of being silently left out.
  • Install rules for bolt and gui_main get a BUNDLE DESTINATION and stay in the app component.

Product code

  • bolt: the interactive loop spun forever at end of input; it now exits. initialize() ran twice; it is idempotent. Added --help and --version.
  • BandwidthTracker and NetworkMetrics: two self-deadlocks (locking a non-recursive mutex already held). Recording sent or received bytes, or generating a report, hung.
  • BracketMatcher::findOpeningBracket popped an empty stack when matching from a closing bracket.
  • GitRepository redirected stderr to /dev/null, which does not exist under Windows cmd. push and pull now share one helper for their arguments instead of two copies.
  • demo_advanced_ai_features looped forever on end of input or non-numeric input.
  • MSVC compile errors: unistd.h in bolt_terminal_ai.cpp, a missing <map> include.

Tests

  • Network tests are back in CTest. They had been disabled as "requires network server, times out in CI"; the timeout was the deadlock above.
  • New regression test for the bolt input loop.
  • Fixed tests that were wrong rather than the code: a Q8_0 tensor size ggml rejects in Debug, a debugger callback writing to destroyed state, logging tests deleting open files, a path compared as a raw string, store tests that depended on registration order, a compression test below the 256-byte threshold, and the DELETE macro clash on Windows.
  • test_logging.cpp: repeated cleanup, line-counting and content-checking blocks moved into helpers.

CI

  • New scripts/smoke_test.sh, run by the Integration Tests job (which previously could not fail: its artifact lacked the shared libraries and every command ended in || echo). It checks that:
    • bolt starts without LD_LIBRARY_PATH, answers a scripted session, and exits at end of input;
    • every demo program, bolt_terminal_ai and benchmark_tool runs without hanging or crashing;
    • the GUI programs (gui_main, demo_widget_framework, demo_lsp_ui_integration) start under a virtual display and stay up;
    • a real GGUF model (a 19 MB public test model, downloaded in CI) loads and generates text.
  • Stop requesting the Visual Studio 17 2022 generator; build MinGW with Ninja and give it git; use the distribution clang; version-agnostic runtime packages; lcov tolerates bogus gcov counts from system headers; replace the retired ubuntu-20.04 runner.
  • Workflow bugs found by the workflow linter: the release summary read needs.prepare.outputs without depending on prepare (empty version) and always claimed the artifacts were uploaded; the sanitizer job used a whole NAME=value string as an environment variable name; a step conditioned on a matrix value nobody defines. Shell expansions in the three touched workflows are quoted.
  • Remove deno.yml and objective-c-xcode.yml: no Deno code and no Xcode project exist.

Release pipeline (release.yml, verified by workflow_dispatch dry runs on this branch)

  • Linux release build: install the X11 headers vcpkg needs to build GLFW.
  • DEB: remove a self-rename that failed the step, derive Depends from the libraries the binary links, and install the package and run bolt from it.
  • RPM: it was never produced (unexpanded changelog date, unsatisfiable build requirements, failures hidden by || true). It builds now.
  • Windows ZIP: copy dependency DLLs from the vcpkg manifest directory, and fail if none are found.
  • Windows MSI: locate WiX without a hard-coded version directory, include every file of the release, and check exit codes.

macOS: temporarily disabled

  • All macOS jobs are switched off in cross-platform.yml, e2e-ci.yml and release.yml, each with a note on how to re-enable it. The release job no longer waits on them and the release notes say macOS builds are unavailable.
  • Groundwork already here for re-enabling: runner labels moved off the retired macos-13 and macos-14 images, an <OpenGL/gl.h> include guard, build-tree rpaths, and a lighter Homebrew step. The macOS build compiled and linked with these, but no test run completed there.

Testing

  • Unit tests added/updated
  • All existing tests pass
  • Manual testing performed

On commit cbb03736:

  • PR CI: all Windows jobs (MSVC and MinGW, Release and Debug), all Linux jobs (gcc and clang, Release and Debug; Ubuntu 22.04 and latest), ARM cross-compilation, Integration Tests (smoke test including the GUI and model inference), E2E Tests, Code Coverage, AddressSanitizer, LeakSanitizer, Valgrind and CodeQL pass.
  • Release dry run: Linux Release, Linux Packages (DEB and RPM), Windows Release and Windows Installer pass. No release was published; the publishing job only runs on a tag.
  • Locally on Linux: 98/98 CTest tests in Release and Debug; smoke test passes; cmake --install to a prefix gives a bolt that starts with no environment set up.

Reviewer Notes

  • Lint Code Base is still red. No linter was disabled or reconfigured in this PR. The shell, Markdown, YAML and copy/paste checks now pass on the touched files. What remains:
    • clang-format and cpplint fail on all 21 touched C++ files. The repository has no .clang-format or CPPLINT.cfg, so they compare existing code with LLVM formatting and the Google style guide (which also rejects <mutex>, <thread> and <chrono> and requires a copyright header). This needs a maintainer decision: adopt a style and reformat, or stop running these two linters.
    • The workflow linter reports macos-15 and macos-15-intel as unknown runner labels, because the actionlint bundled with super-linter@v4 predates them. They are only used by the disabled macOS jobs.
  • The Copilot checks fail because the account's monthly Copilot quota is exhausted, and Cursor Bugbot needs on-demand usage enabled.
  • The GUI was checked for starting and rendering only. Its emoji labels show as ? with ImGui's default font, and the initial window layout overlaps; neither is changed here.
  • The DEB is named bolt, which is also an existing Debian/Ubuntu package (the Thunderbolt device manager).
  • The main bolt program answers with an echo of the input; that is how it is written, not something this PR changed. Model inference is reached through bolt_terminal_ai and the AI demos, which pick up the first GGUF file in ./models.
  • Not addressed: the SLSA generator workflow, which is still the unmodified template and fails on release.

🤖 Generated with Claude Code

https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71

- CMake: default BUILD_SHARED_LIBS to OFF on MSVC. The vendored llama.cpp
  turns it ON, which made bolt_lib a DLL without exports, so no import
  library was produced and every dependent target failed with LNK1181.
- CMake: give the bolt and gui_main install rules a BUNDLE DESTINATION so
  configuring on macOS (where executables are app bundles) succeeds.
- Fix MSVC compile errors: unistd.h in bolt_terminal_ai.cpp, missing <map>
  in demo_advanced_ai_features.cpp, and the winnt.h DELETE macro clashing
  with OperationType::DELETE in test_extended_e2e.cpp.
- Workflows: stop requesting the Visual Studio 17 2022 generator, quote
  the vcpkg toolchain path in the MSBuild job, and replace the retired
  macos-13 and ubuntu-20.04 runners.
- Remove the Deno and Xcode template workflows: the repository has no
  Deno code or Xcode project, so they could only fail.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
apt.llvm.org has no LLVM 17 repository for the current ubuntu-latest
release, so the clang jobs failed at apt-get update.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
The MSYS2 step installs ninja but not mingw32-make, so configuring with
the MinGW Makefiles generator failed before compiling anything.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71

drzo commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Lint Code Base (run-lint) is failing, and it is not caused by the changes in this PR.

The workflow runs github/super-linter@v4 on every file a PR touches and checks the whole file, not the changed lines. All of what it reports is in code that was already there:

  • actionlint: its runner list predates macos-14, so it rejects that label (already used in cross-platform.yml, e2e-ci.yml and release.yml) as well as macos-15-intel. It also reports shellcheck findings in steps this PR does not edit. No current macOS runner label can pass this version.
  • cpplint: 204 findings across the three touched C++ files, almost all whitespace/end_of_line (108) and whitespace/line_length (61), plus missing copyright headers.
  • clang-format: the same three files are not formatted to its default style.

Any PR that edits one of these workflows or source files will fail the same way. I have not changed the linter or reformatted the files, since that would either weaken the check or bury the fix in whitespace. Options, if you want this green:

  1. Update the lint workflow to a current super-linter release and decide which linters the repo actually wants enforced.
  2. Reformat the three files in a separate PR.

Generated by Claude Code

@drzo
drzo marked this pull request as ready for review November 18, 2026 22:18
Copilot AI balanced review requested due to automatic review settings November 18, 2026 22:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

Devin Review

Comment thread CMakeLists.txt Resolved
Comment thread .github/workflows/e2e-ci.yml Resolved
The test created a Q8_0 tensor with 100 elements, which is not a multiple
of the Q8_0 block size (32). ggml asserts on that, so the AIModels suite
and the full unit run aborted in Debug; Release builds compile the
assertion out. Use 128 elements instead.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
Copilot AI balanced review requested due to automatic review settings November 18, 2026 22:20
COMPONENT only applies to the artifact kind it follows. Adding BUNDLE
DESTINATION before it left RUNTIME in the Unspecified component, so
app-only installs and the NSIS package would have omitted the
executables on Windows and Linux. State the component for both kinds.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

…g bracket

findOpeningBracket started scanning one character before the closing
bracket, so that bracket was never pushed and the first opening bracket
popped an empty std::stack. That is undefined behaviour and aborts under
libstdc++ assertions (clang Debug on current ubuntu-latest). Start the
scan at the closing bracket itself.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
Copilot AI balanced review requested due to automatic review settings November 18, 2026 22:23
@cursor

cursor Bot commented Nov 18, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

- GitRepository: redirect stderr to NUL on Windows; cmd.exe has no
  /dev/null, so every git command failed.
- Debugger test: declare the callback's captured state before the
  debugger. Its destructor fires the callback again, which wrote to an
  already-destroyed std::string (heap corruption, 0xc0000374).
- Logging tests: make log-file cleanup best-effort. Windows cannot delete
  a file that a sink or stream still has open.
- File tree test: compare the selected path as a filesystem path, since
  the tree joins components with a backslash on Windows.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

macOS has no <GL/gl.h>; the header lives at <OpenGL/gl.h>. With the
configure step fixed, this was the next error in the macOS build.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
Copilot AI balanced review requested due to automatic review settings November 18, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

The DEB now builds, installs and runs in the release dry run. The RPM
step then failed in find-debuginfo because eu-strip (elfutils) is not on
the runner. The binary is prebuilt, so disable the debuginfo subpackage.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
Copilot AI balanced review requested due to automatic review settings November 19, 2026 00:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@drzo drzo changed the title Repair failing Windows and Linux CI builds Make bolt-cppml build, run and package on Windows and Linux Nov 19, 2026
- CMake: fall back to the distribution ImGui package (Debian/Ubuntu
  libimgui-dev plus libstb), which ships headers and a library but no
  CMake config. Without it the GUI was silently left out of any Linux
  build that used system packages instead of vcpkg.
- scripts/smoke_test.sh: start gui_main and the GUI demos under xvfb when
  there is no display and require them to stay up; previously they were
  skipped, so the GUI was never run anywhere.
- E2E CI: ship gui_main in the Linux artifact and install xvfb and the
  Mesa software renderer so the integration job exercises it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
Copilot AI balanced review requested due to automatic review settings November 19, 2026 00:47

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

On Linux the programs were linked with an rpath that only suited an
installed bin/ + lib/ layout, so a fresh build could not start:
"./bolt: error while loading shared libraries: libbolt_lib.so.1". Add
$ORIGIN and $ORIGIN/bin to the rpath so the programs find libbolt_lib.so
and llama.cpp's libraries next to them, both in the build directory and
in an unpacked tarball. Test programs live in <build>/test and get a
matching rpath, so ./test/bolt_unit_tests works as the README says.

The smoke test now checks that bolt starts with LD_LIBRARY_PATH unset,
and, when BOLT_SMOKE_MODEL points at a GGUF file, that the model loads
and generates text through DirectGGUFInference and the AI manager. The
integration job downloads a 19 MB public model for this.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
@cursor

cursor Bot commented Nov 19, 2026

Copy link
Copy Markdown

Bugbot needs on-demand usage enabled

Bugbot uses usage-based billing for this team and requires on-demand usage to be enabled.

A team admin can enable on-demand usage in the Cursor dashboard.

Copilot AI balanced review requested due to automatic review settings November 19, 2026 00:52

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

Workflows:
- release.yml: the Notify job read needs.prepare.outputs without listing
  prepare in needs, so the summary showed an empty version. It also said
  "All release artifacts have been uploaded" whatever happened; it now
  reports the publishing job's result.
- e2e-ci.yml: the sanitizer job used a whole NAME=value string as an
  environment variable name. Drop that entry; the export in the script
  is what sets the variable.
- cross-platform.yml: remove a step conditioned on matrix.compiler_version,
  which no matrix entry defines, and state shell: pwsh for the Windows
  test step.
- Quote shell expansions and group redirects to the step summary.

Code:
- GitRepository::push and pull shared their argument-building code; move
  it to one helper.
- test_logging.cpp: replace repeated cleanup, line-counting and
  content-checking blocks with helpers.

README: trailing space and a code fence without a language.

No linter is disabled or reconfigured by this change.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011vmiZ7F3rQu7dith9sQw71
Copilot AI balanced review requested due to automatic review settings November 19, 2026 01:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

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.

4 participants