galaaz 2.1.10.pre.7 → 2.1.10.pre.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: da2cad42b34d1068661e204caaa43efea89bda6e81ca2e4dda99c07f75f2ea22
4
- data.tar.gz: c6d3a26d4439d89c45187192d6ff75ce285664a9f134ce947d4eeb11494eaaf6
3
+ metadata.gz: 581406d58b67e2d86faf8bf90147b41b2e007717c616ec6729c1564bdfdb2a05
4
+ data.tar.gz: 28bf5eaf5a53824f952efa110850f419f10906ab8b82d1f976c095b9b8e4b648
5
5
  SHA512:
6
- metadata.gz: fc202447c62b7636446195299178b165933ed490f1f71f55b09e7528aa528697051b73b47d7e7b40084c337eb772b6263242723a8048e77ca3c95856db0e6098
7
- data.tar.gz: 15452e1e64b207e1b5e85cd41495e42974a76da11266e7467b2ed75de1455c0869322c067ce381b502d86dfb18699fc7e285b1507c20822a8e6752d1e8f2a51a
6
+ metadata.gz: 8426a17da8b08bbf5615b5c4c770fdd1d82f4fb9a91efd74940ed89ee14d89fad37827ca4fe3d008ab4359c95ab8fc362b05b478c8818e67697df0554c49e7f0
7
+ data.tar.gz: 243175fd0307965e82c5ad6d2fbb9462319f1f1e9ed36171dce80cb4952ae2cc509d6d7beeb8af9922e48b50147c8496373a1ed4d5d7fb1ca3441983604beea0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.1.10.pre.9
6
+
7
+ ### Fixed
8
+
9
+ - Omarchy Arrow Stage B: slim arrow-glib build (hide flight/dataset/parquet from
10
+ pkg-config) to avoid TUI OOM; traced install log; doctor reports arrow C++ /
11
+ arrow-glib / R arrow / red-arrow; do not mark `profiles/arrow` until Stage B
12
+ succeeds; menu **Arrow debug** helper; persist `GI_TYPELIB_PATH` /
13
+ `LD_LIBRARY_PATH` in `~/.config/galaaz/arrow-env.sh` so `require "arrow"` works
14
+ without manual exports.
15
+
16
+ ## 2.1.10.pre.8
17
+
18
+ ### Fixed
19
+
20
+ - Omarchy `galaaz-add` arrow: on pacman mirror 404s (stale DB), refresh with
21
+ `pacman -Sy` and retry install before failing.
22
+ - Omarchy arrow-glib build: auto-install `glib2-devel` + `cmake` (and other
23
+ build deps) via the add wrapper — no manual `pacman`; default `-j1`, add
24
+ build swap when RAM is low, compile in a systemd user scope with heartbeats
25
+ so OOM kills the build instead of the TUI. Stage B (red-arrow) stays on the
26
+ menu Arrow / ledger / demo path.
27
+
5
28
  ## 2.1.10.pre.7
6
29
 
7
30
  ### Added
@@ -7,7 +7,23 @@
7
7
  #
8
8
  # JRuby and CRuby are both first-class. Override with GALAAZ_RUBY=jruby, GALAAZ_RUBY=ruby,
9
9
  # or a full path. Extra JRuby flags: GALAAZ_JRUBY_OPTS="-J-Xmx4g" (ignored on CRuby).
10
- # CRuby red-arrow uses system Arrow GLib (Apache Arrow APT / libarrow-glib-dev).
10
+ # CRuby red-arrow uses system Arrow GLib (Apache Arrow APT / libarrow-glib-dev,
11
+ # or Omarchy build into /usr/local). Typelibs under /usr/local need GI_TYPELIB_PATH.
12
+ if [[ -f "${HOME}/.config/galaaz/arrow-env.sh" ]]; then
13
+ # shellcheck disable=SC1090
14
+ source "${HOME}/.config/galaaz/arrow-env.sh"
15
+ else
16
+ if [[ -d /usr/local/lib/girepository-1.0 ]]; then
17
+ export GI_TYPELIB_PATH="/usr/local/lib/girepository-1.0${GI_TYPELIB_PATH:+:${GI_TYPELIB_PATH}}"
18
+ fi
19
+ if [[ -d /usr/local/lib ]]; then
20
+ export LD_LIBRARY_PATH="/usr/local/lib${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
21
+ fi
22
+ if [[ -d /usr/local/lib64 ]]; then
23
+ export LD_LIBRARY_PATH="/usr/local/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
24
+ fi
25
+ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
26
+ fi
11
27
 
12
28
  GALAAZ_RUBY_BIN="${GALAAZ_RUBY:-ruby}"
13
29
 
@@ -44,6 +44,7 @@ module Galaaz
44
44
  def load!
45
45
  return if defined?(@loaded) && @loaded
46
46
 
47
+ ensure_arrow_glib_runtime_env!
47
48
  begin
48
49
  require 'arrow'
49
50
  rescue LoadError
@@ -60,6 +61,29 @@ module Galaaz
60
61
  end
61
62
  private_class_method :load!
62
63
 
64
+ # Omarchy / --prefix=/usr/local installs put typelibs and .so under /usr/local,
65
+ # which gobject-introspection and the dynamic linker do not search by default.
66
+ def ensure_arrow_glib_runtime_env!
67
+ gir = '/usr/local/lib/girepository-1.0'
68
+ if File.directory?(gir)
69
+ cur = ENV['GI_TYPELIB_PATH'].to_s.split(File::PATH_SEPARATOR)
70
+ ENV['GI_TYPELIB_PATH'] = ([gir] + cur).uniq.join(File::PATH_SEPARATOR)
71
+ end
72
+ %w[/usr/local/lib /usr/local/lib64].each do |lib|
73
+ next unless File.directory?(lib)
74
+
75
+ cur = ENV['LD_LIBRARY_PATH'].to_s.split(File::PATH_SEPARATOR)
76
+ ENV['LD_LIBRARY_PATH'] = ([lib] + cur).uniq.join(File::PATH_SEPARATOR)
77
+ end
78
+ %w[/usr/local/lib/pkgconfig /usr/local/lib64/pkgconfig].each do |pc|
79
+ next unless File.directory?(pc)
80
+
81
+ cur = ENV['PKG_CONFIG_PATH'].to_s.split(File::PATH_SEPARATOR)
82
+ ENV['PKG_CONFIG_PATH'] = ([pc] + cur).uniq.join(File::PATH_SEPARATOR)
83
+ end
84
+ end
85
+ private_class_method :ensure_arrow_glib_runtime_env!
86
+
63
87
  # bundle exec only exposes Gemfile gems; red-arrow is optional and often
64
88
  # user-installed. Put its lib + native extension on $LOAD_PATH.
65
89
  def prepend_user_red_arrow_load_path!
data/lib/galaaz/cli.rb CHANGED
@@ -27,6 +27,7 @@ module Galaaz
27
27
  ['galaaz-add.sh', 'omarchy-galaaz-add', true],
28
28
  ['galaaz-guide.sh', 'omarchy-galaaz-guide', true],
29
29
  ['galaaz-gknit.sh', 'omarchy-galaaz-gknit', true],
30
+ ['galaaz-arrow-debug.sh', 'omarchy-galaaz-arrow-debug', true],
30
31
  ['debug-galaaz.sh', 'omarchy-galaaz-debug', true]
31
32
  ].freeze
32
33
  # Installed under ~/.local/share/nautilus/scripts/Galaaz/ (Scripts → Galaaz).
@@ -477,6 +478,8 @@ module Galaaz
477
478
  profiles = listed_profiles
478
479
  puts " profiles: #{profiles.empty? ? '(none)' : profiles.join(', ')}"
479
480
 
481
+ print_arrow_doctor_lines
482
+
480
483
  pdf = command_present?('pdflatex')
481
484
  puts " pdflatex: #{pdf ? `pdflatex --version 2>/dev/null`.lines.first.to_s.strip : 'MISSING (galaaz add tex)'}"
482
485
 
@@ -485,6 +488,37 @@ module Galaaz
485
488
  setup_ok ? 0 : 1
486
489
  end
487
490
 
491
+ def print_arrow_doctor_lines
492
+ ENV['PKG_CONFIG_PATH'] = [
493
+ '/usr/local/lib/pkgconfig',
494
+ '/usr/local/lib64/pkgconfig',
495
+ ENV['PKG_CONFIG_PATH']
496
+ ].compact.reject(&:empty?).join(File::PATH_SEPARATOR)
497
+
498
+ arrow_cpp = system('pkg-config', '--exists', 'arrow')
499
+ arrow_cpp_ver = arrow_cpp ? `pkg-config --modversion arrow 2>/dev/null`.strip : nil
500
+ arrow_glib = system('pkg-config', '--exists', 'arrow-glib')
501
+ arrow_glib_ver = arrow_glib ? `pkg-config --modversion arrow-glib 2>/dev/null`.strip : nil
502
+ r_arrow = command_present?('Rscript') && r_namespace?('arrow')
503
+ red =
504
+ begin
505
+ Gem::Specification.find_by_name('red-arrow')
506
+ true
507
+ rescue LoadError, Gem::LoadError
508
+ false
509
+ end
510
+
511
+ puts " arrow C++: #{arrow_cpp ? "OK (#{arrow_cpp_ver})" : 'MISSING (Omarchy: menu Arrow installs Arch arrow)'}"
512
+ puts " arrow-glib: #{arrow_glib ? "OK (#{arrow_glib_ver})" : 'MISSING (needed for Stage B / red-arrow)'}"
513
+ puts " R arrow: #{r_arrow ? 'OK' : 'MISSING (Stage A)'}"
514
+ puts " red-arrow: #{red ? 'OK' : 'MISSING (Stage B CRuby writer)'}"
515
+ if listed_profiles.include?('arrow') && !(arrow_glib && (RUBY_ENGINE != 'ruby' || red))
516
+ puts ' arrow tip: profiles/arrow is set but Stage B incomplete — menu Arrow is disabled.'
517
+ puts ' rm ~/.config/galaaz/profiles/arrow then re-run menu Arrow,'
518
+ puts ' or: omarchy-galaaz-arrow-debug status'
519
+ end
520
+ end
521
+
488
522
  def print_ruby_engines
489
523
  puts " this: #{RUBY_DESCRIPTION}"
490
524
  puts " engine: #{RUBY_ENGINE} (interpreter running doctor)"
@@ -647,9 +681,38 @@ module Galaaz
647
681
  pkgs = read_pkg_list('arrow.txt')
648
682
  install_cran!(pkgs)
649
683
  if RUBY_ENGINE == 'ruby'
650
- puts 'galaaz add arrow: gem install red-arrow (CRuby Stage B writer)'
651
- unless system('gem', 'install', 'red-arrow', '--no-document')
652
- warn 'galaaz add arrow: red-arrow gem install failed (need Apache Arrow GLib / libarrow-glib). R arrow is installed; Ruby IPC writer may be unavailable.'
684
+ ENV['GI_TYPELIB_PATH'] = [
685
+ '/usr/local/lib/girepository-1.0',
686
+ ENV['GI_TYPELIB_PATH']
687
+ ].compact.reject(&:empty?).join(File::PATH_SEPARATOR)
688
+ ENV['LD_LIBRARY_PATH'] = [
689
+ '/usr/local/lib',
690
+ '/usr/local/lib64',
691
+ ENV['LD_LIBRARY_PATH']
692
+ ].compact.reject(&:empty?).join(File::PATH_SEPARATOR)
693
+ ENV['PKG_CONFIG_PATH'] = [
694
+ '/usr/local/lib/pkgconfig',
695
+ '/usr/local/lib64/pkgconfig',
696
+ '/usr/lib/pkgconfig',
697
+ ENV['PKG_CONFIG_PATH']
698
+ ].compact.reject(&:empty?).join(File::PATH_SEPARATOR)
699
+ glib_ok = system('pkg-config', '--exists', 'arrow-glib')
700
+ if glib_ok
701
+ puts 'galaaz add arrow: gem install red-arrow (CRuby Stage B writer; MAKEFLAGS=-j1)'
702
+ ok = system({ 'MAKEFLAGS' => '-j1', 'PKG_CONFIG_PATH' => ENV['PKG_CONFIG_PATH'] },
703
+ 'gem', 'install', 'red-arrow', '--no-document')
704
+ unless ok
705
+ warn 'galaaz add arrow: red-arrow gem install failed. R arrow is installed; ' \
706
+ 'Ruby IPC writer may be unavailable.'
707
+ warn 'galaaz add arrow: profile NOT marked — fix Stage B then re-run ' \
708
+ '(omarchy-galaaz-arrow-debug status)'
709
+ return 1
710
+ end
711
+ else
712
+ warn 'galaaz add arrow: arrow-glib not found (pkg-config); skipping red-arrow. ' \
713
+ 'On Omarchy use omarchy-galaaz-add arrow so Stage B GLib is built first.'
714
+ warn 'galaaz add arrow: profile NOT marked (Stage B incomplete)'
715
+ return 1
653
716
  end
654
717
  else
655
718
  warn 'galaaz add arrow: on JRuby, set GALAAZ_ARROW_JARS (or ~/arrow_jars) and JAVA_OPTS nio opens for Arrow Java'
@@ -119,24 +119,82 @@ pkg_add() {
119
119
  fi
120
120
  }
121
121
 
122
- # red-arrow needs pkg-config "arrow" + "arrow-glib" at the same version.
123
- # Arch ships C++ Arrow (extra/arrow) but not Arrow GLib build GLib from the
124
- # matching Apache tarball. Keep ARROW_USE_PKG_CONFIG=false for CRAN R arrow
125
- # (LIBARROW_BINARY); pacman arrow is only for the Ruby gem.
122
+ # Stale pacman DBs request old pkg builds that mirrors already deleted (HTTP 404).
123
+ # Sync once, then install. Prefer this for heavy deps like arrow.
124
+ pkg_add_synced() {
125
+ if pkg_add "$@"; then
126
+ return 0
127
+ fi
128
+ echo "WARN: install failed for: $* — refreshing pacman DBs and retrying (common with mirror 404s)" >&2
129
+ if ! command -v pacman >/dev/null 2>&1; then
130
+ return 1
131
+ fi
132
+ if ! sudo pacman -Sy --noconfirm; then
133
+ echo "ERROR: pacman -Sy failed. On Omarchy run Update → Omarchy, then retry." >&2
134
+ return 1
135
+ fi
136
+ # Bypass omarchy-pkg-add here so we use the freshly synced DB.
137
+ if ! sudo pacman -S --noconfirm --needed "$@"; then
138
+ echo "ERROR: still failed to install: $*" >&2
139
+ echo " On Omarchy: Super+Space → Update → Omarchy, then re-run this add-on." >&2
140
+ return 1
141
+ fi
142
+ return 0
143
+ }
144
+
145
+ # Persist runtime env for red-arrow (typelibs + .so under /usr/local).
146
+ write_arrow_runtime_env() {
147
+ local dest="${HOME}/.config/galaaz/arrow-env.sh"
148
+ mkdir -p "$(dirname "${dest}")"
149
+ cat >"${dest}" <<'EOF'
150
+ # Generated by omarchy-galaaz-add arrow — red-arrow / GObject Introspection
151
+ export GI_TYPELIB_PATH="/usr/local/lib/girepository-1.0${GI_TYPELIB_PATH:+:${GI_TYPELIB_PATH}}"
152
+ export LD_LIBRARY_PATH="/usr/local/lib:/usr/local/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}"
153
+ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
154
+ EOF
155
+ # shellcheck disable=SC1090
156
+ source "${dest}"
157
+ echo "arrow runtime env: ${dest}"
158
+ }
159
+
160
+ # red-arrow (Stage B) needs pkg-config "arrow" + "arrow-glib" at the same version.
161
+ # Arch ships C++ Arrow but not Arrow GLib. We build only c_glib from the Apache
162
+ # tarball against pacman arrow — with a *slim* PKG_CONFIG_PATH so meson does not
163
+ # also link flight/dataset/parquet (those explode RAM on TryOmarchy and kill the TUI).
126
164
  ensure_arrow_for_red_arrow() {
127
- local major ver tmp tarball url build_dir
165
+ local major ver tmp tarball url build_dir jobs cache log swapfile avail_mb swap_mb
166
+ local compile_st=0 pc_slim pc_src free_kb need_kb
167
+ local trace_log="${HOME}/.local/share/galaaz/arrow-install-trace.log"
128
168
  major=25
169
+ jobs="${GALAAZ_ARROW_GLIB_JOBS:-1}"
170
+ cache="${HOME}/.cache/galaaz"
171
+ log="${HOME}/.local/share/galaaz/arrow-glib-build.log"
172
+ swapfile="${cache}/arrow-glib.swap"
173
+ pc_slim="${cache}/pkgconfig-slim"
174
+ mkdir -p "${cache}" "$(dirname "${log}")" "$(dirname "${trace_log}")"
175
+
176
+ atracel() {
177
+ echo "[$(date -Iseconds)] $*" | tee -a "${trace_log}"
178
+ sync 2>/dev/null || true
179
+ }
180
+
181
+ : >"${trace_log}"
182
+ atracel "ensure_arrow_for_red_arrow start"
183
+ echo "==> system: Apache Arrow C++ + GLib (Stage B / red-arrow)"
184
+ echo " build log: ${log}"
185
+ echo " trace log: ${trace_log}"
129
186
 
130
- echo "==> system: Apache Arrow C++ + GLib (for red-arrow)"
131
187
  export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
132
188
 
133
189
  if ! command -v pkg-config >/dev/null 2>&1; then
134
- pkg_add pkgconf || return 1
190
+ atracel "install pkgconf"
191
+ pkg_add_synced pkgconf || return 1
135
192
  fi
136
193
 
137
194
  if ! pkg-config --exists "arrow >= ${major}" 2>/dev/null; then
195
+ atracel "install Arch package arrow"
138
196
  echo "==> install Arch package: arrow"
139
- if ! pkg_add arrow; then
197
+ if ! pkg_add_synced arrow; then
140
198
  echo "ERROR: failed to install Arch arrow (Apache Arrow C++)" >&2
141
199
  return 1
142
200
  fi
@@ -144,69 +202,161 @@ ensure_arrow_for_red_arrow() {
144
202
 
145
203
  if ! pkg-config --exists "arrow >= ${major}" 2>/dev/null; then
146
204
  echo "ERROR: Apache Arrow C++ >= ${major} still missing after pacman install" >&2
147
- echo " pkg-config --modversion arrow: $(pkg-config --modversion arrow 2>/dev/null || echo none)" >&2
148
205
  return 1
149
206
  fi
150
207
  ver="$(pkg-config --modversion arrow)"
208
+ atracel "arrow C++ ${ver}"
151
209
  echo "arrow (C++): ${ver}"
152
210
 
153
- if pkg-config --exists "arrow-glib = ${ver}" 2>/dev/null; then
211
+ if pkg-config --exists "arrow-glib = ${ver}" 2>/dev/null || pkg-config --exists arrow-glib 2>/dev/null; then
212
+ atracel "arrow-glib already present $(pkg-config --modversion arrow-glib)"
154
213
  echo "arrow-glib: $(pkg-config --modversion arrow-glib) (already installed)"
214
+ write_arrow_runtime_env
155
215
  return 0
156
216
  fi
157
217
 
158
- echo "==> Arrow GLib ${ver} missing — building from Apache source (Arch has no matching package)"
159
- pkg_add meson ninja gobject-introspection glib2 || return 1
218
+ atracel "arrow-glib missing — slim source build"
219
+ echo "==> Arrow GLib ${ver} missing building slim c_glib from Apache source"
220
+ echo " (flight/dataset/parquet disabled via slim pkg-config to avoid OOM)"
221
+ pkg_add_synced meson ninja gobject-introspection glib2 glib2-devel cmake || return 1
222
+
223
+ # Slim pkg-config: only core Arrow modules + GLib (hide flight/dataset/parquet/…).
224
+ rm -rf "${pc_slim}"
225
+ mkdir -p "${pc_slim}"
226
+ for mod in arrow arrow-compute arrow-csv arrow-json arrow-filesystem \
227
+ glib-2.0 gobject-2.0 gio-2.0 gmodule-2.0 gthread-2.0 libffi zlib; do
228
+ pc_src="$(pkg-config --variable=pcfiledir "${mod}" 2>/dev/null || true)"
229
+ if [[ -n "${pc_src}" && -f "${pc_src}/${mod}.pc" ]]; then
230
+ cp "${pc_src}/${mod}.pc" "${pc_slim}/"
231
+ atracel "pc slim: ${mod}"
232
+ fi
233
+ done
234
+ export PKG_CONFIG_PATH="${pc_slim}:/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig"
235
+ atracel "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
236
+
237
+ avail_mb="$(awk '/MemAvailable:/ {print int($2/1024)}' /proc/meminfo 2>/dev/null || echo 0)"
238
+ swap_mb="$(awk '/SwapFree:/ {print int($2/1024)}' /proc/meminfo 2>/dev/null || echo 0)"
239
+ atracel "memory MemAvailable=${avail_mb}MiB SwapFree=${swap_mb}MiB"
240
+ echo " memory: MemAvailable=${avail_mb}MiB SwapFree=${swap_mb}MiB"
241
+ if (( avail_mb + swap_mb < 3000 )); then
242
+ free_kb="$(df -Pk "${cache}" | awk 'NR==2{print $4}')"
243
+ need_kb=$((2200 * 1024))
244
+ if [[ -n "${free_kb}" ]] && (( free_kb < need_kb )); then
245
+ echo "ERROR: need ~2.2GiB free disk under ${cache} for build swap (have $((free_kb/1024))MiB)" >&2
246
+ atracel "ABORT disk free ${free_kb}KB"
247
+ return 1
248
+ fi
249
+ echo "==> low RAM — enabling 2GiB build swap at ${swapfile}"
250
+ atracel "create/enable swap ${swapfile}"
251
+ if [[ ! -f "${swapfile}" ]]; then
252
+ if command -v fallocate >/dev/null 2>&1; then
253
+ fallocate -l 2G "${swapfile}" || dd if=/dev/zero of="${swapfile}" bs=1M count=2048 status=none
254
+ else
255
+ dd if=/dev/zero of="${swapfile}" bs=1M count=2048 status=none
256
+ fi
257
+ chmod 600 "${swapfile}"
258
+ mkswap "${swapfile}" >/dev/null
259
+ fi
260
+ sudo swapon "${swapfile}" || {
261
+ echo "ERROR: swapon failed" >&2
262
+ return 1
263
+ }
264
+ fi
160
265
 
161
266
  tarball="apache-arrow-${ver}.tar.gz"
162
267
  url="https://dlcdn.apache.org/arrow/arrow-${ver}/${tarball}"
163
- tmp="$(mktemp -d)"
268
+ tmp="${cache}/arrow-${ver}-src"
269
+ rm -rf "${tmp}"
270
+ mkdir -p "${tmp}"
164
271
  build_dir="${tmp}/apache-arrow-${ver}"
272
+ : >"${log}"
273
+ atracel "download ${url}"
165
274
  echo "==> download: ${url}"
166
275
  if ! curl -fsSL -o "${tmp}/${tarball}" "${url}"; then
167
276
  url="https://archive.apache.org/dist/arrow/arrow-${ver}/${tarball}"
277
+ atracel "fallback ${url}"
168
278
  echo "==> fallback: ${url}"
169
279
  if ! curl -fsSL -o "${tmp}/${tarball}" "${url}"; then
170
280
  echo "ERROR: failed to download Apache Arrow ${ver} sources" >&2
171
- rm -rf "${tmp}"
281
+ sudo swapoff "${swapfile}" 2>/dev/null || true
172
282
  return 1
173
283
  fi
174
284
  fi
175
- tar -xzf "${tmp}/${tarball}" -C "${tmp}"
176
- if [[ ! -d "${build_dir}/c_glib" ]]; then
177
- echo "ERROR: c_glib missing from ${tarball}" >&2
178
- rm -rf "${tmp}"
285
+ atracel "extract ${tarball}"
286
+ tar -xzf "${tmp}/${tarball}" -C "${tmp}" || {
287
+ sudo swapoff "${swapfile}" 2>/dev/null || true
179
288
  return 1
180
- fi
289
+ }
290
+ [[ -d "${build_dir}/c_glib" ]] || {
291
+ echo "ERROR: c_glib missing" >&2
292
+ sudo swapoff "${swapfile}" 2>/dev/null || true
293
+ return 1
294
+ }
181
295
 
182
- echo "==> meson setup / compile / install arrow-glib ${ver}"
296
+ atracel "meson setup"
297
+ echo "==> meson setup arrow-glib ${ver} (slim)"
183
298
  if ! meson setup "${build_dir}/c_glib.build" "${build_dir}/c_glib" \
184
299
  --buildtype=release \
185
300
  --prefix=/usr/local \
186
- -Dgtk_doc=false; then
187
- echo "ERROR: meson setup for arrow-glib failed" >&2
188
- rm -rf "${tmp}"
301
+ -Dgtk_doc=false \
302
+ -Ddoc=false \
303
+ -Dvapi=false >>"${log}" 2>&1; then
304
+ echo "ERROR: meson setup failed — see ${log}" >&2
305
+ tail -n 40 "${log}" || true
306
+ sudo swapoff "${swapfile}" 2>/dev/null || true
189
307
  return 1
190
308
  fi
191
- if ! meson compile -C "${build_dir}/c_glib.build"; then
192
- echo "ERROR: meson compile for arrow-glib failed" >&2
193
- rm -rf "${tmp}"
309
+
310
+ atracel "meson compile -j${jobs} begin"
311
+ echo "==> meson compile arrow-glib ${ver} (-j${jobs}) — leave window open"
312
+ set +e
313
+ meson compile -C "${build_dir}/c_glib.build" -j "${jobs}" >>"${log}" 2>&1 &
314
+ local compile_pid=$!
315
+ while kill -0 "${compile_pid}" 2>/dev/null; do
316
+ echo " … compiling arrow-glib ($(date +%H:%M:%S)) log: ${log}"
317
+ atracel "heartbeat compile pid=${compile_pid}"
318
+ sleep 15
319
+ done
320
+ wait "${compile_pid}"
321
+ compile_st=$?
322
+ set -e
323
+ atracel "meson compile exit ${compile_st}"
324
+
325
+ if [[ "${compile_st}" -ne 0 ]]; then
326
+ echo "ERROR: meson compile failed (exit ${compile_st})" >&2
327
+ tail -n 60 "${log}" || true
328
+ dmesg -T 2>/dev/null | grep -iE 'oom|killed process' | tail -5 || true
329
+ sudo swapoff "${swapfile}" 2>/dev/null || true
194
330
  return 1
195
331
  fi
196
- if ! sudo meson install -C "${build_dir}/c_glib.build"; then
197
- echo "ERROR: meson install for arrow-glib failed" >&2
198
- rm -rf "${tmp}"
332
+
333
+ atracel "meson install"
334
+ echo "==> meson install arrow-glib ${ver}"
335
+ if ! sudo meson install -C "${build_dir}/c_glib.build" >>"${log}" 2>&1; then
336
+ echo "ERROR: meson install failed — see ${log}" >&2
337
+ sudo swapoff "${swapfile}" 2>/dev/null || true
199
338
  return 1
200
339
  fi
201
340
  sudo ldconfig 2>/dev/null || true
341
+ sudo swapoff "${swapfile}" 2>/dev/null || true
202
342
  rm -rf "${tmp}"
203
343
 
344
+ # Restore normal pkg-config path so arrow-glib in /usr/local is visible.
345
+ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
204
346
  if ! pkg-config --exists "arrow-glib = ${ver}" 2>/dev/null; then
205
- echo "ERROR: arrow-glib ${ver} still missing after build" >&2
206
- echo " pkg-config --modversion arrow-glib: $(pkg-config --modversion arrow-glib 2>/dev/null || echo none)" >&2
347
+ # arrow-glib.pc may only need to exist; version equality with slim build
348
+ if pkg-config --exists arrow-glib 2>/dev/null; then
349
+ atracel "arrow-glib present $(pkg-config --modversion arrow-glib)"
350
+ echo "arrow-glib: $(pkg-config --modversion arrow-glib)"
351
+ return 0
352
+ fi
353
+ echo "ERROR: arrow-glib still missing after install" >&2
354
+ atracel "ABORT arrow-glib missing"
207
355
  return 1
208
356
  fi
209
- echo "arrow-glib: $(pkg-config --modversion arrow-glib) (built from Apache ${ver})"
357
+ atracel "OK arrow-glib $(pkg-config --modversion arrow-glib)"
358
+ echo "arrow-glib: $(pkg-config --modversion arrow-glib) (slim build from Apache ${ver})"
359
+ write_arrow_runtime_env
210
360
  return 0
211
361
  }
212
362
 
@@ -0,0 +1,215 @@
1
+ #!/bin/bash
2
+ # Stepwise Arrow/Stage-B diagnostics for Omarchy.
3
+ # Does NOT install by default — prints where things stand and what would run.
4
+ #
5
+ # Usage:
6
+ # omarchy-galaaz-arrow-debug # status (safe)
7
+ # omarchy-galaaz-arrow-debug status
8
+ # omarchy-galaaz-arrow-debug probe # light checks + write report
9
+ # omarchy-galaaz-arrow-debug last-log # show build log tails + dmesg OOM
10
+ # omarchy-galaaz-arrow-debug install # run omarchy-galaaz-add arrow with tracing
11
+ #
12
+ # Report: ~/.local/share/galaaz/arrow-debug.log
13
+ set -uo pipefail
14
+
15
+ LOG_DIR="${HOME}/.local/share/galaaz"
16
+ REPORT="${LOG_DIR}/arrow-debug.log"
17
+ BUILD_LOG="${LOG_DIR}/arrow-glib-build.log"
18
+ TRACE="${LOG_DIR}/arrow-install-trace.log"
19
+ mkdir -p "${LOG_DIR}"
20
+
21
+ export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
22
+ export PATH="${HOME}/.local/bin:${PATH}"
23
+
24
+ CMD="${1:-status}"
25
+
26
+ trace() {
27
+ # shellcheck disable=SC3037
28
+ echo -e "[$(date -Iseconds)] $*" | tee -a "${REPORT}"
29
+ sync 2>/dev/null || true
30
+ }
31
+
32
+ section() {
33
+ echo | tee -a "${REPORT}"
34
+ trace "======== $* ========"
35
+ }
36
+
37
+ have() { command -v "$1" >/dev/null 2>&1; }
38
+
39
+ run_status() {
40
+ : >"${REPORT}"
41
+ section "galaaz arrow debug (status)"
42
+ trace "host: $(uname -a 2>/dev/null || true)"
43
+ trace "user: $(id -un) home=${HOME}"
44
+ trace "PATH=${PATH}"
45
+
46
+ section "memory / disk"
47
+ if [[ -r /proc/meminfo ]]; then
48
+ awk '/MemTotal:|MemAvailable:|SwapTotal:|SwapFree:/ {printf " %s\n", $0}' /proc/meminfo | tee -a "${REPORT}"
49
+ fi
50
+ df -h "${HOME}" /tmp /usr/local 2>/dev/null | tee -a "${REPORT}" || true
51
+ free -h 2>/dev/null | tee -a "${REPORT}" || true
52
+
53
+ section "tools"
54
+ for c in pacman omarchy-pkg-add pkg-config meson ninja cmake curl sudo systemd-run \
55
+ galaaz omarchy-galaaz-add ruby gem Rscript mise; do
56
+ if have "${c}"; then
57
+ trace "OK ${c}: $(command -v "${c}")"
58
+ else
59
+ trace "MISS ${c}"
60
+ fi
61
+ done
62
+
63
+ section "pkg-config Arrow"
64
+ if have pkg-config; then
65
+ trace "PKG_CONFIG_PATH=${PKG_CONFIG_PATH}"
66
+ if pkg-config --exists arrow; then
67
+ trace "OK arrow: $(pkg-config --modversion arrow)"
68
+ else
69
+ trace "MISS arrow (C++)"
70
+ fi
71
+ if pkg-config --exists arrow-glib; then
72
+ trace "OK arrow-glib: $(pkg-config --modversion arrow-glib)"
73
+ else
74
+ trace "MISS arrow-glib (Stage B GLib — required for red-arrow)"
75
+ fi
76
+ fi
77
+
78
+ section "Ruby red-arrow gem"
79
+ if have mise; then
80
+ mise x ruby -- gem list -e red-arrow 2>/dev/null | tee -a "${REPORT}" || trace "red-arrow: not installed"
81
+ elif have gem; then
82
+ gem list -e red-arrow 2>/dev/null | tee -a "${REPORT}" || trace "red-arrow: not installed"
83
+ fi
84
+
85
+ section "R package arrow"
86
+ if have Rscript; then
87
+ Rscript -e 'if (requireNamespace("arrow", quietly=TRUE)) cat("OK R arrow", as.character(packageVersion("arrow")), "\n") else cat("MISS R arrow\n")' 2>&1 | tee -a "${REPORT}"
88
+ fi
89
+
90
+ section "galaaz profile markers"
91
+ ls -la "${HOME}/.config/galaaz/profiles/" 2>/dev/null | tee -a "${REPORT}" || trace "no profiles dir"
92
+ if [[ -f "${HOME}/.config/galaaz/profiles/arrow" ]]; then
93
+ trace "NOTE: profiles/arrow exists → Omarchy menu Arrow row is DISABLED"
94
+ trace " If Stage B is incomplete, remove it to re-enable the menu:"
95
+ trace " rm ~/.config/galaaz/profiles/arrow"
96
+ fi
97
+
98
+ section "prior build / install logs"
99
+ for f in "${BUILD_LOG}" "${TRACE}" "${REPORT}"; do
100
+ if [[ -f "${f}" ]]; then
101
+ trace "file ${f} ($(wc -c <"${f}") bytes, mtime $(date -r "${f}" -Iseconds 2>/dev/null || true))"
102
+ fi
103
+ done
104
+
105
+ section "verdict"
106
+ local a=0 g=0 r=0 ra=0
107
+ pkg-config --exists arrow 2>/dev/null && a=1
108
+ pkg-config --exists arrow-glib 2>/dev/null && g=1
109
+ if have Rscript; then
110
+ Rscript -e 'quit(status=if (requireNamespace("arrow", quietly=TRUE)) 0 else 1)' 2>/dev/null && r=1 || true
111
+ fi
112
+ if have mise; then
113
+ mise x ruby -- ruby -e 'gem "red-arrow"; puts' 2>/dev/null && ra=1 || true
114
+ elif have ruby; then
115
+ ruby -e 'gem "red-arrow"; puts' 2>/dev/null && ra=1 || true
116
+ fi
117
+ trace "Stage A (R arrow): $([[ ${r} -eq 1 ]] && echo OK || echo MISSING)"
118
+ trace "Arrow C++ (pkg-config): $([[ ${a} -eq 1 ]] && echo OK || echo MISSING)"
119
+ trace "Arrow GLib: $([[ ${g} -eq 1 ]] && echo OK || echo MISSING)"
120
+ trace "Stage B (red-arrow): $([[ ${ra} -eq 1 ]] && echo OK || echo MISSING)"
121
+ if [[ ${r} -eq 1 && ${g} -eq 1 && ${ra} -eq 1 ]]; then
122
+ trace "RESULT: Arrow Stage A+B look OK"
123
+ elif [[ ${r} -eq 1 ]]; then
124
+ trace "RESULT: Stage A OK; Stage B incomplete — menu install still needed for GLib/red-arrow"
125
+ else
126
+ trace "RESULT: Arrow not fully installed"
127
+ fi
128
+ trace "Full report: ${REPORT}"
129
+ }
130
+
131
+ run_last_log() {
132
+ section "arrow-glib-build.log (last 80 lines)"
133
+ if [[ -f "${BUILD_LOG}" ]]; then
134
+ tail -n 80 "${BUILD_LOG}" | tee -a "${REPORT}"
135
+ else
136
+ trace "no ${BUILD_LOG}"
137
+ fi
138
+ section "arrow-install-trace.log (last 80 lines)"
139
+ if [[ -f "${TRACE}" ]]; then
140
+ tail -n 80 "${TRACE}" | tee -a "${REPORT}"
141
+ else
142
+ trace "no ${TRACE}"
143
+ fi
144
+ section "kernel OOM / kill hints"
145
+ dmesg -T 2>/dev/null | grep -iE 'oom|killed process|out of memory' | tail -20 | tee -a "${REPORT}" \
146
+ || journalctl -k -b --no-pager 2>/dev/null | grep -iE 'oom|killed process|out of memory' | tail -20 | tee -a "${REPORT}" \
147
+ || trace "(no dmesg/journal access)"
148
+ trace "Done. Report: ${REPORT}"
149
+ }
150
+
151
+ run_install() {
152
+ section "traced install via omarchy-galaaz-add arrow"
153
+ trace "If the terminal dies, re-open a terminal and run:"
154
+ trace " omarchy-galaaz-arrow-debug last-log"
155
+ trace " omarchy-galaaz-arrow-debug status"
156
+ local add="${HOME}/.local/bin/omarchy-galaaz-add"
157
+ if [[ ! -x "${add}" ]]; then
158
+ add="$(command -v omarchy-galaaz-add || true)"
159
+ fi
160
+ if [[ -z "${add}" || ! -x "${add}" ]]; then
161
+ trace "ERROR: omarchy-galaaz-add missing — run: galaaz omarchy install"
162
+ return 1
163
+ fi
164
+ # Clear stale profile so menu/add can redo Stage B.
165
+ if [[ -f "${HOME}/.config/galaaz/profiles/arrow" ]]; then
166
+ trace "removing incomplete/stale profiles/arrow so install can run cleanly"
167
+ rm -f "${HOME}/.config/galaaz/profiles/arrow"
168
+ fi
169
+ export GALAAZ_ARROW_TRACE=1
170
+ export GALAAZ_ARROW_GLIB_JOBS="${GALAAZ_ARROW_GLIB_JOBS:-1}"
171
+ trace "exec: GALAAZ_ARROW_TRACE=1 GALAAZ_ARROW_GLIB_JOBS=${GALAAZ_ARROW_GLIB_JOBS} ${add} arrow"
172
+ sync
173
+ "${add}" arrow
174
+ }
175
+
176
+ pause_end() {
177
+ local st=$1
178
+ echo
179
+ echo "Report: ${REPORT}"
180
+ if [[ "${st}" -ne 0 ]]; then
181
+ echo "FAILED (exit ${st}). Press Enter to close."
182
+ else
183
+ echo "OK. Press Enter to close."
184
+ fi
185
+ read -r _ || true
186
+ exit "${st}"
187
+ }
188
+
189
+ case "${CMD}" in
190
+ -h|--help|help)
191
+ sed -n '1,20p' "$0"
192
+ exit 0
193
+ ;;
194
+ status|probe)
195
+ run_status
196
+ pause_end 0
197
+ ;;
198
+ last-log|logs)
199
+ : >>"${REPORT}"
200
+ run_last_log
201
+ pause_end 0
202
+ ;;
203
+ install|add)
204
+ run_status
205
+ run_install
206
+ st=$?
207
+ run_status
208
+ pause_end "${st}"
209
+ ;;
210
+ *)
211
+ echo "Unknown command: ${CMD}"
212
+ echo "Use: status | last-log | install"
213
+ pause_end 1
214
+ ;;
215
+ esac
@@ -316,6 +316,11 @@ if [[ -f "${SCRIPT_DIR}/galaaz-gknit.sh" ]]; then
316
316
  chmod +x "${HOME}/.local/bin/omarchy-galaaz-gknit"
317
317
  log "gknit helper: ${HOME}/.local/bin/omarchy-galaaz-gknit"
318
318
  fi
319
+ if [[ -f "${SCRIPT_DIR}/galaaz-arrow-debug.sh" ]]; then
320
+ cp "${SCRIPT_DIR}/galaaz-arrow-debug.sh" "${HOME}/.local/bin/omarchy-galaaz-arrow-debug"
321
+ chmod +x "${HOME}/.local/bin/omarchy-galaaz-arrow-debug"
322
+ log "arrow debug: ${HOME}/.local/bin/omarchy-galaaz-arrow-debug"
323
+ fi
319
324
 
320
325
  # Nautilus right-click → Scripts → Galaaz → gknit
321
326
  NAUTILUS_SCRIPTS_SRC="${SCRIPT_DIR}/nautilus-scripts"
@@ -58,9 +58,17 @@
58
58
  "icon": "\uE90E",
59
59
  "iconFont": "omarchy",
60
60
  "label": "Arrow",
61
+ "description": "R arrow + Stage B (arrow-glib / red-arrow)",
61
62
  "action": "omarchy-launch-tui omarchy-galaaz-add arrow",
62
63
  "disabled": "test -f ~/.config/galaaz/profiles/arrow"
63
64
  },
65
+ "install.development.galaaz.arrow-debug": {
66
+ "icon": "\uE90E",
67
+ "iconFont": "omarchy",
68
+ "label": "Arrow debug",
69
+ "description": "Diagnose Stage A/B; show logs if install crashed",
70
+ "action": "omarchy-launch-tui omarchy-galaaz-arrow-debug status"
71
+ },
64
72
  "install.development.galaaz.bio": {
65
73
  "icon": "\uE90E",
66
74
  "iconFont": "omarchy",
data/version.rb CHANGED
@@ -1,2 +1,2 @@
1
1
  $gem_name = "galaaz"
2
- $version="2.1.10.pre.7"
2
+ $version="2.1.10.pre.9"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: galaaz
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.10.pre.7
4
+ version: 2.1.10.pre.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Botafogo
@@ -446,6 +446,7 @@ files:
446
446
  - script/omarchy/fonts/galaaz.ttf
447
447
  - script/omarchy/fonts/omarchy-with-galaaz.ttf
448
448
  - script/omarchy/galaaz-add.sh
449
+ - script/omarchy/galaaz-arrow-debug.sh
449
450
  - script/omarchy/galaaz-gknit.sh
450
451
  - script/omarchy/galaaz-guide.sh
451
452
  - script/omarchy/install-galaaz.sh