-
Notifications
You must be signed in to change notification settings - Fork 760
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
Use portable-atomic for targets which lack 64-bit atomics used to check interpreter ID. #3619
Conversation
…ck interpreter ID. I chose to make the dependency mandatory instead of optional as portable-atomic itself just forwards to the native atomics when they are available so making that choice part of our build system is not really necessary. Personally, I was unable to perceive any noticeable compile-time hit from adding it.
e7429f3
to
e6457c5
Compare
CodSpeed Performance ReportMerging #3619 will improve performances by 22.03%Comparing Summary
Benchmarks breakdown
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given this is a single dependency with no mandatory dependencies of its own I agree there's a good argument to having this be mandatory.
@alex I know you are keen to minimise dependencies, I think in this case it makes sense to add this one though?
Would it make sense for this to be a platform-specific dep?
If that's impractical, I understand. |
Is it really worth that complication for such a tiny dependency? Also, if we code that condition specific for the currently problematic platform, who's to say that there won't be another soon? I'd say, leave the cfg-ing in one spot, i.e. that crate itself. |
It's a bit unfortunate as But as I said, if doing the conditional dependency is impractical, I understand. |
Can we use |
I think that particular flag is out of scope for now due to requiring Rust 1.60, c.f. https://github.com/rust-lang/rust/blob/master/RELEASES.md#language-14 (I am also not sure if it works inside I am not against making this a conditional dependency but I would add that this somehow goes against Hence, if we really want a conditional dependency, I would prefer to just make it optional so that downstreams can enable it as a feature to get maximum portability. Or maybe even add it as a default feature so that downstream can opt out of the build time hit and the reproducibility issues generally associated with build scripts. So what do you think? Optional or not? Enabled by default or not? |
What do you think about just making it mandatory (i.e., leaving this PR as-is) for now, and then migrating to the |
Yes, we can certainly do that as well. I also checked and [target.'cfg(not(target_has_atomic = "64"))'.dependencies]
portable-atomic = "1.0" does work as expected on a current toolchain. |
That sounds good to me -- I suspect we can bump to 1.60 or even 1.63 very very soon :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me to merge this then, thanks everyone for figuring out a great way forward 👍
Would it be possible to have this backported to 0.20.x? |
Depends, @mgorny do you consider adding an additional dependency for a bugfix to be semver breaking? I deliberately skipped this out of caution, as my opinion was yes. As you're a packaging expert I'd be happy to listen to your opinion, especially as I agree this fix could be valuable. |
(I also had hoped to have 0.21 released months ago 👀) |
Well, I suppose it's a bit of a gray area. In general, I wouldn't consider it to be breaking, presuming that adding a new dependency doesn't break consumers. I'm not an expert on Rust but I think that the risk of breakage is minimal here. Worst case, you can revert and make another release, right? ;-) |
Sure thing, in which case I'll aim to look into shipping a patch release with both this and #3555 for 0.20 in the coming days. |
Thanks a lot! Hopefully we can get all the projects to update soonish and unblock the ppc32 queue on Gentoo. |
Sorry @mgorny this is not forgotten just had other stuff keep coming up and sickness in the family, we're now better though. I'm hoping to put this together over the weekend but I guess my past promise doesn't leave much faith in this hope either 🙈 |
Gentle ping. This is now blocking us from upgrading |
😞 This has taken longer than I wanted. Ideally I can get a final bugfix #3834 through review by tonight and then ship the combined patch release tomorrow or Friday. Please forgive the delay here; the work on the upcoming PyO3 0.21 has been consuming me (and that release is hopefully less than a couple weeks away too). |
As reported by Antoine Coutant on the Buildroot mailing list [1]: rpds depends on the crate pyo3. This crate uses "std::sync::atomic::AtomicI64" which doesn't exist for 32 bits targets. That leads to an error as reported by Buildroot Gitlab-ci. An issue have been opened on pyo3's github [2]. A fix have been accepted by pyo3 [3] and merged in pyo3 0.20.3 release [4]. This pyo3 0.20.3 uses crate portable-atomic [5] to provide atomic types and compare and swap operations for all targets that can use std. python-rpds-py 0.18.1 is the first release that use pyo3 0.20.3. Before python-rpds-py 0.18.1 release fixing this issue would require that we be able to patch a package during the Cargo vendoring step [6]. [1] http://lists.busybox.net/pipermail/buildroot/2024-February/684867.html [2]: PyO3/pyo3#3614 [3]: PyO3/pyo3#3619 [4]: https://github.com/PyO3/pyo3/blob/v0.20.3/CHANGELOG.md [5]: https://github.com/taiki-e/portable-atomic [6]: http://lists.busybox.net/pipermail/buildroot/2024-February/684886.html Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/6783811842 (TestPythonPy3Dtschema) https://gitlab.com/buildroot.org/buildroot/-/jobs/6783811860 (TestPythonPy3FlaskExpectsJson) Reported-by: Antoine Coutant <antoine.coutant@smile.fr> Cc: James Hilliard <james.hilliard1@gmail.com> Signed-off-by: Romain Naour <romain.naour@smile.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
As reported by Antoine Coutant on the Buildroot mailing list [1]: rpds depends on the crate pyo3. This crate uses "std::sync::atomic::AtomicI64" which doesn't exist for 32 bits targets. That leads to an error as reported by Buildroot Gitlab-ci. An issue have been opened on pyo3's github [2]. A fix have been accepted by pyo3 [3] and merged in pyo3 0.20.3 release [4]. This pyo3 0.20.3 uses crate portable-atomic [5] to provide atomic types and compare and swap operations for all targets that can use std. python-rpds-py 0.18.1 is the first release that use pyo3 0.20.3. Before python-rpds-py 0.18.1 release fixing this issue would require that we be able to patch a package during the Cargo vendoring step [6]. [1] http://lists.busybox.net/pipermail/buildroot/2024-February/684867.html [2]: PyO3/pyo3#3614 [3]: PyO3/pyo3#3619 [4]: https://github.com/PyO3/pyo3/blob/v0.20.3/CHANGELOG.md [5]: https://github.com/taiki-e/portable-atomic [6]: http://lists.busybox.net/pipermail/buildroot/2024-February/684886.html Fixes: https://gitlab.com/buildroot.org/buildroot/-/jobs/6783811842 (TestPythonPy3Dtschema) https://gitlab.com/buildroot.org/buildroot/-/jobs/6783811860 (TestPythonPy3FlaskExpectsJson) Reported-by: Antoine Coutant <antoine.coutant@smile.fr> Cc: James Hilliard <james.hilliard1@gmail.com> Signed-off-by: Romain Naour <romain.naour@smile.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> (cherry picked from commit 26b0540) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
I chose to make the dependency mandatory instead of optional as portable-atomic itself just forwards to the native atomics when they are available so making that choice part of our build system is not really necessary. Personally, I was unable to perceive any noticeable compile-time hit from adding it.
Closes #3614