galaaz 2.1.10.pre.8 → 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: 49086d9d91136759ccda55167c3c7ba0960257b2ea01f552f11ea24c7bf0eb00
4
- data.tar.gz: a0227e50a79166c1d05c0609235f68e6be7504ff8fe6872b66821f274603b498
3
+ metadata.gz: 581406d58b67e2d86faf8bf90147b41b2e007717c616ec6729c1564bdfdb2a05
4
+ data.tar.gz: 28bf5eaf5a53824f952efa110850f419f10906ab8b82d1f976c095b9b8e4b648
5
5
  SHA512:
6
- metadata.gz: 2ca73b7ea17b312f2213095f98215ebc8688e15c2127eda29c863b374e85583e71e78b9259e396e9ad88e876180a561128e05015b72f3d138b8f133fe08f5433
7
- data.tar.gz: c2824ae862e18e6f39b4e8590431d45c6ead857727b530d90c8edf95fc5e548c527d8c935ad544fbd3da17b03fa56d16165e0fe24787316ba0ef4dc66ec22def
6
+ metadata.gz: 8426a17da8b08bbf5615b5c4c770fdd1d82f4fb9a91efd74940ed89ee14d89fad37827ca4fe3d008ab4359c95ab8fc362b05b478c8818e67697df0554c49e7f0
7
+ data.tar.gz: 243175fd0307965e82c5ad6d2fbb9462319f1f1e9ed36171dce80cb4952ae2cc509d6d7beeb8af9922e48b50147c8496373a1ed4d5d7fb1ca3441983604beea0
data/CHANGELOG.md CHANGED
@@ -2,6 +2,17 @@
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
+
5
16
  ## 2.1.10.pre.8
6
17
 
7
18
  ### Fixed
@@ -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,24 +681,38 @@ module Galaaz
647
681
  pkgs = read_pkg_list('arrow.txt')
648
682
  install_cran!(pkgs)
649
683
  if RUBY_ENGINE == 'ruby'
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)
650
693
  ENV['PKG_CONFIG_PATH'] = [
651
694
  '/usr/local/lib/pkgconfig',
652
695
  '/usr/local/lib64/pkgconfig',
696
+ '/usr/lib/pkgconfig',
653
697
  ENV['PKG_CONFIG_PATH']
654
698
  ].compact.reject(&:empty?).join(File::PATH_SEPARATOR)
655
699
  glib_ok = system('pkg-config', '--exists', 'arrow-glib')
656
700
  if glib_ok
657
701
  puts 'galaaz add arrow: gem install red-arrow (CRuby Stage B writer; MAKEFLAGS=-j1)'
658
- # Parallel native builds often OOM small Omarchy/TryOmarchy VMs.
659
702
  ok = system({ 'MAKEFLAGS' => '-j1', 'PKG_CONFIG_PATH' => ENV['PKG_CONFIG_PATH'] },
660
703
  'gem', 'install', 'red-arrow', '--no-document')
661
704
  unless ok
662
705
  warn 'galaaz add arrow: red-arrow gem install failed. R arrow is installed; ' \
663
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
664
710
  end
665
711
  else
666
712
  warn 'galaaz add arrow: arrow-glib not found (pkg-config); skipping red-arrow. ' \
667
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
668
716
  end
669
717
  else
670
718
  warn 'galaaz add arrow: on JRuby, set GALAAZ_ARROW_JARS (or ~/arrow_jars) and JAVA_OPTS nio opens for Arrow Java'
@@ -142,32 +142,57 @@ pkg_add_synced() {
142
142
  return 0
143
143
  }
144
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
+
145
160
  # red-arrow (Stage B) needs pkg-config "arrow" + "arrow-glib" at the same version.
146
- # Arch ships C++ Arrow (extra/arrow) but not Arrow GLib build GLib from the
147
- # matching Apache tarball. Keep ARROW_USE_PKG_CONFIG=false for CRAN R arrow
148
- # (LIBARROW_BINARY); pacman arrow is only for the Ruby gem.
149
- #
150
- # Small Omarchy/TryOmarchy VMs OOM and kill the TUI during unlimited ninja builds.
151
- # We: default -j1, optional build swap, compile in a systemd user scope, heartbeat.
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).
152
164
  ensure_arrow_for_red_arrow() {
153
165
  local major ver tmp tarball url build_dir jobs cache log swapfile avail_mb swap_mb
154
- local compile_st=0
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"
155
168
  major=25
156
169
  jobs="${GALAAZ_ARROW_GLIB_JOBS:-1}"
157
170
  cache="${HOME}/.cache/galaaz"
158
171
  log="${HOME}/.local/share/galaaz/arrow-glib-build.log"
159
172
  swapfile="${cache}/arrow-glib.swap"
160
- mkdir -p "${cache}" "$(dirname "${log}")"
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
+ }
161
180
 
181
+ : >"${trace_log}"
182
+ atracel "ensure_arrow_for_red_arrow start"
162
183
  echo "==> system: Apache Arrow C++ + GLib (Stage B / red-arrow)"
163
- echo " build log: ${log}"
184
+ echo " build log: ${log}"
185
+ echo " trace log: ${trace_log}"
186
+
164
187
  export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
165
188
 
166
189
  if ! command -v pkg-config >/dev/null 2>&1; then
190
+ atracel "install pkgconf"
167
191
  pkg_add_synced pkgconf || return 1
168
192
  fi
169
193
 
170
194
  if ! pkg-config --exists "arrow >= ${major}" 2>/dev/null; then
195
+ atracel "install Arch package arrow"
171
196
  echo "==> install Arch package: arrow"
172
197
  if ! pkg_add_synced arrow; then
173
198
  echo "ERROR: failed to install Arch arrow (Apache Arrow C++)" >&2
@@ -177,139 +202,161 @@ ensure_arrow_for_red_arrow() {
177
202
 
178
203
  if ! pkg-config --exists "arrow >= ${major}" 2>/dev/null; then
179
204
  echo "ERROR: Apache Arrow C++ >= ${major} still missing after pacman install" >&2
180
- echo " pkg-config --modversion arrow: $(pkg-config --modversion arrow 2>/dev/null || echo none)" >&2
181
205
  return 1
182
206
  fi
183
207
  ver="$(pkg-config --modversion arrow)"
208
+ atracel "arrow C++ ${ver}"
184
209
  echo "arrow (C++): ${ver}"
185
210
 
186
- 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)"
187
213
  echo "arrow-glib: $(pkg-config --modversion arrow-glib) (already installed)"
214
+ write_arrow_runtime_env
188
215
  return 0
189
216
  fi
190
217
 
191
- echo "==> Arrow GLib ${ver} missing — building from Apache source (required for Stage B)"
192
- echo " ninja jobs: ${jobs} (override with GALAAZ_ARROW_GLIB_JOBS)"
193
- # glib2-devel provides glib-mkenums (split from glib2 on Arch); without it meson fails.
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)"
194
221
  pkg_add_synced meson ninja gobject-introspection glib2 glib2-devel cmake || return 1
195
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
+
196
237
  avail_mb="$(awk '/MemAvailable:/ {print int($2/1024)}' /proc/meminfo 2>/dev/null || echo 0)"
197
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"
198
240
  echo " memory: MemAvailable=${avail_mb}MiB SwapFree=${swap_mb}MiB"
199
- if (( avail_mb + swap_mb < 3500 )); then
200
- echo "==> low RAM enabling 4GiB build swap at ${swapfile}"
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}"
201
251
  if [[ ! -f "${swapfile}" ]]; then
202
- if ! dd if=/dev/zero of="${swapfile}" bs=1M count=4096 status=none; then
203
- echo "ERROR: could not create build swap file (need ~4GiB free disk)" >&2
204
- return 1
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
205
256
  fi
206
257
  chmod 600 "${swapfile}"
207
258
  mkswap "${swapfile}" >/dev/null
208
259
  fi
209
- if ! sudo swapon "${swapfile}"; then
210
- echo "ERROR: swapon ${swapfile} failed" >&2
260
+ sudo swapon "${swapfile}" || {
261
+ echo "ERROR: swapon failed" >&2
211
262
  return 1
212
- fi
263
+ }
213
264
  fi
214
265
 
215
266
  tarball="apache-arrow-${ver}.tar.gz"
216
267
  url="https://dlcdn.apache.org/arrow/arrow-${ver}/${tarball}"
217
- # Prefer ~/.cache over /tmp — /tmp is often tmpfs and competes with the compile for RAM.
218
268
  tmp="${cache}/arrow-${ver}-src"
219
269
  rm -rf "${tmp}"
220
270
  mkdir -p "${tmp}"
221
271
  build_dir="${tmp}/apache-arrow-${ver}"
222
272
  : >"${log}"
273
+ atracel "download ${url}"
223
274
  echo "==> download: ${url}"
224
275
  if ! curl -fsSL -o "${tmp}/${tarball}" "${url}"; then
225
276
  url="https://archive.apache.org/dist/arrow/arrow-${ver}/${tarball}"
277
+ atracel "fallback ${url}"
226
278
  echo "==> fallback: ${url}"
227
279
  if ! curl -fsSL -o "${tmp}/${tarball}" "${url}"; then
228
280
  echo "ERROR: failed to download Apache Arrow ${ver} sources" >&2
229
281
  sudo swapoff "${swapfile}" 2>/dev/null || true
230
- rm -rf "${tmp}"
231
282
  return 1
232
283
  fi
233
284
  fi
234
- if ! tar -xzf "${tmp}/${tarball}" -C "${tmp}"; then
235
- echo "ERROR: failed to extract ${tarball}" >&2
285
+ atracel "extract ${tarball}"
286
+ tar -xzf "${tmp}/${tarball}" -C "${tmp}" || {
236
287
  sudo swapoff "${swapfile}" 2>/dev/null || true
237
- rm -rf "${tmp}"
238
288
  return 1
239
- fi
240
- if [[ ! -d "${build_dir}/c_glib" ]]; then
241
- echo "ERROR: c_glib missing from ${tarball}" >&2
289
+ }
290
+ [[ -d "${build_dir}/c_glib" ]] || {
291
+ echo "ERROR: c_glib missing" >&2
242
292
  sudo swapoff "${swapfile}" 2>/dev/null || true
243
- rm -rf "${tmp}"
244
293
  return 1
245
- fi
294
+ }
246
295
 
247
- echo "==> meson setup arrow-glib ${ver}"
296
+ atracel "meson setup"
297
+ echo "==> meson setup arrow-glib ${ver} (slim)"
248
298
  if ! meson setup "${build_dir}/c_glib.build" "${build_dir}/c_glib" \
249
299
  --buildtype=release \
250
300
  --prefix=/usr/local \
251
301
  -Dgtk_doc=false \
252
302
  -Ddoc=false \
253
303
  -Dvapi=false >>"${log}" 2>&1; then
254
- echo "ERROR: meson setup for arrow-glib failed" >&2
304
+ echo "ERROR: meson setup failed see ${log}" >&2
255
305
  tail -n 40 "${log}" || true
256
306
  sudo swapoff "${swapfile}" 2>/dev/null || true
257
- rm -rf "${tmp}"
258
307
  return 1
259
308
  fi
260
309
 
261
- echo "==> meson compile arrow-glib ${ver} (-j${jobs}) — can take several minutes"
262
- echo " leave this window open; progress also in ${log}"
263
- # Isolate from the TUI cgroup when possible so an OOM kills the build, not the terminal.
310
+ atracel "meson compile -j${jobs} begin"
311
+ echo "==> meson compile arrow-glib ${ver} (-j${jobs}) — leave window open"
264
312
  set +e
265
- if command -v systemd-run >/dev/null 2>&1; then
266
- systemd-run --user --scope --quiet \
267
- -p MemoryMax=8G \
268
- -E "PKG_CONFIG_PATH=${PKG_CONFIG_PATH:-}" \
269
- -E "PATH=${PATH}" \
270
- meson compile -C "${build_dir}/c_glib.build" -j "${jobs}" >>"${log}" 2>&1 &
271
- else
272
- meson compile -C "${build_dir}/c_glib.build" -j "${jobs}" >>"${log}" 2>&1 &
273
- fi
313
+ meson compile -C "${build_dir}/c_glib.build" -j "${jobs}" >>"${log}" 2>&1 &
274
314
  local compile_pid=$!
275
315
  while kill -0 "${compile_pid}" 2>/dev/null; do
276
- echo " … still compiling arrow-glib ($(date +%H:%M:%S))"
277
- sleep 20
316
+ echo " … compiling arrow-glib ($(date +%H:%M:%S)) log: ${log}"
317
+ atracel "heartbeat compile pid=${compile_pid}"
318
+ sleep 15
278
319
  done
279
320
  wait "${compile_pid}"
280
321
  compile_st=$?
281
322
  set -e
323
+ atracel "meson compile exit ${compile_st}"
282
324
 
283
325
  if [[ "${compile_st}" -ne 0 ]]; then
284
- echo "ERROR: meson compile for arrow-glib failed (exit ${compile_st}) — often OOM" >&2
285
- echo " log: ${log}" >&2
286
- tail -n 40 "${log}" || true
287
- echo " Retry with more swap free disk, close other apps, or GALAAZ_ARROW_GLIB_JOBS=1" >&2
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
288
329
  sudo swapoff "${swapfile}" 2>/dev/null || true
289
- rm -rf "${tmp}"
290
330
  return 1
291
331
  fi
292
332
 
333
+ atracel "meson install"
293
334
  echo "==> meson install arrow-glib ${ver}"
294
335
  if ! sudo meson install -C "${build_dir}/c_glib.build" >>"${log}" 2>&1; then
295
- echo "ERROR: meson install for arrow-glib failed" >&2
296
- tail -n 40 "${log}" || true
336
+ echo "ERROR: meson install failed see ${log}" >&2
297
337
  sudo swapoff "${swapfile}" 2>/dev/null || true
298
- rm -rf "${tmp}"
299
338
  return 1
300
339
  fi
301
-
302
340
  sudo ldconfig 2>/dev/null || true
303
341
  sudo swapoff "${swapfile}" 2>/dev/null || true
304
342
  rm -rf "${tmp}"
305
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}}"
306
346
  if ! pkg-config --exists "arrow-glib = ${ver}" 2>/dev/null; then
307
- echo "ERROR: arrow-glib ${ver} still missing after build" >&2
308
- echo " pkg-config --modversion arrow-glib: $(pkg-config --modversion arrow-glib 2>/dev/null || echo none)" >&2
309
- echo " log: ${log}" >&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"
310
355
  return 1
311
356
  fi
312
- 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
313
360
  return 0
314
361
  }
315
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.8"
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.8
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