okuoku / yunibase

Yuni library test environment (Scheme implementations build script)
4 stars 1 forks source link

Gauche: Don't build on macOS 13 #111

Closed okuoku closed 2 years ago

okuoku commented 2 years ago

EDIT: It must be yunibase-specific issue; I use exact same setup for Mosh development https://github.com/higepon/mosh/issues/23#issuecomment-1222478234

macOS has some security measure that prevents loading out-of-framework DYLD.

Error in compiling (define-module text.gettext (use srfi-13) (use rfc.822) (use file.util) (use binary.io) (use gauche.charconv) (use util.combinations) (export gettext textdomain dgettext dcgettext bindtextdomain ngettext make-gettext))
*** ERROR: failed to link /Volumes/devel/repos/yunibase/impl-stable/gauche/src/../src/gauche--charconv.so dynamically: dlopen(/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../src/gauche--charconv.so,  ...
    While loading "/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../lib/gauche/charconv.scm" at line 54
    While compiling "./gettext.scm" at line 78: (use gauche.charconv)
Stack Trace:
_______________________________________
  0  (eval-in-current-tmodule form)
        at "/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../lib/gauche/cgen/precomp.scm":568
  1  (fold compile-toplevel-form seed body)
        at "/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../lib/gauche/cgen/precomp.scm":552
  2  (generator-fold compile-toplevel-form '() read)
        at "/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../lib/gauche/cgen/precomp.scm":248
  3  (with-input-from-file src (^ () (define load-path-save *load- ...
        at "/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../lib/gauche/cgen/precomp.scm":239
  4  (do-it)
        at "/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../lib/gauche/cgen/precomp.scm":276
  5  (call-with-output-file out.sci (^p (display ";; generated aut ...
        at "/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../lib/gauche/cgen/precomp.scm":271
  6  (apply %cgen-precompile src keys)
        at "/Volumes/devel/repos/yunibase/impl-stable/gauche/src/../lib/gauche/cgen/precomp.scm":163
  7  (cgen-precompile src :out.c out.c :out.sci (or out.sci ext-mo ...
        at "./../../src/precomp":74
make[2]: *** [text--gettext.c] Error 70
make[1]: *** [text] Error 2
make: *** [all] Error 1

Switch to copy-then-build.

okuoku commented 2 years ago

Implemented copying but still not resolved the issue so external drive is not affected here: https://github.com/okuoku/yunibase/commit/a5d0488416f40da068457ffe1c60c0639ab7f349

okuoku commented 2 years ago

Reduced to

okuoku@prism gauche % ./src/gosh -ftest -e "(dynamic-load \"gauche--charconv\")"
gosh: "ERROR": failed to link /Users/okuoku/yunibase/impl-stable/gauche/src/../src/gauche--charconv.so dynamically: dlopen(/Users/okuoku/yunibase/impl-stable/gauche/src/../src/gauche--charconv.so, 0x000A): symbol not found in flat namespace '_libiconv'

So it seems libiconv conflicts with SDK and pkgsrc(Yunibase uses pkgsrc for pkg provider).

sudo rm /opt/pkg/include/iconv.h

fixes issue and we have to detect this (or, should detect SDK path and feed -I option.)

okuoku commented 2 years ago

Disabled iconv: https://github.com/okuoku/yunibase/commit/1ac53b666d7cf4f77046e861da6ea13a122b1eab