-
Notifications
You must be signed in to change notification settings - Fork 490
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
6 python tests failing in 3.3.0 #2302
Comments
The first is:
So some commodities are different. XDC becomes XC. And the Unicode characters are missing. (The code says Hmm, the errors are all different. Another one is:
It doesn't find the name with the ending Ah, same here:
I wonder if the $PATH is very long in the build environment and the filename gets cut off. And another one:
and one more:
So, in summary, there appear to be two distinct issues:
|
Debian unstable has Python 3.11.4. I wonder what the GitHub CI is using... |
Hm, possibly 3.11.5 on macOS. @afh are you around? |
@afh I looked at the log @bremner mentioned: http://qa-logs.debian.net/2023/10/27/ledger_3.3.0-4_unstable.log |
ℹ️ @tbm GitHub CI seems to be testing with Python 3.10.12 on ℹ️ The full log informs "I: NOTICE: Log filtering will replace 'build/ledger-LYcYiL/ledger-3.3.0' with '<>'", which seems to be a path of reasonable length. ❓ @bremner Are the test failures on Debian un/stable also observed with ledger 3.3.2? ❓ Is it possible to get an archive of the build directory (e.g. ❓ Is a build history for ledger on Debian available from which one can see when tests started to fail and what may have changed in ledger or the test environment? |
Alexis Hildebrandt ***@***.***> writes:
❓ @bremner Are the test failures on Debian un/stable also observed with [ledger 3.3.2](https://github.com/ledger/ledger/releases/tag/v3.3.2)?
Yes, I just duplicated the failures with 3.3.2
❓ Is it possible to get an archive of the build directory (e.g. `build/ledger-LYcYiL/ledger-3.3.0`) for closer inspection?
Sure, but it's likely to be pretty large (and contained dynamically
linked executables). How would you like to receive it?
❓ Is a build history for ledger on Debian available from which one can see when tests started to fail and what may have changed in ledger or the test environment?
I just have the one previous successful build of 3.3.0
https://buildd.debian.org/status/fetch.php?pkg=ledger&arch=amd64&ver=3.3.0-4&stamp=1690458256&raw=0
|
😢 This might hint at an issue with the test environment. Anything Debian-specific or unusual that comes to your mind, @bremner?
Depending on the size via e-mail (< ~50MB) or a public download link from a server you have access to or a file-sharing service that does not require sign-in.
🙏 Taking a look… |
Alexis Hildebrandt ***@***.***> writes:
> Yes, I just duplicated the failures with 3.3.2
😢 This might hint at an issue with the test environment. Anything Debian-specific or unusual that comes to your mind, @bremner?
No, this is in a current debian unstable chroot.
> Sure, but it's likely to be pretty large (and contained dynamically
linked executables). How would you like to receive it?
Depending on the size via e-mail (< ~50MB) or a public download link from a server you have access to or a file-sharing service that does not require sign-in.
The build dir for 3.3.0 is temporarily available from
https://people.debian.org/~bremner/ledger.tar.xz
please let me know when you have retrieved it
|
Thanks, @bremner, I have retrieved it. |
After digging through Ledger's tests I've understood what parts are involved to run the tests and I assume the error may surface in the Python interface, though I'm not sure and not sure how to best verify this. In the following snippet the filepath argument to the Could the used locale (
At @bremner do you have access to a Debian Unstable system and would be able to compile ledger from source and run the following from a ledger repo clone?
/cc @jwiegley |
Alexis Hildebrandt ***@***.***> writes:
At @bremner do you have access to a Debian Unstable system and would be able to compile ledger from source and run the following from a ledger repo clone?
`python test/RegressTests.py $PATH_TO_BUILD/ledger . ./test/regress/4D9288AE_py.test`
/cc @jwiegley
Looks quite similar (this is in a debian unstable chroot on a debian
testing system, but I would be surprised if that matters).
***@***.***:~/ledger-upstream$ python test/RegressTests.py ./ledger . ./test/regress/4D9288AE_py.test
FAILURE in output from ./test/regress/4D9288AE_py.test:
--
$ledger -f "/home/bremner/ledger-upstream/test/regress/4D9288AE_py.test" python test/regress/4D9288AE.py
…--
@@ -1 +0,0 @@
-None
FAILURE in error output from ./test/regress/4D9288AE_py.test:
--
$ledger -f "/home/bremner/ledger-upstream/test/regress/4D9288AE_py.test" python test/regress/4D9288AE.py
--
@@ -0,0 +1,6 @@
+Traceback (most recent call last):
+ File "/home/bremner/ledger-upstream/test/regress/4D9288AE.py", line 3, in <module>
+ for post in ledger.read_journal("test/regress/4D9288AE.dat").query("^expenses:"):
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+RuntimeError: Cannot read journal file "/home/bremner/ledger-upstream/test/regress/4D9288AE.da"
+Error: Failed to execute Python module
FAILURE in exit code (0 != 1) from ./test/regress/4D9288AE_py.test:
--
$ledger -f "/home/bremner/ledger-upstream/test/regress/4D9288AE_py.test" python test/regress/4D9288AE.py
--
E[4D9288AE_py.test]
FAILED (1)
It seems that something is unconditionally cutting off the last
character in the path name
If I run
import ledger
l=ledger.read_journal("test/regress/4D9288AE.datt")
it works fine (or whatever character I pad with).
This is all with commit 14db8c8
|
Thanks @bremner, that's helpful. I've installed Debian 12 (stable) in a virtual machine and am unable to reproduce the issue so far. I'll look to switching to debian unstable tomorrow. Any other info that you could provide that could help me get an environment up and running with which the issue can be reproduced would be very much appreciated. |
After an update to Debian unstable all ledger tests continue to succeed for me and I am unable to reproduce the reported issue. Here is how I set up my testing/debugging environment:
sudo sed -i'' -e 's/bookworm /unstable /g' /etc/apt/sources.list
sudo apt update && sudo apt -y full-upgrade full-upgrade ran into errors while processing linux-image-6.5.0-5-arm64 and linux-image-arm64
git clone https://github.com/ledger/ledger.git
cd ledger
cmake -Bbuild -S. -DUSE_PYTHON:BOOL=ON
make -j4 -Cbuild
make -j4 -Cbuild test
…
100% tests passed, 0 tests failed out of 424
python3 test/RegressTests.py -l ./build/ledger -s . ./test/regress/4D9288AE_py.test
.
OK (1) Note The latest changes on ledger @bremner How does the above setup differ from your or the Debian testing chroot setup and how can I mimick it? |
ℹ️ Tested with |
My output is:
|
Alexis Hildebrandt ***@***.***> writes:
After an update to Debian unstable all ledger tests continue to succeed for me and I am unable to reproduce the reported issue.
Here is how I set up my testing/debugging environment:
On a debian testing host, I was able to duplicate your success in a
debian unstable chroot
* create the chroot (unfortunately this requires schroot be configured,
but for the record)
$ schroot -c sid -n ledger -b
* Install ledger dependencies:
```
sudo apt-get -y install git g++ cmake boost1.74 libmpfr-dev libgmp-dev libicu-dev
```
Here I ran
$ sudo schroot -c ledger -r apt-get install git g++ cmake boost1.74 libmpfr-dev libgmp-dev libicu-dev
then
$ schroot -c ledger -r
and followed your steps inside the chroot.
* Clone ledger repository
```sh
git clone https://github.com/ledger/ledger.git
```
* Change working directory to local ledger clone
```sh
cd ledger
```
* Configure build
```sh
cmake -Bbuild -S. -DUSE_PYTHON:BOOL=ON
```
* Build ledger
```sh
make -j4 -Cbuild
```
* Run tests
```sh
make -j4 -Cbuild test
…
100% tests passed, 0 tests failed out of 424
```
* Run exemplary failing test:
```sh
python3 test/RegressTests.py -l ./build/ledger -s . ./test/regress/4D9288AE_py.test
.
OK (1)
```
>[!NOTE]
> The latest changes on ledger `master` branch changed the test scripts (inlcuding `RegressTests.py`) to use command-line options (`-l` and `-s`) instead of positional arguments to align with the `CheckManpage.py` and `CheckTexinfo.py` scripts. To test using a previous versions of ledgers test suite run python3 test/RegressTests.py ./build/ledger . ./test/regress/4D9288AE_py.test
@bremner How does the above setup differ from your or the Debian testing chroot setup and how can I mimick it?
There are a bunch of extra build-dependencies in the debian package of
ledger. It seems like one of these is causing the problem.
I ran
$ sudo schroot -c ledger -r apt build-dep ledger
and then repeated your steps, and I get the same failures as before.
The explicit list of build-dependencies is
cmake, debhelper-compat (= 12), dh-python, \
libboost-date-time-dev, libboost-filesystem-dev, \
libboost-iostreams-dev, libboost-python-dev, \
libboost-regex-dev, libboost-serialization-dev, \
libboost-test-dev, libexpat1-dev, libgmp3-dev, \
libmpfr-dev, libofx-dev, libpcre2-dev, libutfcpp-dev, \
man2html-base, python3-dev, texinfo, texlive, tzdata
I don't know if it is significant, but that uses libutfcpp 3.2.5 from
Debian. That _seems_ to be more recent (Sept 2023) than the embedded version, but I
did not verify the hash.
|
John Wiegley ***@***.***> writes:
--
@@ -0,0 +1 @@
+Error: Unrecognized command 'python'
FAILURE in exit code (0 != 1) from ./test/regress/4D9288AE_py.test:
--
$ledger -f "/Users/johnw/src/ledger/master/test/regress/4D9288AE_py.test" python test/regress/4D9288AE.py
That's what I got when I didn't enable python with -DUSE_PYTHON:BOOL=ON
|
David Bremner ***@***.***> writes:
I don't know if it is significant, but that uses libutfcpp 3.2.5 from
Debian. That _seems_ to be more recent (Sept 2023) than the embedded version, but I
did not verify the hash.
I just confirmed that "apt install libtutfcpp-dev" on top of the
dependencies you mentioned triggers that failures. So it seems ledger is
incompatible with newer utfcpp?
d
|
Thanks for confirming, @bremner. I am now able to reproduce the issue in my Debian unstable VM 🎉 I'll have a closer look at newer versions of utfcpp and what changed between them. Ledger contains the 3.2.2 source, Debian unstable offers 3.2.5 and the latest release is 4.0.3. Off-topic: In case it has slipped your attention I'd appreciate your thoughts on #2313, which adds support for installing Debian Trixie dependencies via ledger's |
If I've tested properly the issue first appears when using utfcpp v3.2.5 and disappears again when using utfcpp v4.0.1. Anyone see what could be the cause for the issue when looking at What's the best way forward on this?
What are your thoughts and ideas @bremner, @jwiegley, @tbm? Update: I've raised this upstream |
Alexis Hildebrandt ***@***.***> writes:
If I've tested properly the issue first appears when using utfcpp [v3.2.5](https://github.com/nemtrif/utfcpp/releases/tag/v3.2.5) and disappears again when using utfcpp [v4.0.1](https://github.com/nemtrif/utfcpp/releases/tag/v4.0.1).
* Can debian update utfcpp to at least 4.0.1? Will this be enough for current stable and testing?
* Can we find a quick and maintainable fix?
* Should ledger drop support for third-party packaged utfcpp and simply maintain its own version from here on?
Updating utfcpp in debian should be doable. There might be a slight gap
where ledger gets dropped from testing, but it will be fine with respect
to the next stable release. I will ask the utfcpp maintainer to upgrade [1].
I hope that ledger continues to support third party utfcpp, although
since it's a header only library, the arguments against embedding are
somewhat less compelling.
[1]: you can follow the upgrade discussion at
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1057732
|
That's good news, @bremner and thanks for asking the Debian maintainer of utfcpp. Any specific reason why the request is to update utfcpp in Debian to 4.0.1 instead of the current latest version 4.0.3? Your voice is appreciated and heard regarding ledger supporting third-party utfcpp. Just to understand the motivation for not embedding, what are the benefits from a distribution's point of view? ℹ️ Checking the utfcpp release notes the following two issues are mentioned and seem related to the observed misbehaviour: |
The author of nemtrif/utfcpp suggests:
@jwiegley what was the initial motivation for using the unchecked variant? |
Alexis Hildebrandt ***@***.***> writes:
That's good news, @bremner and thanks for asking the Debian maintainer of utfcpp. Any specific reason why the request is to update utfcpp in Debian to 4.0.1 instead of the current latest version 4.0.3?
I just read that 4.0.1 fixed it, missed that newer ones were
available. I've updated the Debian bug.
Your voice is appreciated and heard regarding ledger supporting
third-party utfcpp. Just to understand the motivation for not
embedding, what are the benefits from a distribution's point of view?
It makes it easier for distros to deal with security issues, since only
a rebuild against the fixed library (in this case utfcpp) is needed,
rather than a new release or patching of the client package (in this
case ledger).
d
|
@bremner if I remember correctly Debian does maintain its own patches for some of its packages. Is this still the case and would it be feasible for Debian to apply the following patch (fix_utfcpp_3.2.5_regression.patch) to ledger as long as Debian ships with utfcpp 3.2.5? And would this avoid ledger being dropped from testing? |
Debian utfcpp packager here. While the best way might be upgrading Debian's utfcpp to 4.0.x, some other Debian's software will encounter build failures when using utfcpp 4.0.x so that won't happen immediately. I plan to downgrade Debian's utfcpp to 3.2.4 for now, and later eventually upgrade Debian's utfcpp to 4.x series when all software are compatible with utfcpp 4.0.x. I believe further coordination is definitely needed; just let me know if I can further help. |
Hi @hosiet, welcome to the conversation and thanks for chiming in 👋🙂 Downgrading Debian's utfcpp 3.2.4 for testing and adressing any build failures with utfcpp 4.0.x later down the line seems very reasonable to me. I'd appreciate if you could leave a quick note here once the downgrade has happened. Out of curiosity which other Debian packages make use of utfcpp and which ones break using utfcpp 4.0.x? FYI: Ledger is upgrading to utfcpp 4.0.3 (see #2315) with the next release and is already compatible with it. |
Thanks. The downgrade to utfcpp 3.2.4 has now happened. For more information, please see https://tracker.debian.org/pkg/utfcpp . Just in case you are curious, the other software that breaks with utfcpp 4.0.x in Debian is apertium/apertium#193 . |
That's great to hear, @hosiet. Thanks for moving so quickly on this and raising awareness for the issue with apertium. |
@bremner thanks for the context on why distros prefer programs to link to libutfcpp, that makes a lot of sense. A few things that are on my mind:
|
Alexis Hildebrandt ***@***.***> writes:
A few things that are on my mind:
1. Where can I follow Debian ledger builds with the downgraded utfcpp?
https://tests.reproducible-builds.org/debian/rb-pkg/unstable/amd64/ledger.html
I didn't figure out how to trigger rebuilds, I guess they should happen eventually.
2. What needs to happen, so that the Debian bug
[#1054728](https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054728)
and this bug can be closed?
I (just) closed this bug based on a local rebuild.
3. Are there plans to update Debian ledger to 3.3.2?
Yes, I just did that; I was waiting for the situation with 3.3.0 to
clarify.
4. Is there anything else that is open and that I could help with?
I should really create an github issue for
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1039736
I haven't had a chance to check the existing issues for duplication.
|
There are many open bugs about |
Thanks, @bremner for the update and already closing the Debian bug #1054728. I'm looking forward to seeing ledger 3.3.2 in Debian in the future :) The link to the Debian ledger builds you shared mentions a Another thank you for mentioning Debian Bug #1039736; a quick search shows issue #604 could be related, would you agree? |
I really don't remember, maybe just speed. |
Ledger is currently scheduled to be removed from the next stable release of Debian due to the following failing tests in ledger 3.3.0. Full log is at 1, extract containing tests is at 2.
The text was updated successfully, but these errors were encountered: