galaaz 2.1.10.pre.7 → 2.1.10.pre.8

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: 49086d9d91136759ccda55167c3c7ba0960257b2ea01f552f11ea24c7bf0eb00
4
+ data.tar.gz: a0227e50a79166c1d05c0609235f68e6be7504ff8fe6872b66821f274603b498
5
5
  SHA512:
6
- metadata.gz: fc202447c62b7636446195299178b165933ed490f1f71f55b09e7528aa528697051b73b47d7e7b40084c337eb772b6263242723a8048e77ca3c95856db0e6098
7
- data.tar.gz: 15452e1e64b207e1b5e85cd41495e42974a76da11266e7467b2ed75de1455c0869322c067ce381b502d86dfb18699fc7e285b1507c20822a8e6752d1e8f2a51a
6
+ metadata.gz: 2ca73b7ea17b312f2213095f98215ebc8688e15c2127eda29c863b374e85583e71e78b9259e396e9ad88e876180a561128e05015b72f3d138b8f133fe08f5433
7
+ data.tar.gz: c2824ae862e18e6f39b4e8590431d45c6ead857727b530d90c8edf95fc5e548c527d8c935ad544fbd3da17b03fa56d16165e0fe24787316ba0ef4dc66ec22def
data/CHANGELOG.md CHANGED
@@ -2,6 +2,18 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 2.1.10.pre.8
6
+
7
+ ### Fixed
8
+
9
+ - Omarchy `galaaz-add` arrow: on pacman mirror 404s (stale DB), refresh with
10
+ `pacman -Sy` and retry install before failing.
11
+ - Omarchy arrow-glib build: auto-install `glib2-devel` + `cmake` (and other
12
+ build deps) via the add wrapper — no manual `pacman`; default `-j1`, add
13
+ build swap when RAM is low, compile in a systemd user scope with heartbeats
14
+ so OOM kills the build instead of the TUI. Stage B (red-arrow) stays on the
15
+ menu Arrow / ledger / demo path.
16
+
5
17
  ## 2.1.10.pre.7
6
18
 
7
19
  ### Added
data/lib/galaaz/cli.rb CHANGED
@@ -647,9 +647,24 @@ module Galaaz
647
647
  pkgs = read_pkg_list('arrow.txt')
648
648
  install_cran!(pkgs)
649
649
  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.'
650
+ ENV['PKG_CONFIG_PATH'] = [
651
+ '/usr/local/lib/pkgconfig',
652
+ '/usr/local/lib64/pkgconfig',
653
+ ENV['PKG_CONFIG_PATH']
654
+ ].compact.reject(&:empty?).join(File::PATH_SEPARATOR)
655
+ glib_ok = system('pkg-config', '--exists', 'arrow-glib')
656
+ if glib_ok
657
+ 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
+ ok = system({ 'MAKEFLAGS' => '-j1', 'PKG_CONFIG_PATH' => ENV['PKG_CONFIG_PATH'] },
660
+ 'gem', 'install', 'red-arrow', '--no-document')
661
+ unless ok
662
+ warn 'galaaz add arrow: red-arrow gem install failed. R arrow is installed; ' \
663
+ 'Ruby IPC writer may be unavailable.'
664
+ end
665
+ else
666
+ warn 'galaaz add arrow: arrow-glib not found (pkg-config); skipping red-arrow. ' \
667
+ 'On Omarchy use omarchy-galaaz-add arrow so Stage B GLib is built first.'
653
668
  end
654
669
  else
655
670
  warn 'galaaz add arrow: on JRuby, set GALAAZ_ARROW_JARS (or ~/arrow_jars) and JAVA_OPTS nio opens for Arrow Java'
@@ -119,24 +119,57 @@ pkg_add() {
119
119
  fi
120
120
  }
121
121
 
122
- # red-arrow needs pkg-config "arrow" + "arrow-glib" at the same version.
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
+ # red-arrow (Stage B) needs pkg-config "arrow" + "arrow-glib" at the same version.
123
146
  # Arch ships C++ Arrow (extra/arrow) but not Arrow GLib — build GLib from the
124
147
  # matching Apache tarball. Keep ARROW_USE_PKG_CONFIG=false for CRAN R arrow
125
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.
126
152
  ensure_arrow_for_red_arrow() {
127
- local major ver tmp tarball url build_dir
153
+ local major ver tmp tarball url build_dir jobs cache log swapfile avail_mb swap_mb
154
+ local compile_st=0
128
155
  major=25
156
+ jobs="${GALAAZ_ARROW_GLIB_JOBS:-1}"
157
+ cache="${HOME}/.cache/galaaz"
158
+ log="${HOME}/.local/share/galaaz/arrow-glib-build.log"
159
+ swapfile="${cache}/arrow-glib.swap"
160
+ mkdir -p "${cache}" "$(dirname "${log}")"
129
161
 
130
- echo "==> system: Apache Arrow C++ + GLib (for red-arrow)"
162
+ echo "==> system: Apache Arrow C++ + GLib (Stage B / red-arrow)"
163
+ echo " build log: ${log}"
131
164
  export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
132
165
 
133
166
  if ! command -v pkg-config >/dev/null 2>&1; then
134
- pkg_add pkgconf || return 1
167
+ pkg_add_synced pkgconf || return 1
135
168
  fi
136
169
 
137
170
  if ! pkg-config --exists "arrow >= ${major}" 2>/dev/null; then
138
171
  echo "==> install Arch package: arrow"
139
- if ! pkg_add arrow; then
172
+ if ! pkg_add_synced arrow; then
140
173
  echo "ERROR: failed to install Arch arrow (Apache Arrow C++)" >&2
141
174
  return 1
142
175
  fi
@@ -155,55 +188,125 @@ ensure_arrow_for_red_arrow() {
155
188
  return 0
156
189
  fi
157
190
 
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
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.
194
+ pkg_add_synced meson ninja gobject-introspection glib2 glib2-devel cmake || return 1
195
+
196
+ avail_mb="$(awk '/MemAvailable:/ {print int($2/1024)}' /proc/meminfo 2>/dev/null || echo 0)"
197
+ swap_mb="$(awk '/SwapFree:/ {print int($2/1024)}' /proc/meminfo 2>/dev/null || echo 0)"
198
+ 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}"
201
+ 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
205
+ fi
206
+ chmod 600 "${swapfile}"
207
+ mkswap "${swapfile}" >/dev/null
208
+ fi
209
+ if ! sudo swapon "${swapfile}"; then
210
+ echo "ERROR: swapon ${swapfile} failed" >&2
211
+ return 1
212
+ fi
213
+ fi
160
214
 
161
215
  tarball="apache-arrow-${ver}.tar.gz"
162
216
  url="https://dlcdn.apache.org/arrow/arrow-${ver}/${tarball}"
163
- tmp="$(mktemp -d)"
217
+ # Prefer ~/.cache over /tmp — /tmp is often tmpfs and competes with the compile for RAM.
218
+ tmp="${cache}/arrow-${ver}-src"
219
+ rm -rf "${tmp}"
220
+ mkdir -p "${tmp}"
164
221
  build_dir="${tmp}/apache-arrow-${ver}"
222
+ : >"${log}"
165
223
  echo "==> download: ${url}"
166
224
  if ! curl -fsSL -o "${tmp}/${tarball}" "${url}"; then
167
225
  url="https://archive.apache.org/dist/arrow/arrow-${ver}/${tarball}"
168
226
  echo "==> fallback: ${url}"
169
227
  if ! curl -fsSL -o "${tmp}/${tarball}" "${url}"; then
170
228
  echo "ERROR: failed to download Apache Arrow ${ver} sources" >&2
229
+ sudo swapoff "${swapfile}" 2>/dev/null || true
171
230
  rm -rf "${tmp}"
172
231
  return 1
173
232
  fi
174
233
  fi
175
- tar -xzf "${tmp}/${tarball}" -C "${tmp}"
234
+ if ! tar -xzf "${tmp}/${tarball}" -C "${tmp}"; then
235
+ echo "ERROR: failed to extract ${tarball}" >&2
236
+ sudo swapoff "${swapfile}" 2>/dev/null || true
237
+ rm -rf "${tmp}"
238
+ return 1
239
+ fi
176
240
  if [[ ! -d "${build_dir}/c_glib" ]]; then
177
241
  echo "ERROR: c_glib missing from ${tarball}" >&2
242
+ sudo swapoff "${swapfile}" 2>/dev/null || true
178
243
  rm -rf "${tmp}"
179
244
  return 1
180
245
  fi
181
246
 
182
- echo "==> meson setup / compile / install arrow-glib ${ver}"
247
+ echo "==> meson setup arrow-glib ${ver}"
183
248
  if ! meson setup "${build_dir}/c_glib.build" "${build_dir}/c_glib" \
184
249
  --buildtype=release \
185
250
  --prefix=/usr/local \
186
- -Dgtk_doc=false; then
251
+ -Dgtk_doc=false \
252
+ -Ddoc=false \
253
+ -Dvapi=false >>"${log}" 2>&1; then
187
254
  echo "ERROR: meson setup for arrow-glib failed" >&2
255
+ tail -n 40 "${log}" || true
256
+ sudo swapoff "${swapfile}" 2>/dev/null || true
188
257
  rm -rf "${tmp}"
189
258
  return 1
190
259
  fi
191
- if ! meson compile -C "${build_dir}/c_glib.build"; then
192
- echo "ERROR: meson compile for arrow-glib failed" >&2
260
+
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.
264
+ 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
274
+ local compile_pid=$!
275
+ while kill -0 "${compile_pid}" 2>/dev/null; do
276
+ echo " … still compiling arrow-glib ($(date +%H:%M:%S))"
277
+ sleep 20
278
+ done
279
+ wait "${compile_pid}"
280
+ compile_st=$?
281
+ set -e
282
+
283
+ 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
288
+ sudo swapoff "${swapfile}" 2>/dev/null || true
193
289
  rm -rf "${tmp}"
194
290
  return 1
195
291
  fi
196
- if ! sudo meson install -C "${build_dir}/c_glib.build"; then
292
+
293
+ echo "==> meson install arrow-glib ${ver}"
294
+ if ! sudo meson install -C "${build_dir}/c_glib.build" >>"${log}" 2>&1; then
197
295
  echo "ERROR: meson install for arrow-glib failed" >&2
296
+ tail -n 40 "${log}" || true
297
+ sudo swapoff "${swapfile}" 2>/dev/null || true
198
298
  rm -rf "${tmp}"
199
299
  return 1
200
300
  fi
301
+
201
302
  sudo ldconfig 2>/dev/null || true
303
+ sudo swapoff "${swapfile}" 2>/dev/null || true
202
304
  rm -rf "${tmp}"
203
305
 
204
306
  if ! pkg-config --exists "arrow-glib = ${ver}" 2>/dev/null; then
205
307
  echo "ERROR: arrow-glib ${ver} still missing after build" >&2
206
308
  echo " pkg-config --modversion arrow-glib: $(pkg-config --modversion arrow-glib 2>/dev/null || echo none)" >&2
309
+ echo " log: ${log}" >&2
207
310
  return 1
208
311
  fi
209
312
  echo "arrow-glib: $(pkg-config --modversion arrow-glib) (built from Apache ${ver})"
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.8"
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.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rodrigo Botafogo