Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing C/C++ headers in homebrew installs #9611

Closed
1 task done
mnovelo opened this issue Nov 8, 2023 · 11 comments
Closed
1 task done

Missing C/C++ headers in homebrew installs #9611

mnovelo opened this issue Nov 8, 2023 · 11 comments

Comments

@mnovelo
Copy link

mnovelo commented Nov 8, 2023

What happens?

Previously installing duckdb via homebrew would also add duckdb.h to /opt/homebrew/include

This has been an expectation for https://github.com/suketa/ruby-duckdb

To Reproduce

Now installing duckdb, v0.9.1, via homebrew does not include the headers, which causes installs of the ruby-duckdb gem to fail unless we add the headers manually.

Previously, I could find /opt/homebrew/include/duckdb, /opt/homebrew/include/duckdb.h, and /opt/homebrew/include/duckdb.hpp All of which were aliases to the files for the currently installed version of duckdb. Installing via homebrew now does not add these files or aliases.

OS:

arm64_sonoma

DuckDB Version:

0.9.1

DuckDB Client:

Ruby

Full Name:

Mauricio Novelo

Affiliation:

CampusESP

Have you tried this on the latest main branch?

I have tested with a release build (and could not test with a main build)

Have you tried the steps to reproduce? Do they include all relevant data and configuration? Does the issue you report still appear there?

  • Yes, I have
@carlopi
Copy link
Contributor

carlopi commented Nov 8, 2023

Headers and libraries for DuckDB were installed in a previous versions of homebrew package, but I did file a PR for removing them that just got merged.
Rationale was that that shipping libraries, while potentially useful like in this case, was not deemed to be of general utility enough to warrant any user of brew-installed duckdb to have those files on their system (and to have to wait for them to be downloaded).

Would it be possible for users to rely on building duckdb from sources on the fly? (even just as a temporary workaround?)

@carlopi
Copy link
Contributor

carlopi commented Nov 8, 2023

Connected issue that will also need addressing: #9475

@Maxxen
Copy link
Member

Maxxen commented Nov 8, 2023

Could we not ship a separate development package with headers and libs? E.g. duckdb-devel or equivalent brew convention.

@Mytherin
Copy link
Collaborator

Mytherin commented Nov 8, 2023

I would say shipping duckdb.h would make sense - we can skip the C++ headers. That should still have the same effect of reducing the size of the hombrew installation drastically.

@mnovelo
Copy link
Author

mnovelo commented Nov 8, 2023

@Mytherin, my concern with only including the duckdb.h file is that libraries like https://github.com/suketa/ruby-duckdb, I believe, are dependent on the C++ headers, so a duckdb-devel like @Maxxen suggested, that includes those, would be greatly appreciated!

As a temporary workaround, we can download those files and link them manually with something like this

LIBDUCKDB_PATH=$(pwd)/lib/duckdb/libduckdb-osx-universal
bundle config set --local build.duckdb --with-duckdb-include=$LIBDUCKDB_PATH --with-duckdb-lib=$LIBDUCKDB_PATH
bundle install --redownload

The following are then required to account for Apple's permissions that are required at runtime

sudo ln -s $LIBDUCKDB_PATH/libduckdb.dylib /usr/local/lib/libduckdb.dylib
xattr -w com.apple.quarantine "$(xattr -p com.apple.quarantine $LIBDUCKDB_PATH/libduckdb.dylib | sed 's/^.\{4\}/00c1/')" $LIBDUCKDB_PATH/libduckdb.dylib

@mnovelo
Copy link
Author

mnovelo commented Nov 8, 2023

Actually what I had above doesn't work now. It's what I had done previously to use a nightly build, but I've not been successful in using v0.9.1/libduckdb-osx-universal.zip to get ruby-duckdb to run successful

@Mytherin
Copy link
Collaborator

Mytherin commented Nov 9, 2023

I'm not opposed to shipping a duckdb-devel - but perhaps the correct fix for duckdb-ruby is to ship DuckDB as part of the installation (which is what other clients do as well). I'm not familiar with Ruby's installation process but it seems that sqlite3-ruby ships SQLite as well. This should make the installation process a lot simpler.

@mnovelo
Copy link
Author

mnovelo commented Nov 9, 2023

I'll look into creating a PR for duckdb-ruby that includes the requisite headers as part of it like sqlite3-ruby does. Thanks for the advice!

If you'd like to close this issue for now, I'm fine with that, unless you'd like to leave it open to track shipping of duckdb-devel for other purposes

@carlopi
Copy link
Contributor

carlopi commented Nov 14, 2023

@mnovelo: update, we though more about this, and uses cases like yours, and I just filed a PR (Homebrew/homebrew-core#154240) that adds back headers and libraries to the homebrew's duckdb package.

I would expect this to be considered for merging in the next day or so.

@carlopi
Copy link
Contributor

carlopi commented Nov 14, 2023

Homebrew PR has been merged, closing this as solved.

@carlopi carlopi closed this as completed Nov 14, 2023
@mnovelo
Copy link
Author

mnovelo commented Nov 14, 2023

thank you so much! With v0.9.2, ruby-duckdb installs as expected

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants