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

MacOS nix fixes #2321

Merged
merged 2 commits into from
Nov 11, 2024
Merged

Conversation

niklasmohrin
Copy link
Member

@niklasmohrin niklasmohrin commented Oct 28, 2024

Mac users reported issues that boiled down to psycopg[binary] not having a matching wheel. I thought that using the "pure Python installation" (just psycopg) would work, but this breaks even on Linux as the libpq dynamic library cannot be found (even when adding postgres to the nix shell packages or the build inputs of the Python packages). There is also psycopg[c] which compiles the extension at installation time. This seems to work and the compilation time is not too long either (on a Surface from this decade it took ~1min to compile the extension, same in a Mac VM).

Should we just default to using psycopg[c] on Linux too, or stick to using the binary installation on Linux?

@Kakadus
Copy link
Collaborator

Kakadus commented Oct 28, 2024

just a sidenote: running pip install "psycopg[binary]" on macos works, the same is when just installing poetry, so this seems to be a poetry2nix problem.

IMHO, using psycopg[c] is fine on all platforms.

flake.nix Outdated Show resolved Hide resolved
Copy link
Member

@richardebeling richardebeling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compiling is fine for me as a workaround, but in general, I don't want people to compile stuff, I want to use internet-provided builds to not waste time and energy.

running pip install "psycopg[binary]" on macos works, the same is when just installing poetry, so this seems to be a poetry2nix problem.

Is there a chance we could get this fixed in poetry2nix, does it make sense to open an issue somewhere (@niklasmohrin)?

@niklasmohrin
Copy link
Member Author

If I understood correctly it's either a mismatch between what nix and python (and different Python libraries) use as a name for arm macs, or the wheels are just missing. That being said, I recently read that nixpkgs updated and refactored the apple sdks, so I suppose I will look into this again before moving forward here

@niklasmohrin niklasmohrin changed the title Allow specifying psycopg installation method MacOS nix fixes Nov 11, 2024
@niklasmohrin niklasmohrin force-pushed the psycopg-non-binary branch 2 times, most recently from 69b36fa to fb7a964 Compare November 11, 2024 19:15
@niklasmohrin
Copy link
Member Author

niklasmohrin commented Nov 11, 2024

@ybrnr Can you do one last check of the following?

nix run --refresh github:niklasmohrin/evap/psycopg-non-binary#services-full
nix develop --refresh github:niklasmohrin/evap/psycopg-non-binary

(edit: they told me in person that it works)

@niklasmohrin
Copy link
Member Author

niklasmohrin commented Nov 11, 2024

If this works, I think we will just keep it as is, because we should probably move away from poetry2nix anyways, as the maintainer stepped down a couple of days ago :/ Looks like uv2nix is the current recommendation

@niklasmohrin niklasmohrin marked this pull request as ready for review November 11, 2024 20:50
With a locale like `en_US.UTF-8`, `tr` complains about invalid UTF-8
when running `cat /dev/urandom | tr ...`.
pyproject.toml Outdated Show resolved Hide resolved
Copy link
Collaborator

@Kakadus Kakadus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also works with macos on x86_64

@niklasmohrin niklasmohrin merged commit 872ef2e into e-valuation:main Nov 11, 2024
12 checks passed
@niklasmohrin niklasmohrin deleted the psycopg-non-binary branch November 11, 2024 21:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants