Skip to content

Commit 2c77efc

Browse files
committed
Step 3
.agents/codebase-insights.txt: appimage-scripts/build_appimage2.sh: nix/packages/default.nix: Signed-off-by: Tzanko Matev <[email protected]>
1 parent 8b780df commit 2c77efc

File tree

3 files changed

+24
-18
lines changed

3 files changed

+24
-18
lines changed

.agents/codebase-insights.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
- `ct record` verifies that `codetracer_python_recorder` is importable before launching the db backend and prints actionable guidance if the module is missing or broken.
2525
- Sudoku test-program datasets include intentionally invalid boards (e.g., examples #3 and #6) with duplicate digits inside a sub-grid; solvers should detect and report these gracefully.
2626
- `appimage-scripts/build_appimage.sh` assumes a devshell: it invokes `nix build`/`nix eval` directly and runs `npm install`/`npx yarn`, so it needs host network access and the git worktree metadata that a pure derivation build lacks.
27-
- `appimage-scripts/build_appimage2.sh` relies on `packages.${system}.appimageDeps` producing an AppDir-like tree (bin/, lib/), letting the script populate dependencies with a single `cp`.
27+
- `appimage-scripts/build_appimage2.sh` relies on `packages.${system}.appimageDeps` producing an AppDir-like tree (bin/, lib/) with transitive libs resolved via `lddtree`, so a single `cp` seeds the AppDir.

appimage-scripts/build_appimage2.sh

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,6 @@ bash "${ROOT_PATH}/appimage-scripts/build_backend_manager.sh"
9393
# Ensure copied binaries are executable.
9494
chmod +x "${APP_DIR}/bin/"{cargo-stylus,ctags,curl,nargo,node,wazero}
9595

96-
# Collect transitive shared library dependencies from Nix store.
97-
# shellcheck disable=SC2046
98-
cp -n $(lddtree -l "${APP_DIR}/bin/ctags" | grep -v glibc | grep /nix) "${APP_DIR}/lib"
99-
100-
# shellcheck disable=SC2046
101-
cp -n $(lddtree -l "${APP_DIR}/bin/curl" | grep -v glibc | grep /nix) "${APP_DIR}/lib"
102-
103-
# shellcheck disable=SC2046
104-
cp -n $(lddtree -l "${APP_DIR}/bin/node" | grep -v glibc | grep /nix) "${APP_DIR}/lib"
105-
106-
# shellcheck disable=SC2046
107-
cp -n $(lddtree -l "${APP_DIR}/bin/cargo-stylus" | grep -v glibc | grep /nix) "${APP_DIR}/lib"
108-
10996
chmod -R +x "${APP_DIR}/bin"
11097
chmod -R +x "${APP_DIR}/electron"
11198

nix/packages/default.nix

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@
131131
nativeBuildInputs = [
132132
pkgs.bashInteractive
133133
pkgs.coreutils
134+
pkgs.findutils
135+
pkgs.gnugrep
136+
pkgs.pax-utils
134137
];
135138
} ''
136139
set -euo pipefail
@@ -139,10 +142,8 @@
139142
mkdir -p "$out/bin" "$out/lib"
140143
141144
copy_libs() {
142-
for pattern in "$@"; do
143-
for lib in $pattern; do
144-
cp -L "$lib" "$out/lib/"
145-
done
145+
for lib in "$@"; do
146+
cp -n -L "$lib" "$out/lib/" || true
146147
done
147148
}
148149
@@ -169,6 +170,24 @@
169170
${pkgs.curl}/bin/curl \
170171
${pkgs.nodejs_20}/bin/node
171172
173+
collect_transitive_libs() {
174+
local binary
175+
for binary in "$@"; do
176+
lddtree -l "$binary" | grep /nix | grep -v glibc | while read -r dep; do
177+
[ -f "$dep" ] || continue
178+
cp -n -L "$dep" "$out/lib/" || true
179+
done
180+
done
181+
}
182+
183+
collect_transitive_libs \
184+
${cargo-stylus}/bin/cargo-stylus \
185+
${wazero}/bin/wazero \
186+
${noir}/bin/nargo \
187+
${pkgs.universal-ctags}/bin/ctags \
188+
${pkgs.curl}/bin/curl \
189+
${pkgs.nodejs_20}/bin/node
190+
172191
chmod +x "$out/bin"/*
173192
'';
174193

0 commit comments

Comments
 (0)