@micsnare the step by step answer is a few comments below yours, https://aur.archlinux.org/packages/python2-pycparser/#comment-845904
I posted cprn's comment so you can see their --asdeps
addition.
Git Clone URL: | https://aur.archlinux.org/python2-pycparser.git (read-only, click to copy) |
---|---|
Package Base: | python2-pycparser |
Description: | C parser and AST generator written in Python |
Upstream URL: | https://github.com/eliben/pycparser |
Licenses: | BSD |
Submitter: | bionade24 |
Maintainer: | matthewq337 |
Last Packager: | matthewq337 |
Votes: | 8 |
Popularity: | 0.032800 |
First Submitted: | 2022-01-08 16:10 (UTC) |
Last Updated: | 2024-06-30 19:35 (UTC) |
@micsnare the step by step answer is a few comments below yours, https://aur.archlinux.org/packages/python2-pycparser/#comment-845904
I posted cprn's comment so you can see their --asdeps
addition.
@micsnare it'd probably be better to ask such question in the forum. Anyway: If not using aur helper, just clone the git repo, download diff file, apply the diff (git apply <diff filename>), and run makepkg (probably makepkg -si). If using aur helper, it has to have an option to edit PKGBUILD, e.g. yay has '--editmenu'; with this option it will ask for PKGBUILDs to edit. I don't know of any way of applying patch like that, it may be necessary to just edit PKGBUILD by hand (so that check() looks like in my previous comment).
@brainmue turns out virtualenv is included in python since 3.3, so it probably isn't necessary. If it really is, it could be a check dependency instead of a runtime one.
Btw, I've since discovered that on my system python2-pycparser was only needed because of dependency chain that led to python2-pip, which I don't need, so I just removed all of that. Might be the case for someone else as well.
Hello there,
does anyone have a step-by-step guide on how to resolve this issue? I'm sorry, but I'm new to arch and don't quite understand the steps to fix this (with virtualenv) and the DIFF file.
does anyone care to explain it a little further?
@ja2142 Thanks that works great.
The one DIFF file: https://notebin.de/?b0f0ab95502edcea#4gqp5VMR9jn8ziXmitVDjP7zpL4kvC1tzkFL7e4UERx9
I also have the same problem with tests failing as reported below. I know, building in chroot should work, but I'd say packages should just be installable without any additional setup, don't you agree? Especially since from what I've learned, it seems like this package kind of conflicts with itself when upgrading - when I tried to upgrade, tests were failing, but uninstalling the package and installing it again succeeded (also taking source from git, tests failed only when python2-pycparser is installed, with paths from installed version in stacktrace). That also explains why using chroot works.
The problem is easily solvable by running tests in virtual env:
check() {
cd "$srcdir"/pycparser-release_v$pkgver
virtualenv -p /usr/bin/python2 venv
./venv/bin/python2 -m unittest discover
}
Though virtualenv might be an additional dependency?
Also, ply is already included in pycparser, so I think python2-ply dependency is superfluous.
For anyone that want to upgrade this package without bothering with chrooting: uninstalling first should help.
Right, same here. I had to force remove python2-pycparser before updating it to the new one. The tests should somehow force loading of the newly built package and not any system package. Or, just skip running the tests.
I have an error already reported here. After yay -Suuyy I got
aur/python2-pycparser 2.20-3 -> 2.21-1
but during the installation I got
`====================================================================== FAIL: test_all_examples (tests.test_examples.TestExamplesSucceed)
Traceback (most recent call last): File "/media/data/users/home/marco/.cache/yay/python2-pycparser/src/pycparser-release_v2.21/tests/test_examples.py", line 29, in test_all_examples rc, 0, 'example "{}" failed with stdout =\n{}'.format(filename, stdout)) AssertionError: example "using_gcc_E_libc.py" failed with stdout =
Ran 130 tests in 1.326s
FAILED (failures=1) ==> ERROR: A failure occurred in check(). Aborting... -> errore nella creazione: python2-pycparser `
Thanks to "bionade24 commented on 2022-01-08 21:34" but the script has to go to be available, without any hand-made fix.
Solutions?
df8oe's solution for AssertionError: example "using_cpp_libc.py" failed with stdout =
works but if you want the package to be automatically removed when orphaned in the future ad --asdeps
like so:
yay -Rdd python2-pycparser
yay -S --asdeps python2-pycparser
Building python2-pycparser...
==> Making package: python2-pycparser 2.21-1 (seg 10 jan 2022 13:26:15)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found python2-pycparser-2.21.tar.gz
==> Validating source files with sha512sums...
python2-pycparser-2.21.tar.gz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
-> Extracting python2-pycparser-2.21.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...
running build
running build_py
creating build
creating build/lib
creating build/lib/pycparser
copying pycparser/__init__.py -> build/lib/pycparser
copying pycparser/c_parser.py -> build/lib/pycparser
copying pycparser/plyparser.py -> build/lib/pycparser
copying pycparser/c_generator.py -> build/lib/pycparser
copying pycparser/ast_transforms.py -> build/lib/pycparser
copying pycparser/_ast_gen.py -> build/lib/pycparser
copying pycparser/_build_tables.py -> build/lib/pycparser
copying pycparser/c_lexer.py -> build/lib/pycparser
copying pycparser/c_ast.py -> build/lib/pycparser
creating build/lib/pycparser/ply
copying pycparser/ply/cpp.py -> build/lib/pycparser/ply
copying pycparser/ply/__init__.py -> build/lib/pycparser/ply
copying pycparser/ply/ygen.py -> build/lib/pycparser/ply
copying pycparser/ply/yacc.py -> build/lib/pycparser/ply
copying pycparser/ply/ctokens.py -> build/lib/pycparser/ply
copying pycparser/ply/lex.py -> build/lib/pycparser/ply
copying pycparser/_c_ast.cfg -> build/lib/pycparser
==> Starting check()...
Generating LALR tables
WARNING: 79 shift/reduce conflicts
WARNING: 37 reduce/reduce conflicts
WARNING: reduce/reduce conflict in state 27 resolved using rule (type_specifier -> atomic_specifier)
WARNING: rejected rule (empty -> <empty>) in state 27
WARNING: reduce/reduce conflict in state 87 resolved using rule (type_specifier -> atomic_specifier)
WARNING: rejected rule (empty -> <empty>) in state 87
WARNING: reduce/reduce conflict in state 437 resolved using rule (statement -> pppragma_directive)
WARNING: rejected rule (empty -> <empty>) in state 437
F.................................................................................................................................
======================================================================
FAIL: test_all_examples (tests.test_examples.TestExamplesSucceed)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/var/tmp/pamac-build-sardaukar/python2-pycparser/src/pycparser-release_v2.21/tests/test_examples.py", line 29, in test_all_examples
rc, 0, 'example "{}" failed with stdout =\n{}'.format(filename, stdout))
AssertionError: example "using_cpp_libc.py" failed with stdout =
----------------------------------------------------------------------
Ran 130 tests in 0.624s
FAILED (failures=1)
==> ERROR: A failure occurred in check().
Aborting...
Pinned Comments
bionade24 commented on 2022-01-08 20:34 (UTC) (edited on 2022-01-08 20:40 (UTC) by bionade24)
If building the package fails for you, either build in a clean chroot or disable the tests, but at your own risk that the functionality will be faulty.
This package builds fine in a clean chroot: https://abs-cd.oscloud.info/cd_manager/python2-pycparser
This package is also available in my unofficial user repo: https://wiki.archlinux.org/title/Unofficial_user_repositories#oscloud