Skip to content

Install fails on M1 mac 2025.02 #242

@librasteve

Description

@librasteve

may relate to Issue #234

The Problem

I have been able to successfully install DBIish on raku 2024.10 on my M1 mac (--/test required, but it worked) as part of a Red installation

However, after upgrade to raku 2025.02, this no longer worked

Also, I would much prefer to be able to not issue a --/test since that prevents CI testing such as with Sparky

The Workaround

I consulted ChatGPT https://chatgpt.com/share/67e5373d-c970-8009-a280-e5a2649a6c9e and I noted this remark from Issue #234

In order for DBIish to be able to load any of the required libraries, it needs:

Know the name of the library file on the local platform.
That the library it is in one of the places where the loader looks for it.
In MacOS there can be problems because the rules have changed frequently and Homebrew can use not standard names or places. So some tests can help us:

To get the library file name that will be used for PostgreSQL try the following in the raku REPL:

say $*VM.platform-library-name('pq'.IO, :version(Version.new(5))).Str;
By default the loader will search for that file in ~/lib, /usr/local/lib, and /usr/lib or in any path in the environment variables PATH, LD_LIBRARY_PATH, DYLD_LIBRARY_PATH or DYLD_FALLBACK_LIBRARY_PATH.

Check that your library has the expected name and it is installed in any of those places or add its path to one of these variables.

This led me to take the following steps:

  1. find the name of the dylib from raku repl
[0] > say $*VM.platform-library-name('pq'.IO, :version(Version.new(5))).Str;
libpq.5.dylib
  1. find where homebrew puts the dylib and make a symlink
sudo ln -s /opt/homebrew/opt/libpq/lib/libpq.5.dylib /usr/local/lib/libpq.5.dylib
  1. exclude the anyway failing test t/43-sqlite-threads.rakutest
  • clone this repo, delete that file, cd t and go prove6 -I../lib *.rakutest

And it works on 2024.10 and on 2025.02 yay

  1. I still need to do this to install Red
zef install LibUUID --/test
zef install . #(DBIish no 43)
zef install Red --exclude="pq:ver<5>"

Proposal

I propose that

  1. someone who knows DB stuff fix t/43-sqlite-threads.rakutest -or- that this is moved from /t to /xt to allow macOS recent raku version installs to proceed
  2. the new mac M1 homebrew dylib dir is added to the path for test and run -or- that the workaround I describe above is added to the installation instructions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions