-
Notifications
You must be signed in to change notification settings - Fork 16
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
Maintenance of clang-format wheel? #4
Comments
Hi @mgevaert, I noticed there hasn't been much GitHub activity in a few
years or updates to the clang-format PyPI wheel in a few years. Are you
around to accept PRs and make releases on PyPI? If not, would you be
willing to add me to the PyPI project?
I'm very much willing to accept PRs, especially for platforms that I don't
have much experience with.
I'm interested in getting the package updated to include wheels for newer
versions of clang-format, along with binary wheels for macOS and Windows
That sounds great, looking forward to any PRs.
it would be much more convenient to use with pre-commit hooks than a
Docker image (not to mention the new pre-commit.ci service doesn't support
docker)
Interesting, at the time, GH Actions were pretty new, so that's what I went
with.
I've been using https://cibuildwheel.readthedocs.io/en/stable/ for other
projects, and that's probably what I'd use now.
pre-commit.ci is something I wanted to look into, so I'm game (asottile
does nice work.)
part of this would involve getting working sdist that can build
clang-format on Windows/Linux/macOS, and setting up GitHub actions build
and publish binary wheels for those platforms to PyPI.
The llvm+clang source tree is pretty enormous, so I'm not sure this will
work, but it's worth a shot.
The itch I scratched with this was a small wheel w/ few dependencies for
linux.
Part of the reason for not doing macOS/Windows was that there were binaries
available, so it didn't seem as pressing.
I did put in a bunch of effort into macOS ones, but IIRC, I couldn't build
it staticially across all the versions I wanted to support, and I found the
final package size to be large.
At the time, I pondered if it would make sense to take apart and wrap the
macOS & windows binaries, but IIRC they didn't always release them -
perhaps that's changed now.
Finally, I'm wary of supply-chain attacks, which is why I try to make the
building process as transparent as possible, FYI.
Thanks for your interest!
|
Hey @mgevaert @nightlark The approach has some advantages:
I am open to any feedback regarding my approach. If you like it, we can work out a roadmap of how to proceed with it. |
Hey @dokempf that looks awesome! That's pretty much the exact same approach I had in mind. The 20-30 minutes for a native build seems pretty reasonable.. I think I was expecting them to take closer to the 3 hours like the cross-compiled arm/ppc/s390 builds. Do you want me to make PRs to your repo for now? |
Very nice! Distribution size is svelte; and the build time is way faster than when I tried on a local old mac the first time I tried this. |
@dokempf: I had a chance to look at your wheel; can you comment on what the version scheme is? The test pypi has I think having the version match the clang version would be helpful. In addition, having the wheels for different versions of clang-format would be good; how hard would it be to release the previous versions? Thanks! |
I think a version scheme similar to other packaging projects (PyPI CMake/ninja) would work where the version is I have a PR open for versioneer to make it handle cases where a tagged version already contains a post release segment, but I think with that patch it should be useable for handling clang-format-wheel versioning. If the clang build system hasn't changed, it should be easy to release previous versions by making a branch that pulls the source tree from the old version and tagging a release -- those could either be kept around or cleaned up by merging to main using --ours to ignore the version number change used to create the old release. |
I tried out building a manylinux1 compatible wheel, but the 12.0.1 version of clang-format requires a host gcc version of at least 5.1; it might be possible to build a manylinux1 compatible wheel for an older clang-format. Though now there should hardly be anyone running such an old OS. |
Cool, that's how I was doing the original ones, and I think it makes the most sense.
I don't think we need to target |
The |
FYI, besides cibuildwheel (which was mentioned Edit: already in use in the fork, nice), I'd also recommend using the normal CMake package, as we've been supporting manylinux1 for quite a while now - and if you go to manylinux2010, then even more reason to not bother with building CMake. You can also look at the cmake or ninja packages for a wheel rename script that correctly does the tag change in the wheel - I'm planning to make a PR to wheel in the near future to make that easier (initial design was well received), cibuildwheel might gain enhanced support for that in the future too. Please use |
PS: the main reason to do Or better yet, just use PyPA's Manylinux1 images will be discontinued Jan 1, 2022. |
@henryiii Thanks for the input! With the discontinuation of |
@mgevaert I think it is time to discuss the mode and timeline of putting the new version into production. I did rewrite the project from scratch, which leaves us with the open question of future maintainership. Here are two very different takes on it:
I am fine with both of above solutions and most likely also with some compromise in between. If you decide not to adopt it at all, I might at some point publish it under a different name on PyPI though. |
@henryiii where is the proposal for the feature getting added to wheel? With the way the platform tag is getting set right now we don't need any renaming script -- I think ideally wheel would have an option to override the platform tags using a config file (pyproject.toml section?) so that wheels automatically built in other package repositories will also get the right tags set. As far as I can tell piwheels.org (and any similar package repositories that might be out there) don't provide a way to pass command line arguments to the build wheel command, so a config file option could be the only way to set the tags. |
I think @henryiii is referring to this: pypa/wheel#407 |
It's not a perfect or final solution (a config setting would be best, ideally in pyproject.toml), it would allow this common need to be done after-the-build, which currently is not easy to do. Though I see you've set this using setup.py customization, that's fine too. There are other reasons to do this though, such as adding native compatibility tags to universal2 wheels, etc. |
Thanks for the suggestion/offer! I think this is a good solution - the If, for whatever reason, it turns out that it needs to be 'un-transferred', I'd like the project to be transferred back to me, but other than that, let's move forward with that solution. Thanks to everyone else for the input on this ticket, it's greatly appreciated. |
Thanks to @mgevaert for the trust and all the maintenance work you put into this in the past. Here is my TODO list for the transition process: Missing Implementation:
Infrastructure:
Publish versions (skipping over outdated patch releases):
|
I tried out building 10.0.1 on GitHub Actions, and the qemu jobs hit the 6 hour timeout limit, while jobs for other versions queued around the same time finished in the usual ~4 hours. It might have been bad luck with slow VMs, though it could be that the older versions just take longer to build (maybe some options can be adjusted to speed up the process). |
You can manually build & upload the QEMU wheels locally if you want to, FYI. I've not had success doing QEMU from macOS, but a few of the CMake wheels were uploaded from Linux when we had Travis credit problems (before moving to emulation on GHA). |
Add option to skip running qemu builds in GHA workflow
It looks like pip installing 12.0.1 on my systems is working -- I think this issue can probably be closed now. |
I have finalized the transition and built the missing packages for versions 10, 11 and 12. There is one exception: The wheels that require emulation are only available for version 12, as LLVM changed its dependency structure (the number of necessary compilation units dropped by 30%) such that version 12 can be built within the 6 hour time limit of GHA, while previous versions couldn't. I am currently not planning to work a lot on older builds (diminishing returns) - please switch to newer versions of Thanks to everybody who participated in this process (@mgevaert @nightlark @henryiii ). Please use the packages, recommend them to others and report any issues you might find. |
Hi @mgevaert, I noticed there hasn't been much GitHub activity in a few years or updates to the clang-format PyPI wheel in a few years. Are you around to accept PRs and make releases on PyPI? If not, would you be willing to add me to the PyPI project?
I'm interested in getting the package updated to include wheels for newer versions of clang-format, along with binary wheels for macOS and Windows -- it would be much more convenient to use with pre-commit hooks than a Docker image (not to mention the new pre-commit.ci service doesn't support docker); part of this would involve getting working sdist that can build clang-format on Windows/Linux/macOS, and setting up GitHub actions build and publish binary wheels for those platforms to PyPI.
Regards,
Ryan
(I sent an email to the one listed on PyPI for the wheel, though I wasn't sure if you still own the name due to the expired SSL cert)
The text was updated successfully, but these errors were encountered: