pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: racket-minimal-8.15 drracket install won't run



> Date: Thu, 02 Jan 2025 01:27:10 +0000
> From: Van Ly <van.ly%SDF.ORG@localhost>
> 
> What's the way to run drracket?

I suggest you install the `racket' package (from lang/racket in
pkgsrc) rather than the `racket-minimal' package (from
lang/racket-textual in pkgsrc).

> I have installed racket-minimal-8.15 then installed drracket as follows
> 
>   $ raco pkg install --auto drracket
> 
> on running drracket, I see
> 
>   $ drracket
>   ffi-lib: could not load foreign library
>     path: libX11.so.6
>     system error: /usr/pkg/lib/racket/gracket: Shared object "libX11.so.6" not found

When you build racket-minimal, it is not configured to look for X
libraries.

On NetBSD, there are two places that packages might find X libraries,
depending on whether you are using X from the NetBSD base system
(X11_TYPE=native, /usr/X11R7/lib, default for TNF's binary packages)
or the separate X packages from pkgsrc (X11_TYPE=modular,
$LOCALBASE/lib).

When pkgsrc builds packages that declare their use of X, like
lang/racket, it bakes the correct paths into them to find the
appropriate X libraries at runtime.

But when pkgsrc builds packages that _don't_ declare use of X, like
lang/racket-textual (which produces the binary package
racket-minimal), it doesn't bake any paths to X libraries into them,
so at runtime, programs in the packages won't know where to look for X
libraries.

(It is possible you can use an LD_LIBRARY_PATH hack to muddle your way
through this, but LD_LIBRARY_PATH is a blunt and unreliable hammer.
In contrast, the `racket' package from lang/racket is built to work
more reliably.)

> looking for libX11.so.6, I see
> 
>   /usr/pkg/emul/linux/usr/lib64/libX11.so.6

This library is for binary Linux applications run with
compat_linux(8).  It is not ABI-compatible with NetBSD applications,
such as NetBSD packages you installed through pkgsrc.  When you try to
mix it with NetBSD applications like /usr/pkg/bin/racket, and NetBSD
libraries like /usr/pkg/lib/libcairo.so.2, you see that it immediately
crashes with SIGSEGV because of the incompatible ABI.

You can't mix libraries from /usr/pkg/emul/linux with libraries from
/usr/pkg/lib or /usr/lib and native NetBSD applications.
/usr/pkg/emul/linux is only for use with Linux binaries you got from
somewhere else, like proprietary software from a vendor that controls
a custom hardware device, which you want to run on NetBSD.


Home | Main Index | Thread Index | Old Index