-
-
Notifications
You must be signed in to change notification settings - Fork 451
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
Add override for Pendulum version 3.0.0 with Rust #1739
Merged
cpcloud
merged 12 commits into
nix-community:master
from
bow:feature/pendulum-with-rust
Sep 29, 2024
Merged
Add override for Pendulum version 3.0.0 with Rust #1739
cpcloud
merged 12 commits into
nix-community:master
from
bow:feature/pendulum-with-rust
Sep 29, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
An additional question not directly related to this PR: During the course of playing with this package (that depends on pendulum), I found several other Python packages that needed I suspect the fix for these is just new entries in So for these packages, do you prefer a new PR altogether or is it ok to just add commits in this PR? |
bow
added a commit
to bow/poetry2nix
that referenced
this pull request
Jul 16, 2024
Previous approach of patching the source prior to build always results in some hash mismatch. So here we just use a drop-in Cargo.lock file, or rather what it would have looked like had the version been set correctly. See: nix-community#1739
cpcloud
requested changes
Sep 27, 2024
Previous approach of patching the source prior to build always results in some hash mismatch. So here we just use a drop-in Cargo.lock file, or rather what it would have looked like had the version been set correctly. See: nix-community#1739
This reverts commit 777fb62.
cpcloud
force-pushed
the
feature/pendulum-with-rust
branch
from
September 27, 2024 11:11
a836921
to
04670ec
Compare
cpcloud
approved these changes
Sep 29, 2024
cheriimoya
pushed a commit
to cheriimoya/poetry2nix
that referenced
this pull request
Oct 2, 2024
cheriimoya
pushed a commit
to cheriimoya/poetry2nix
that referenced
this pull request
Oct 2, 2024
cheriimoya
pushed a commit
to cheriimoya/poetry2nix
that referenced
this pull request
Oct 2, 2024
cheriimoya
pushed a commit
to cheriimoya/poetry2nix
that referenced
this pull request
Oct 2, 2024
cheriimoya
pushed a commit
to cheriimoya/poetry2nix
that referenced
this pull request
Oct 2, 2024
Previous approach of patching the source prior to build always results in some hash mismatch. So here we just use a drop-in Cargo.lock file, or rather what it would have looked like had the version been set correctly. See: nix-community#1739
Arkptz
pushed a commit
to Arkptz/poetry2nix
that referenced
this pull request
Nov 2, 2024
Arkptz
pushed a commit
to Arkptz/poetry2nix
that referenced
this pull request
Nov 2, 2024
Arkptz
pushed a commit
to Arkptz/poetry2nix
that referenced
this pull request
Nov 2, 2024
Previous approach of patching the source prior to build always results in some hash mismatch. So here we just use a drop-in Cargo.lock file, or rather what it would have looked like had the version been set correctly. See: nix-community#1739
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi maintainers,
I recently came across build problems when trying to use
poetry2nix
on a Python project that depends on Pendulum. The build error was because this was the first Pendulum release that has parts of its source re-written in Rust. Previous versions have been pure Python.This PR fixes that issue by adding an override for Pendulum that includes the Rust build hook. The override is only applied if the version is at least 3.0.0 (still the most recent version at the time of writing).
The changeset of this PR works locally and I have also included a test for this, to confirm also that builds of previous versions are not broken. That said, I did encounter an issue where I found out the
version
attribute of the autogeneratedCargo.lock
in pendulum's source tree is actually3.0.0-beta-1
. This introduced some conflict when building.Furthermore, I found out that the commit on
master
on which the GitHub release was done is actually different from the3.0.0
-tagged commit. One of the difference being, that the[project].version
value inpyproject.toml
of those two commits differ (3.0.0
vs3.0.0b1
). I suspect this was the cause of the differingversion
value in theCargo.lock
file.These differences, as noted in the code, led me to the use offetchCargoTarball
instead ofimportCargoLock
. The latter would require some manual string replacemend (e.g. inprePatch
phase), which I think complicates the override too much.EDIT: Apparently
fetchCargoTarball
still produces the same error (hash mismatch). My local builds were passing, but it seemed to be caused by some intermediate derivation not required for the final build. CI says otherwise, and when I run garbage collection, I bumped on the same error again. So now, I am usingimportCargoLock
with an explicitCargo.lock
file added as part of this MR. Turns out this simplifies the build, in that we do not need to download and patch the source tree anymore.Anyway, I hope this is useful ~ and feel free to critique, this is my first contribution to the repo 🙂.
Contribution checklist (recommended but not always applicable/required):