…er its name
fetch-llamacpp.mjs copied the first file named LICENSE* to llamacpp/LICENSE.
The Windows archives carry no llama.cpp LICENSE, only LLVM OpenMP's
LICENSE-LLVM-OpenMP for their libomp.dll, so Windows shipped LLVM's text
under llama.cpp's name and none of llama.cpp's own.
Each licence file is now staged under its own name, and llama.cpp's LICENSE
on every platform: from the archive where it has one, else from a copy taken
at the pinned build. An archive whose LICENSE differs from the copy stops the
fetch. The .gitignore entry is anchored like its siblings so scripts/llamacpp/
is tracked.
What
fetch-llamacpp.mjsnow stages llama.cpp's licence files under their own names, with llama.cpp's ownLICENSEon every platform.scripts/llamacpp/licences.mjscopies eachLICENSE-*file the archive carries under its own name. On Windows that isLICENSE-LLVM-OpenMP, for thelibomp.dllbesidellama-server.LICENSEfrom the archive when the archive has one. Otherwise it usesscripts/llamacpp/llama.cpp-LICENSE, a copy taken at b11050.LICENSEdiffers from that copy stops the fetch, so the copy can't go stale when the build moves..gitignoreanchorsllamacpp/to the staged folder, as/sdcpp/,/audiocpp/and/opencode/already are, soscripts/llamacpp/is tracked.packaging.mdsays what the stage carries.Why
The script copied the first file whose name starts with
LICENSEtollamacpp/LICENSE.LICENSE: its release workflow runscp LICENSE ./build/bin/for them.LICENSE-LLVM-OpenMPthat ggml's CMake copies next tolibomp.dll(ggml/src/CMakeLists.txt, underGGML_OPENMP_FETCH).So on Windows,
llamacpp/LICENSEheld LLVM's text under llama.cpp's name, and llama.cpp's MIT notice wasn't shipped at all. A Windows stage made on 22 September shows it: itsLICENSEbegins "The LLVM Project is under the Apache License v2.0 with LLVM Exceptions".The kept copy is llama.cpp's
LICENSEat b11050 byte for byte: git blobe7dca554, the same as upstream's.The Windows installer still ships no
LICENSE-jsonhpp. llama.cpp embeds that text, with the others, in the binary, but doesn't put the file in any archive. The third-party notices work can decide whether to carry it.How to test
cd surfsense_local/electron node --test scripts/llamacpp/licences.test.mjs node scripts/fetch-llamacpp.mjs --checklicences.test.mjspasses 4 tests:The test sits one folder under
scripts/, so the package'sscripts/**/*.test.mjspicks it up undershtoo.fetch-llamacpp.mjs --checkpasses, which loads the new module.Not run: a full fetch on each OS, since it downloads the archive. The release workflow runs it on all three. An
electron/llamacpp/staged before this keeps its oldLICENSEuntil it is staged again; delete the folder to refresh it.High-level PR Summary
This PR fixes a licensing issue in the Windows build where llama.cpp's own MIT license was not being shipped, and LLVM OpenMP's license was incorrectly named as llama.cpp's license. The changes implement proper license file staging: each license file is now copied under its own name (e.g.,
LICENSE-LLVM-OpenMP), and llama.cpp'sLICENSEis included on all platforms. For Windows archives that lack llama.cpp's license file, a pinned copy from build b11050 is used, with validation to ensure it stays current when the build version updates.⏱️ Estimated Review Time: 5-15 minutes
💡 Review Order Suggestion
surfsense_local/electron/scripts/llamacpp/llama.cpp-LICENSEsurfsense_local/electron/scripts/llamacpp/licences.test.mjssurfsense_local/electron/scripts/llamacpp/licences.mjssurfsense_local/electron/scripts/fetch-llamacpp.mjssurfsense_local/electron/.gitignoredocs/architecture/packaging.mdSummary by CodeRabbit