Remove binary files#1964
Conversation
Signed-off-by: Mairi Savanna Dulaney <mairi@seattlebus.space>
|
Hello there, fellow Gentoo stage 1 user? |
|
thanks, we will merge this. I'll wait a bit and look at our options to automate the build. (Anyone is welcome to help) |
hi, how are these binaries built? i'd be happy to help set them up to build with the rest of lem at build time |
|
@mldulaney hey thanks for proposing. Here's a lisp snippet that builds the binary: ;; thanks to April & May on Discord
(let* ((source (asdf:system-relative-pathname :lem-terminal "terminal.c"))
(lib (asdf:system-relative-pathname
:lem-terminal (format nil
"~(lib/~A/~A/terminal.so~)"
(uiop:operating-system)
(uiop:architecture)))))
(unless (probe-file lib)
(ensure-directories-exist lib)
#+darwin
(uiop:run-program (format nil "cc ~A -I/opt/homebrew/include -L/opt/homebrew/lib -lvterm -o ~A -shared -fPIC"
source lib))
#-darwin
(uiop:run-program (format nil "cc ~A -lvterm -o ~A -shared -fPIC" source lib))))(it fails on my machine so it's a bit more difficult to test for me) Example invocation: |
|
Here's some other relevant building code for this: be73d0d#commitcomment-173429479 |
@vindarel Should your build script example be added to the |
|
@jgarte mmh maybe it could, so one could run this build step on its own; but most importantly the build step that builds Lem on the CI should run it and include the final .so in the bundle. I also think building this .so is optional and shouldn't make all the build fail. also the snippet is courtesy of a helping hand on Discord |
|
Comment on the build snippet: |
|
This pull request has been inactive for {days} days. If there is no activity within the next 7 days, it will be automatically closed. Please comment or push new commits to keep it open. |
|
Closing this pull request due to inactivity. Please reopen it if you want to continue working on it. |
|
Code Contractor could not find How to set up:
💡 Tip: Use "Generate with AI" in the dashboard to create a contract tailored to your project. 📚 About Code ContractorDeclarative Code Standards That Learn and Improve Define domain-specific validation rules in YAML. Want this for your repo? |
) * chore(terminal): remove committed terminal.so binaries, build from source Removes the three prebuilt terminal.so shared objects from version control and replaces them with a from-source build path, addressing #1964 ("Open source software should, by definition, not be distributing binary files"). The build script and `make terminal-lib` target landed in #2182; this wires them into the editor build and removes the binaries: - git rm the linux/arm64, linux/x64 and macosx/arm64 terminal.so files. - Invoke `terminal-lib` best-effort (`-$(MAKE) terminal-lib`) from the ncurses, sdl2, sdl2-ncurses, webview and webview-ncurses targets so source installs still get a terminal. A missing libvterm/compiler is non-fatal: lem-terminal/ffi.lisp already wraps use-foreign-library in ignore-errors and silently disables itself when the library is absent. - gitignore extensions/terminal/lib/**/*.so so locally-built helpers are never re-committed. - Convert .github/workflows/build-terminal-shared-object.yml from a workflow that recompiled and re-committed terminal.so on every push (which would reintroduce exactly the binaries this removes) into a verify-only CI check that builds terminal.so from source on Linux and macOS and fails if the build breaks. Refs #1964, #2060, #2182. * chore(terminal): exit explicitly and verify artifact in build script build-terminal.lisp dropped into the SBCL REPL after a successful build (exiting only on stdin EOF) and trusted the compiler's exit code without checking that terminal.so was actually written. - Quit 0 after a successful build so `sbcl --load` never blocks on stdin. - Delete any stale .so before compiling, then assert the artifact exists afterwards, so a compiler that exits 0 without producing the file is treated as a failure instead of a silent no-op. - Factor the failure path into build-failed (stderr + exit 1). * chore(terminal): bundle static terminal.so into release artifacts Release bundles (Linux AppImage, macOS zip) never shipped or loaded terminal.so: ffi.lisp resolves it from the build machine's source tree via asdf:system-relative-pathname, and the macOS deploy library only bundles a foreign library that is loaded at build time -- which failed because the CI runner lacked libvterm. Even when bundled, a dynamic terminal.so referenced Homebrew's libvterm by absolute path and would break on a clean machine. Build a self-contained terminal.so with libvterm statically linked for releases, so the deploy library (macOS) and LD_LIBRARY_PATH=usr/lib (AppImage) can load it with no external libvterm dependency. - build-terminal.lisp: add LEM_TERMINAL_STATIC mode. macOS links libvterm.a directly (prefix via LIBVTERM_PREFIX / brew --prefix); Linux wraps -lvterm in -Wl,-Bstatic. Default stays dynamic for source installs. - macos-deploy.bash + nightly-builds.yml: install libvterm and build the static helper before asdf:make so deploy bundles it; assert it landed in the .app. - Dockerfile-AppImage: install libvterm-dev and build the static helper before asdf:make; make_appdir.sh asserts terminal.so reached usr/lib. No ffi.lisp/core changes: deploy + LD_LIBRARY_PATH handle runtime resolution once a self-contained .so is bundled. Refs #1964, #2060.
…urce (#2204) * chore(terminal): remove committed terminal.so binaries, build from source Removes the three prebuilt terminal.so shared objects from version control and replaces them with a from-source build path, addressing #1964 ("Open source software should, by definition, not be distributing binary files"). The build script and `make terminal-lib` target landed in #2182; this wires them into the editor build and removes the binaries: - git rm the linux/arm64, linux/x64 and macosx/arm64 terminal.so files. - Invoke `terminal-lib` best-effort (`-$(MAKE) terminal-lib`) from the ncurses, sdl2, sdl2-ncurses, webview and webview-ncurses targets so source installs still get a terminal. A missing libvterm/compiler is non-fatal: lem-terminal/ffi.lisp already wraps use-foreign-library in ignore-errors and silently disables itself when the library is absent. - gitignore extensions/terminal/lib/**/*.so so locally-built helpers are never re-committed. - Convert .github/workflows/build-terminal-shared-object.yml from a workflow that recompiled and re-committed terminal.so on every push (which would reintroduce exactly the binaries this removes) into a verify-only CI check that builds terminal.so from source on Linux and macOS and fails if the build breaks. Refs #1964, #2060, #2182. * chore(terminal): exit explicitly and verify artifact in build script build-terminal.lisp dropped into the SBCL REPL after a successful build (exiting only on stdin EOF) and trusted the compiler's exit code without checking that terminal.so was actually written. - Quit 0 after a successful build so `sbcl --load` never blocks on stdin. - Delete any stale .so before compiling, then assert the artifact exists afterwards, so a compiler that exits 0 without producing the file is treated as a failure instead of a silent no-op. - Factor the failure path into build-failed (stderr + exit 1).
Open source software should, by definition, not be distributing binary files. Given the xz backdoor, these increase distrust.