这是indexloc提供的服务,不要输入任何密码
Skip to content

Libxml2 rebuilds: Part 2 - Small packages #24062

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

Merged
merged 35 commits into from
Apr 13, 2025

Conversation

TomJo2000
Copy link
Member

@TomJo2000 TomJo2000 commented Apr 1, 2025

  • Part of bump(main/libxml2): 2.14.1 #24059
  • main/appstream
  • main/aria2
  • main/at-spi2-core
  • main/cfengine
  • main/clamav
  • main/ctags
  • main/dcmtk
  • main/dnsutils
  • main/dvdauthor
  • main/ebook-tools
  • main/finch
  • main/gettext
  • main/icecast
  • main/imagemagick
  • main/lastpass-cli
  • main/lv2
  • main/mapserver
  • main/monetdb
  • main/netpbm
  • main/newsboat
  • main/nzbget
  • main/oathtool
  • main/openbabel
  • main/python-lxml
  • main/qalc
  • main/rdrview - patched
  • main/recoll
  • main/sc-im
  • main/spatialite-tools - pulled out into Libxml2 rebuilds: Part 1 - Libraries #24060
    (should be merged together with libspatialite)
  • main/squid
  • main/stoken
  • main/totem-pl-parser
  • main/uwsgi
  • main/xmlsec - pulled out into Libxml2 xmlsec #24211 due to flakey download source
  • main/xmlstarlet - patched
  • main/yuma123
  • root/nfs-utils
  • root/tshark

@TomJo2000 TomJo2000 requested a review from Grimler91 as a code owner April 1, 2025 02:36
@TomJo2000 TomJo2000 force-pushed the libxml2-rebuilds2 branch from dd48bc3 to f40161d Compare April 1, 2025 02:38
@robertkirkman
Copy link
Contributor

robertkirkman commented Apr 1, 2025

Downloading https://www.aleksey.com/xmlsec/download/xmlsec1-1.3.7.tar.gz curl: (22) The requested URL returned error: 403

It seems like it was a temporary server failure, since that file can be downloaded by my connection at the moment.

@robertkirkman
Copy link
Contributor

robertkirkman commented Apr 2, 2025

All packages in this branch are now building successfully.

  • rdrview: calls the function xmlShellPrintNode() multiple times, which has been removed in libxml2 2.14. I added a basic reimplementation of it in a patch as a polyfill by copying and pasting some of its definition from libxml2 2.13, when I test it (at runtime) it seems to work.
  • xmlstarlet: libxml2 now defines ATTRIBUTE_UNUSED in some sort of a different way, which conflicts with the definition xmlstarlet expects. Redefining ATTRIBUTE_UNUSED back to what it probably was before in xmlstarlet's header works to fix the build error.

@TomJo2000
Copy link
Member Author

Downloading https://www.aleksey.com/xmlsec/download/xmlsec1-1.3.7.tar.gz curl: (22) The requested URL returned error: 403

It seems like it was a temporary server failure, since that file can be downloaded by my connection at the moment.

Seems to be the case, but since it's still failing on the CI I'll pull xmlsec out of this batch with the next rebase of this branch.

@robertkirkman
Copy link
Contributor

It seems like https://www.aleksey.com/xmlsec/download/xmlsec1-1.3.7.tar.gz has a problem with intermittent service interruptions, since it keeps having error 403 only sometimes. That means that there is a risk of it having error 403 during the post-merge build and failing to upload to the package host. I am not sure what to do in this situation.

@TomJo2000
Copy link
Member Author

It seems like https://www.aleksey.com/xmlsec/download/xmlsec1-1.3.7.tar.gz has a problem with intermittent service interruptions, since it keeps having error 403 only sometimes. That means that there is a risk of it having error 403 during the post-merge build and failing to upload to the package host. I am not sure what to do in this situation.

That's why I'd like to pull it out into a separate PR and merge it last.

@TomJo2000 TomJo2000 force-pushed the libxml2-rebuilds2 branch 2 times, most recently from cdb535e to fd47441 Compare April 8, 2025 22:21
@robertkirkman
Copy link
Contributor

error: invalid command 'bdist_wheel'

This did not happen to me when I tested building it on april 1,
I will locally pull changes from master and build them again to try to reproduce it.

@TomJo2000
Copy link
Member Author

This did not happen to me when I tested building it on april 1, I will locally pull changes from master and build them again to try to reproduce it.

@robertkirkman
Copy link
Contributor

I do not know why the error happened yet, it is very strange because, this commit built successfully on April 5 in CI,

94e1ca3

but when I use git to check out that commit and then build python-lxml in a clean docker container, the error still happens. This indicates that the change which causes the error is either something that is not tracked by git in this repository, or is something that only happens when building locally, not in CI.

I can see that one difference is that the version of the python wheel package now being used by the termux-packages build system is now version 0.46+, while last week it was 0.45.1,

and in the changelog for wheel on PyPi version 0.46, there is this message:

https://github.com/pypa/wheel/releases/tag/0.46.0

"Removed the bdist_wheel setuptools command implementation and entry point. The wheel.bdist_wheel module is now just an alias to setuptools.command.bdist_wheel, emitting a deprecation warning on import."

This is pretty confusing since this is something newly happening and maybe not very many people are using wheel version 0.46+ yet, but it looks like this update of wheel is probably related to this error.

I will try to figure out if there is any way to resolve this error while using the new release of wheel and if so, then what the best way to change the termux-packages build system or python-lxml to be compatible with it might be.

@robertkirkman
Copy link
Contributor

According to the discussion of others who suddenly also have the same error in this issue,

it looks like we might need to bump our setuptools explicit version here,

build-pip install 'setuptools==67.6.1' wheel
cross-pip install 'setuptools==67.6.1' wheel

to a version that is at least 70 or newer to be updated to have compatibility with wheel version 0.46 or newer.

This would also be a good opportunity, in my opinion, to apply 763ef01 to TERMUX_ON_DEVICE_BUILD=true mode while working on this, since it was never applied to TERMUX_ON_DEVICE_BUILD=true mode, which would cause any modifications to termux_setup_python_pip() that do not correctly update the TERMUX_ON_DEVICE_BUILD=true codepath to continue to fail tests in that mode. I had been planning to do that for a long time but I did not get to it yet.

@TomJo2000
Copy link
Member Author

Sounds good.
I'll leave that to you.
I can pull python-lxml out of this batch so this can move ahead in the meantime tomorrow.

robertkirkman added a commit to robertkirkman/termux-packages that referenced this pull request Apr 9, 2025
- `wheel` version 0.46+ now requires `setuptools` version 70 or newer
  - discussed upstream here: pypa/wheel#660
  - discovered in termux-packages here: termux#24062 (comment)

- I have confirmed that this change works to fix the build of `python-lxml` **both**
  - **in `TERMUX_ON_DEVICE_BUILD=false` mode (broken for 1 week)**,
    - fixes `error: invalid command 'bdist_wheel'`
  - **and also in `TERMUX_ON_DEVICE_BUILD=true` mode (broken for 6 months)**.
    - fixes `ModuleNotFoundError: No module named 'setuptools'`

- It seems appropriate to remove the `if [ "${TERMUX_PYTHON_VERSION#*.}" -lt "12" ]` block because there is no longer any `python3.11` so it does not seem like that code is reachable anymore.
robertkirkman added a commit to robertkirkman/termux-packages that referenced this pull request Apr 9, 2025
- `wheel` version 0.46+ now requires `setuptools` version 70 or newer
  - discussed upstream here: pypa/wheel#660
  - discovered in termux-packages here: termux#24062 (comment)

- I have confirmed that this change works to fix the build of `python-lxml` **both**
  - **in `TERMUX_ON_DEVICE_BUILD=false` mode (broken for 1 week)**,
    - fixes `error: invalid command 'bdist_wheel'`
  - **and also in `TERMUX_ON_DEVICE_BUILD=true` mode (broken for 6 months)**.
    - fixes `ModuleNotFoundError: No module named 'setuptools'`

- It seems appropriate to remove the `if [ "${TERMUX_PYTHON_VERSION#*.}" -lt "12" ]` block because there is no longer any `python3.11` so it does not seem like that code is reachable anymore.

- `python-torchvision` needed ajustment of its custom `CFLAGS` to be `CXXFLAGS` instead, because the newer `setuptools` is now compiling it using `aarch64-linux-android-clang++` instead of `aarch64-linux-android-clang`.

- `python-pip` and `python-pillow` both had locked `setuptools` in their `TERMUX_PKG_PYTHON_COMMON_DEPS` at versions slightly newer than the old global version, now that the global version is newer than either of those, they do not seem to need that anymore.
robertkirkman added a commit to robertkirkman/termux-packages that referenced this pull request Apr 9, 2025
- `wheel` version 0.46+ now requires `setuptools` version 70 or newer
  - discussed upstream here: pypa/wheel#660
  - discovered in termux-packages here: termux#24062 (comment)

- I have confirmed that this change works to fix the build of `python-lxml` **both**
  - **in `TERMUX_ON_DEVICE_BUILD=false` mode (broken for 1 week)**,
    - fixes `error: invalid command 'bdist_wheel'`
  - **and also in `TERMUX_ON_DEVICE_BUILD=true` mode (broken for 6 months)**.
    - fixes `ModuleNotFoundError: No module named 'setuptools'`

- It seems appropriate to remove the `if [ "${TERMUX_PYTHON_VERSION#*.}" -lt "12" ]` block because there is no longer any `python3.11` so it does not seem like that code is reachable anymore.

- `python-torchvision` needed ajustment of its custom `CFLAGS` to be `CXXFLAGS` instead, because the newer `setuptools` is now compiling it using `aarch64-linux-android-clang++` instead of `aarch64-linux-android-clang`.

- `python-pip` and `python-pillow` both had locked `setuptools` in their `TERMUX_PKG_PYTHON_COMMON_DEPS` at versions slightly newer than the old global version, now that the global version is newer than either of those, they do not seem to need that anymore.
@robertkirkman
Copy link
Contributor

It will fail again I believe because this isn't merged yet,

sorry about that, if you want I can merge it now so you can build this.

@TomJo2000
Copy link
Member Author

It will fail again I believe because this isn't merged yet,

sorry about that, if you want I can merge it now so you can build this.

If #24213 is ready for merge I'd like to get the libxml2 rebuilds wrapped up.

@robertkirkman
Copy link
Contributor

What's weird now is that it stopped failing without the PR being merged,

I think this might have happened because wheel 0.46.1 has now been "yanked" on PyPi, which has externally manipulated the termux-packages termux_setup_python_pip() function such that it now only installs wheel 0.45.1 again instead of wheel 0.46.1 like it did a few days ago.

https://pypi.org/project/wheel/#history

The reason given in the description there is "Causes CI failures where setuptools is pinned to an old version".

Because of that, I guess the PR I opened doesn't necessarily need to be merged yet, so you can continue forward with this without worrying about that, and I can wait a bit longer before merging the PR.

@TomJo2000
Copy link
Member Author

What's weird now is that it stopped failing without the PR being merged,

I think this might have happened because wheel 0.46.1 has now been "yanked" on PyPi, which has externally manipulated the termux-packages termux_setup_python_pip() function such that it now only installs wheel 0.45.1 again instead of wheel 0.46.1 like it did a few days ago.

https://pypi.org/project/wheel/#history

The reason given in the description there is "Causes CI failures where setuptools is pinned to an old version".

Because of that, I guess the PR I opened doesn't necessarily need to be merged yet, so you can continue forward with this without worrying about that, and I can wait a bit longer before merging the PR.

I mean, it's good that they retracted it since it has CI issues.
But I don't like the idea that our termux_setup_python_pip function can be changed by an external change.

robertkirkman added a commit to robertkirkman/termux-packages that referenced this pull request Apr 12, 2025
- `wheel` version 0.46+ now requires `setuptools` version 70 or newer
  - discussed upstream here: pypa/wheel#660
  - discovered in termux-packages here: termux#24062 (comment)

- Lock `wheel` version at 0.46.1 so that if a future `wheel` update causes a similar problem in the future, it doesn't immediately propagate into termux-packages without us explicitly bumping it. Recommended by Tomjo2000 here: termux#24062 (comment)

- I have confirmed that this change works to fix the build of `python-lxml` **both**
  - **in `TERMUX_ON_DEVICE_BUILD=false` mode (broken temporarily for 1 week)**,
    - fixes `error: invalid command 'bdist_wheel'`
  - **and also in `TERMUX_ON_DEVICE_BUILD=true` mode (broken for 6 months)**.
    - fixes `ModuleNotFoundError: No module named 'setuptools'`

- It seems appropriate to remove the `if [ "${TERMUX_PYTHON_VERSION#*.}" -lt "12" ]` block because there is no longer any `python3.11` so it does not seem like that code is reachable anymore.

- `python-torchvision` needed ajustment of its custom `CFLAGS` to be `CXXFLAGS` instead, because the newer `setuptools` is now compiling it using `aarch64-linux-android-clang++` instead of `aarch64-linux-android-clang`.

- `python-pip` and `python-pillow` both had locked `setuptools` in their `TERMUX_PKG_PYTHON_COMMON_DEPS` at versions slightly newer than the old global version, now that the global version is newer than either of those, they do not seem to need that anymore.
robertkirkman added a commit to robertkirkman/termux-packages that referenced this pull request Apr 12, 2025
… wheel 0.46.1

- `wheel` version 0.46+ now requires `setuptools` version 70 or newer
  - discussed upstream here: pypa/wheel#660
  - discovered in termux-packages here: termux#24062 (comment)

- Lock `wheel` version at 0.46.1 so that if a future `wheel` update causes a similar problem in the future, it doesn't immediately propagate into termux-packages without us explicitly bumping it. Recommended by Tomjo2000 here: termux#24062 (comment)

- I have confirmed that this change works to fix the build of `python-lxml` **both**
  - **in `TERMUX_ON_DEVICE_BUILD=false` mode (broken temporarily for 1 week)**,
    - fixes `error: invalid command 'bdist_wheel'`
  - **and also in `TERMUX_ON_DEVICE_BUILD=true` mode (broken for 6 months)**.
    - fixes `ModuleNotFoundError: No module named 'setuptools'`

- It seems appropriate to remove the `if [ "${TERMUX_PYTHON_VERSION#*.}" -lt "12" ]` block because there is no longer any `python3.11` so it does not seem like that code is reachable anymore.

- `python-torchvision` needed ajustment of its custom `CFLAGS` to be `CXXFLAGS` instead, because the newer `setuptools` is now compiling it using `aarch64-linux-android-clang++` instead of `aarch64-linux-android-clang`.

- `python-pip` and `python-pillow` both had locked `setuptools` in their `TERMUX_PKG_PYTHON_COMMON_DEPS` at versions slightly newer than the old global version, now that the global version is newer than either of those, they do not seem to need that anymore.
TomJo2000 pushed a commit that referenced this pull request Apr 13, 2025
… wheel 0.46.1 (#24213)

- `wheel` version 0.46+ now requires `setuptools` version 70 or newer
  - discussed upstream here: pypa/wheel#660
  - discovered in termux-packages here: #24062 (comment)

- Lock `wheel` version at 0.46.1 so that if a future `wheel` update causes a similar problem in the future, it doesn't immediately propagate into termux-packages without us explicitly bumping it. Recommended by Tomjo2000 here: #24062 (comment)

- I have confirmed that this change works to fix the build of `python-lxml` **both**
  - **in `TERMUX_ON_DEVICE_BUILD=false` mode (broken temporarily for 1 week)**,
    - fixes `error: invalid command 'bdist_wheel'`
  - **and also in `TERMUX_ON_DEVICE_BUILD=true` mode (broken for 6 months)**.
    - fixes `ModuleNotFoundError: No module named 'setuptools'`

- It seems appropriate to remove the `if [ "${TERMUX_PYTHON_VERSION#*.}" -lt "12" ]` block because there is no longer any `python3.11` so it does not seem like that code is reachable anymore.

- `python-torchvision` needed ajustment of its custom `CFLAGS` to be `CXXFLAGS` instead, because the newer `setuptools` is now compiling it using `aarch64-linux-android-clang++` instead of `aarch64-linux-android-clang`.

- `python-pip` and `python-pillow` both had locked `setuptools` in their `TERMUX_PKG_PYTHON_COMMON_DEPS` at versions slightly newer than the old global version, now that the global version is newer than either of those, they do not seem to need that anymore.
@TomJo2000 TomJo2000 force-pushed the libxml2-rebuilds2 branch 2 times, most recently from 9257061 to ace7673 Compare April 13, 2025 21:55
TomJo2000 and others added 21 commits April 14, 2025 01:20
Add polyfill implementation of `xmlShellPrintNode()`
`libxml2` 2.14 has removed the function `xmlShellPrintNode()`, so this places a basic polyfill rewrite of it into the source code of `rdrview` 0.1.3 using code copied and pasted from the code that was removed from `libxml2`.

tested with the command `rdrview -B firefox https://repology.org/maintainers/`, it appears to be working the same as it was with `libxml2` 2.13.

Co-authored-by: Robert Kirkman <rkirkman@termux.dev>
fix build with `libxml2` 2.14

Fixes this error when building with libxml2 2.14
src/xml_pyx.c:203:36: error: expected ')'
  203 | pyxExternalSubsetHandler(void *ctx ATTRIBUTE_UNUSED, const xmlChar *name,
      |                                    ^

Probably has something to do with this commit in libxml2
GNOME/libxml2@208f27f

Co-authored-by: Robert Kirkman <rkirkman@termux.dev>
@TomJo2000 TomJo2000 merged commit 24a89a0 into termux:master Apr 13, 2025
4 of 9 checks passed
TomJo2000 added a commit to TomJo2000/termux-packages-prs that referenced this pull request May 5, 2025
TomJo2000 added a commit that referenced this pull request May 5, 2025
@TomJo2000 TomJo2000 deleted the libxml2-rebuilds2 branch June 8, 2025 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants