Skip to content

Commit 415949a

Browse files
committed
Step 9
.agents/codebase-insights.txt: appimage-scripts/build_appimage2.sh: nix/packages/default.nix: Signed-off-by: Tzanko Matev <[email protected]>
1 parent 52a7063 commit 415949a

File tree

3 files changed

+12
-25
lines changed

3 files changed

+12
-25
lines changed

.agents/codebase-insights.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@
2929
- Stylus-based frontend stylesheets now come from the `packages.${system}.appimageCss` derivation; `build_css.sh` simply copies that output, and `appimagePayload` pulls the same artifacts, so the AppDir no longer depends on ad-hoc `node_modules` during assembly.
3030
- `appimagePayload` now stages the launch scripts (`bin/ct`, `bin/ruby`, `AppRun`), config/resources, and the Ruby recorder submodule directly; `build_appimage2.sh` just handles impure steps (installing Ruby/Electron, copying `node_modules`, updating `frontend_bundle.js`, and calling `appimagetool`).
3131
- Third-party frontend assets that were previously symlinks into `node_modules` (`@exuanbo`, `golden-layout/dist`, `monaco-editor/min`, `mousetrap`, `vex-js`, `xterm`) are now materialized from `node-modules-derivation` inside `appimagePayload`, preventing broken symlinks when the payload is copied out of the Nix store.
32+
- Ruby 3.3 comes from `appimageDeps` (via `pkgs.ruby_3_3`) and is patched inside the derivation, so the AppDir no longer copies Ruby from the devshell during the AppImage build.

appimage-scripts/build_appimage2.sh

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,6 @@ cp -Lr "${APPIMAGE_PAYLOAD}/." "${APP_DIR}/"
4949

5050
chmod -R u+rwX "${APP_DIR}"
5151

52-
# Install Ruby
53-
bash "${ROOT_PATH}/appimage-scripts/install_ruby.sh"
54-
5552
# Copy over electron
5653
# bash "${ROOT_PATH}/appimage-scripts/install_electron_nix.sh"
5754
bash "${ROOT_PATH}/appimage-scripts/install_electron.sh"
@@ -67,39 +64,19 @@ cp -Lr "${ROOT_PATH}/src/public/dist/frontend_bundle.js" "${APP_DIR}/frontend_bu
6764

6865
chmod -R +x "${APP_DIR}/electron"
6966

70-
echo "============================"
71-
echo "AppImage patchelf"
72-
echo "============================"
73-
7467
CURRENT_ARCH=$(uname -m)
7568
if [[ "${CURRENT_ARCH}" == "aarch64" ]]; then
7669
INTERPRETER_PATH=/lib/ld-linux-aarch64.so.1
7770
else
7871
INTERPRETER_PATH=/lib64/ld-linux-x86-64.so.2
7972
fi
8073

81-
82-
chmod -R u+w ${APP_DIR}
83-
# Patchelf the executable's interpreter for locally built components
84-
# Nim binaries have already been patched in appimagePayload; only patch the
85-
# Ruby interpreter that we copy in impurely here.
86-
patchelf --set-interpreter "${INTERPRETER_PATH}" "${APP_DIR}/ruby/bin/ruby"
87-
88-
# Clear up the executable's rpath
89-
patchelf --remove-rpath "${APP_DIR}/ruby/bin/ruby"
90-
91-
patchelf --set-rpath "\$ORIGIN/../lib" "${APP_DIR}/ruby/bin/ruby"
92-
9374
APPIMAGE_ARCH=${CURRENT_ARCH}
9475
if [[ "${APPIMAGE_ARCH}" == "aarch64" ]]; then
9576
# The appimagetool has its own convention for specifying the ARM64 arch.
9677
APPIMAGE_ARCH=arm_aarch64
9778
fi
9879

99-
echo "============================"
100-
echo "AppImagetool"
101-
echo "============================"
102-
10380
# Use AppImage tool to create AppImage itself
10481
ARCH=${APPIMAGE_ARCH} appimagetool "${APP_DIR}" CodeTracer.AppImage
10582

nix/packages/default.nix

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
inherit (pkgs) stdenv;
1111

1212
src = ../../.;
13+
14+
rubyPkg = pkgs.ruby_3_3;
1315
in
1416
{
1517
packages = rec {
@@ -141,7 +143,10 @@
141143
set -euo pipefail
142144
shopt -s nullglob
143145
144-
mkdir -p "$out/bin" "$out/lib"
146+
mkdir -p "$out/bin" "$out/lib" "$out/ruby"
147+
148+
cp -R ${rubyPkg}/. "$out/ruby"
149+
chmod -R u+w "$out/ruby"
145150
146151
copy_libs() {
147152
for lib in "$@"; do
@@ -188,7 +193,8 @@
188193
${noir}/bin/nargo \
189194
${pkgs.universal-ctags}/bin/ctags \
190195
${pkgs.curl}/bin/curl \
191-
${pkgs.nodejs_20}/bin/node
196+
${pkgs.nodejs_20}/bin/node \
197+
${rubyPkg}/bin/ruby
192198
193199
chmod +x "$out/bin"/*
194200
@@ -211,6 +217,8 @@
211217
[ -f "$bin" ] || continue
212218
patch_binary "$bin" || true
213219
done
220+
221+
patch_binary "$out/ruby/bin/ruby" || true
214222
'';
215223

216224
nimBuildInputs = [
@@ -555,6 +563,7 @@ EOF
555563
556564
patch_binary "$out/bin/ct_unwrapped" || true
557565
patch_binary "$out/bin/db-backend-record" || true
566+
patch_binary "$out/ruby/bin/ruby" || true
558567
'';
559568

560569
indexJavascript = stdenv.mkDerivation {

0 commit comments

Comments
 (0)