Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1949450 - sudo fails to build with Python 3.10: test failures
Summary: sudo fails to build with Python 3.10: test failures
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: sudo
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Radovan Sroka
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2021-04-14 10:10 UTC by Tomáš Hrnčiar
Modified: 2021-06-06 22:21 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-06 22:21:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2021-04-14 10:10:50 UTC
sudo fails to build with Python 3.10.0a7.

cvtsudoers: 35/35 tests passed; 0/35 tests failed
make[1]: Leaving directory '/builddir/build/BUILD/sudo-1.9.5p2/plugins/sudoers'
make[1]: Entering directory '/builddir/build/BUILD/sudo-1.9.5p2/plugins/system_group'
make[1]: Nothing to be done for 'check'.
make[1]: Leaving directory '/builddir/build/BUILD/sudo-1.9.5p2/plugins/system_group'
make[1]: Entering directory '/builddir/build/BUILD/sudo-1.9.5p2/plugins/python'
gcc -c -I../../include -I../.. -I../.. -DPLUGIN_DIR=\"/usr/libexec/sudo\" -DSRC_DIR=\"/builddir/build/BUILD/sudo-1.9.5p2/plugins/python\" -DZLIB_CONST -D_FORTIFY_SOURCE=2 -I/usr/include/python3.10  -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fpie -fvisibility=hidden  -fPIE -fstack-protector-strong ./regress/check_python_examples.c
gcc -c -I../../include -I../.. -I../.. -DPLUGIN_DIR=\"/usr/libexec/sudo\" -DSRC_DIR=\"/builddir/build/BUILD/sudo-1.9.5p2/plugins/python\" -DZLIB_CONST -D_FORTIFY_SOURCE=2 -I/usr/include/python3.10  -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fpie -fvisibility=hidden  -fPIE -fstack-protector-strong ./regress/iohelpers.c
gcc -c -I../../include -I../.. -I../.. -DPLUGIN_DIR=\"/usr/libexec/sudo\" -DSRC_DIR=\"/builddir/build/BUILD/sudo-1.9.5p2/plugins/python\" -DZLIB_CONST -D_FORTIFY_SOURCE=2 -I/usr/include/python3.10  -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64  -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fpie -fvisibility=hidden  -fPIE -fstack-protector-strong ./regress/testhelpers.c
/bin/sh ../../libtool --tag=disable-static --mode=link gcc -o check_python_examples check_python_examples.o iohelpers.o testhelpers.o pyhelpers.lo sudo_python_debug.lo -pie -Wl,-z,relro -Wl,-z,now -Wl,--enable-new-dtags -L/usr/lib64 -lpython3.10 -lcrypt -lpthread -ldl -lutil -lm -lm   -Wc,-fPIE -pie -Wc,-fstack-protector-strong ../../lib/util/libsudo_util.la
libtool: link: gcc -o .libs/check_python_examples check_python_examples.o iohelpers.o testhelpers.o .libs/pyhelpers.o .libs/sudo_python_debug.o -pie -Wl,-z -Wl,relro -Wl,-z -Wl,now -Wl,--enable-new-dtags -fPIE -pie -fstack-protector-strong  -L/usr/lib64 -lpython3.10 -lcrypt -lutil -lm ../../lib/util/.libs/libsudo_util.so -lcrypto -lz -lpthread -ldl -pthread -Wl,-rpath -Wl,/usr/libexec/sudo
Running test check_example_io_plugin_version_display(true) ... 
Running test check_example_io_plugin_version_display(false) ... 
Running test check_example_io_plugin_command_log() ... 
Running test check_example_io_plugin_command_log_multiple() ... 
Running test check_example_io_plugin_failed_to_start_command() ... 
Running test check_example_io_plugin_fails_with_python_backtrace() ... 
Running test check_io_plugin_callbacks_are_optional() ... 
Running test check_io_plugin_reports_error() ... 
Running test check_plugin_unload() ... 
Running test check_example_group_plugin() ... 
Running test check_example_group_plugin_is_able_to_debug() ... 
Expectation failed at ./regress/testhelpers.c:98:
  actual is <<SudoGroupPlugin.__init__ was called with arguments: () [('args', ('ModulePath=SRC_DIR/example_group_plugin.py', 'ClassName=SudoGroupPlugin')), ('version', '1.0')]
SudoGroupPlugin.__init__ returned result: <example_group_plugin.SudoGroupPlugin object>
SudoGroupPlugin.query was called with arguments: ('user', 'group', ('pw_name', 'pw_passwd', 1001, 101, 'pw_gecos', 'pw_dir', 'pw_shell')) 
SudoGroupPlugin.query returned result: REJECT 
>>: actual_content
  expected to be <<SudoGroupPlugin.__init__ was called with arguments: () [('args', ('ModulePath=SRC_DIR/example_group_plugin.py', 'ClassName=SudoGroupPlugin')), ('version', '1.0')]
SudoGroupPlugin.__init__ returned result: <example_group_plugin.SudoGroupPlugin object>
SudoGroupPlugin.query was called with arguments: ('user', 'group', ('pw_name', 'pw_passwd', 1001, 101, 'pw_gecos', 'pw_dir', 'pw_shell')) 
SudoGroupPlugin.query returned result: RC.REJECT 
>>: expected_output
Expectation failed at ./regress/testhelpers.c:228:
  actual is <<0>>: verify_content(stored_str, reference_path)
  not expected to be <<0>>: 0
Expectation failed at ./regress/check_python_examples.c:513:
  actual is <<0>>: verify_log_lines(expected_path("check_example_group_plugin_is_able_to_debug.log"))
  not expected to be <<0>>: 0
FAILED: testcase check_example_group_plugin_is_able_to_debug() at ./regress/check_python_examples.c:1533

The output of the plugin:

The error output of the plugin:
Running test check_plugin_unload() ... 
Running test check_loading_fails_with_missing_path() ... 
Running test check_loading_succeeds_with_missing_classname() ... 
Running test check_loading_fails_with_missing_classname() ... 
Running test check_loading_fails_with_wrong_classname() ... 
Running test check_loading_fails_with_wrong_path() ... 
Running test check_loading_fails_plugin_is_not_owned_by_root() ... 
Running test check_plugin_unload() ... 
Running test check_example_conversation_plugin_reason_log(false, "without_suspend") ... 
Running test check_example_conversation_plugin_reason_log(true, "with_suspend") ... 
Running test check_example_conversation_plugin_user_interrupts() ... 
Running test check_plugin_unload() ... 
Running test check_example_policy_plugin_version_display(true) ... 
Running test check_example_policy_plugin_version_display(false) ... 
Running test check_example_policy_plugin_accepted_execution() ... 
Running test check_example_policy_plugin_failed_execution() ... 
Running test check_example_policy_plugin_denied_execution() ... 
Running test check_example_policy_plugin_list() ... 
Running test check_example_policy_plugin_validate_invalidate() ... 
Running test check_policy_plugin_callbacks_are_optional() ... 
Running test check_policy_plugin_reports_error() ... 
Running test check_plugin_unload() ... 
Running test check_example_audit_plugin_receives_accept() ... 
Running test check_example_audit_plugin_receives_reject() ... 
Running test check_example_audit_plugin_receives_error() ... 
Running test check_example_audit_plugin_workflow_multiple() ... 
Running test check_example_audit_plugin_version_display() ... 
Running test check_audit_plugin_callbacks_are_optional() ... 
Running test check_audit_plugin_reports_error() ... 
Running test check_plugin_unload() ... 
Running test check_example_approval_plugin( "2020-02-10T07:55:23", "That is not allowed outside the business hours!") ... 
Running test check_example_approval_plugin("2020-02-10T08:05:23", NULL) ... 
Running test check_example_approval_plugin("2020-02-14T17:59:23", NULL) ... 
Running test check_example_approval_plugin( "2020-02-10T18:05:23", "That is not allowed outside the business hours!") ... 
Running test check_example_approval_plugin( "2020-02-15T08:05:23", "That is not allowed on the weekend!") ... 
Running test check_multiple_approval_plugin_and_arguments() ... 
Running test check_python_plugins_do_not_affect_each_other() ... 
Running test check_plugin_unload() ... 
Running test check_example_debugging("plugin@err") ... 
Running test check_example_debugging("plugin@info") ... 
Running test check_example_debugging("load@diag") ... 
Running test check_example_debugging("sudo_cb@info") ... 
Running test check_example_debugging("c_calls@diag") ... 
Expectation failed at ./regress/testhelpers.c:98:
  actual is <<sudo.debug was called with arguments: (DEBUG.ERROR, 'My demo purpose plugin shows this ERROR level debug message') 
sudo.debug was called with arguments: (DEBUG.INFO, 'My demo purpose plugin shows this INFO level debug message') 
LogHandler.emit was called
LogHandler.emit was called
sudo.options_as_dict was called with arguments: (('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin'),) 
sudo.options_as_dict returned result: [('ClassName', 'DebugDemoPlugin'), ('ModulePath', 'SRC_DIR/example_debugging.py')] 
>>: actual_content
  expected to be <<sudo.debug was called with arguments: (<DEBUG.ERROR: 2>, 'My demo purpose plugin shows this ERROR level debug message') 
sudo.debug was called with arguments: (<DEBUG.INFO: 6>, 'My demo purpose plugin shows this INFO level debug message') 
LogHandler.emit was called
LogHandler.emit was called
sudo.options_as_dict was called with arguments: (('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin'),) 
sudo.options_as_dict returned result: [('ClassName', 'DebugDemoPlugin'), ('ModulePath', 'SRC_DIR/example_debugging.py')] 
>>: expected_output
Expectation failed at ./regress/testhelpers.c:228:
  actual is <<0>>: verify_content(stored_str, reference_path)
  not expected to be <<0>>: 0
Expectation failed at ./regress/check_python_examples.c:555:
  actual is <<0>>: verify_log_lines(expected_path("check_example_debugging_%s.log", debug_spec))
  not expected to be <<0>>: 0
FAILED: testcase check_example_debugging("c_calls@diag") at ./regress/check_python_examples.c:1591

The output of the plugin:

The error output of the plugin:
Running test check_example_debugging("c_calls@info") ... 
Expectation failed at ./regress/testhelpers.c:98:
  actual is <<__init__ @ SRC_DIR/example_debugging.py:58 calls C function:
sudo.debug was called with arguments: (DEBUG.ERROR, 'My demo purpose plugin shows this ERROR level debug message') 
__init__ @ SRC_DIR/example_debugging.py:63 calls C function:
sudo.debug was called with arguments: (DEBUG.INFO, 'My demo purpose plugin shows this INFO level debug message') 
handle @ logging/__init__.py calls C function:
LogHandler.emit was called
handle @ logging/__init__.py calls C function:
LogHandler.emit was called
__init__ @ SRC_DIR/example_debugging.py:85 calls C function:
sudo.options_as_dict was called with arguments: (('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin'),) 
sudo.options_as_dict returned result: [('ClassName', 'DebugDemoPlugin'), ('ModulePath', 'SRC_DIR/example_debugging.py')] 
>>: actual_content
  expected to be <<__init__ @ SRC_DIR/example_debugging.py:58 calls C function:
sudo.debug was called with arguments: (<DEBUG.ERROR: 2>, 'My demo purpose plugin shows this ERROR level debug message') 
__init__ @ SRC_DIR/example_debugging.py:63 calls C function:
sudo.debug was called with arguments: (<DEBUG.INFO: 6>, 'My demo purpose plugin shows this INFO level debug message') 
handle @ logging/__init__.py calls C function:
LogHandler.emit was called
handle @ logging/__init__.py calls C function:
LogHandler.emit was called
__init__ @ SRC_DIR/example_debugging.py:85 calls C function:
sudo.options_as_dict was called with arguments: (('ModulePath=SRC_DIR/example_debugging.py', 'ClassName=DebugDemoPlugin'),) 
sudo.options_as_dict returned result: [('ClassName', 'DebugDemoPlugin'), ('ModulePath', 'SRC_DIR/example_debugging.py')] 
>>: expected_output
Expectation failed at ./regress/testhelpers.c:228:
  actual is <<0>>: verify_content(stored_str, reference_path)
  not expected to be <<0>>: 0
Expectation failed at ./regress/check_python_examples.c:555:
  actual is <<0>>: verify_log_lines(expected_path("check_example_debugging_%s.log", debug_spec))
  not expected to be <<0>>: 0
FAILED: testcase check_example_debugging("c_calls@info") at ./regress/check_python_examples.c:1592

The output of the plugin:

The error output of the plugin:
Running test check_example_debugging("py_calls@diag") ... 
Running test check_example_debugging("py_calls@info") ... 
Running test check_example_debugging("plugin@err") ... 
Running test check_plugin_unload() ... 
make[1]: *** [Makefile:222: check] Error 3
make[1]: Leaving directory '/builddir/build/BUILD/sudo-1.9.5p2/plugins/python'
make: *** [Makefile:114: check] Error 2

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/02127575-sudo/

For all our attempts to build sudo with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/sudo/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2021-04-14 10:17:33 UTC
Note: sudo is critpath but if it doesn't build, "sudo" will still be installable, only the Python plugin won't.

Comment 2 Todd C. Miller 2021-04-15 14:30:31 UTC
It looks like some internal python changes have resulted in cosmetic differences in the debug output which is causing the test failure.  It doesn't indicate an actual problem but I'll look into adapting the tests to pass on python 3.10.

Comment 3 Radovan Sroka 2021-04-15 14:57:33 UTC
We had similar problems with sudo python plugin and python 3.10 see https://bugzilla.redhat.com/show_bug.cgi?id=1913374.

It looks like issues were fixed.

Comment 4 Tomáš Hrnčiar 2021-04-16 06:17:02 UTC
(In reply to Radovan Sroka from comment #3)
> We had similar problems with sudo python plugin and python 3.10 see
> https://bugzilla.redhat.com/show_bug.cgi?id=1913374.
> 
> It looks like issues were fixed.

This one got fixed when the 5th alpha of Python 3.10. was released. Currently, we are at a7 so there is a possibility that some change in Python breaks sudo again. This is last alpha and beta is supposed to come out in about two weeks.

Comment 5 Miro Hrončok 2021-06-04 20:13:01 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 6 Miro Hrončok 2021-06-06 22:21:32 UTC
Closing this, but note that sudo now fails in rawhide for unrelated reason: https://koschei.fedoraproject.org/package/sudo https://fedoraproject.org/wiki/Changes/Broken_RPATH_will_fail_rpmbuild


Note You need to log in before you can comment on or make changes to this bug.