| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 3.13 python extensions need to declare support for GIL features, for
example if they don't declare Py_MOD_GIL_NOT_USED then it will cause the
GIL to be enabled even when python was launched in free-threaded mode.
This requires "multi-phase initialization" because Py_mod_create is
incompatible with m_slots. There's a PyUnstable_Module_SetGIL() function
that can be used with single-phase init, but it's an unstable API, so
it's better to use multi-phase init. There's no need to use
PyModule_GetState() because the whirlpool module has no mutable state.
Bug: https://bugs.gentoo.org/934220
Signed-off-by: Zac Medico <zmedico@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
Python 3.8 added support for copy_file_range in the os module,
so we can just call that directly.
Also, we can use the FICLONE ioctl for fast file clones on supported
filesystems (btrfs).
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
|
|
|
|
|
|
|
|
|
|
| |
This was originally added as a workaround for musl, where
ctypes.util.find_library fails.
Instead, we now try to load "libc.so" as a fallback and can just rely on
ctypes to call tolower() and toupper().
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Avoids a compiler warning:
```
../src/portage_util_file_copy_reflink_linux.c: In function ‘_reflink_linux_file_copy’:
../src/portage_util_file_copy_reflink_linux.c:379:12: warning: ‘error’ may be used uninitialized [-Wmaybe-uninitialized]
379 | if (!error && ftruncate(fd_out, offset_out) < 0)
| ^
../src/portage_util_file_copy_reflink_linux.c:205:22: note: ‘error’ was declared here
205 | int eintr_retry, error, fd_in, fd_out, stat_in_acquired, stat_out_acquired;
| ^~~~~
```
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
This makes Portage PEP 517 compliant.
When building via meson-python, the man pages and logrotate config are
no longer included as there seems little point.
Bug: https://bugs.gentoo.org/910035
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
Add an extension module providing Whirlpool hash based on the reference
C implementation. This is necessary since Python hashlib no longer
provides Whirlpool by default with OpenSSL 3, and the Python
implementation used by Portage is unusably slow.
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Closes: https://github.com/gentoo/portage/pull/966
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
It's far easier to keep track of the arguments this way.
Closes: https://github.com/gentoo/portage/pull/940
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
When copy_file_range copied zero bytes, fall back to sendfile,
so that we don't call copy_file_range in an infinite loop.
Bug: https://bugs.gentoo.org/828844
Tested-by: John Helmert III <ajak@gentoo.org>
Signed-off-by: Zac Medico <zmedico@gentoo.org>
|
|
|
|
| |
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
|
|
|
|
|
|
| |
NFS can set the errno to EOPNOTSUPP for copy_file_range.
Bug: https://bugs.gentoo.org/641088
|
|
|
|
|
|
| |
NFS can set the errno to EOPNOTSUPP for lseek SEEK_DATA.
Bug: https://bugs.gentoo.org/641088
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The sendfile *offset parameter refers to the input file offest, so
it cannot be used in the same way as the copy_file_range *off_out
parameter. Therefore, add sf_wrapper function which implements the
*off_out behavior for sendfile.
Also update cfr_wrapper so that it does not rely on the fd_in file
offset, and remove corresponding fd_in lseek calls which are no
longer needed.
The file offset of fd_in is now completely unused, except in the
plain read/write loop, where lseek is called prior to entering
the loop.
Bug: https://bugs.gentoo.org/635126
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix the lseek offset for the plain read/write loop to account
for buffered data that has not been written to to the output
file yet (due to previous interruption by EINTR). This code
only affects Linux 2.6.32 and earlier (newer kernels use
copy_file_range or sendfile).
X-Gentoo-bug: 618086
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=618086
Acked-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The loff_t type is a GNU extension, so use the portable off_t
type instead. Also, enable Large File Support macros in setup.py,
for 64-bit offsets.
Reported-by: Patrick Steinhardt <ps@pks.im>
X-Gentoo-bug: 617778
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=617778
Acked-by: Anthony G. Basile <blueness@gentoo.org>
Acked-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Perform in-kernel file copying when possible, and also support
reflinks and sparse files. If the optimized implementation
fails at runtime, gracefully fallback to a plain read/write
loop.
Compile-time and run-time fallbacks are implemented, so that
any incompatiblities will be handled gracefully. For example,
if the code is compiled on a system that supports the
copy_file_range syscall, but at run-time an older kernel that
does not support this syscall is detected, it will be handled
gracefully. There are similar fallbacks for lack of lseek
SEEK_DATA and sendfile support.
X-Gentoo-Bug: 607868
X-Gentoo-Bug-Url: https://bugs.gentoo.org/show_bug.cgi?id=607868
Acked-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current method to check for a sane system locale is to use python's
ctypes.util.find_library() to construct a full library path to the
system libc.so and pass that path to ctypes.CDLL() so we can call
toupper() and tolower() directly. However, this gets bogged down in
implementation details and fails with musl.
We work around this design flaw in ctypes with a small python module
written in C which provides thin wrappers to toupper() and tolower(),
and only fall back on the current ctypes-based check when this module
is not available.
This has been tested on glibc, uClibc and musl systems.
X-Gentoo-bug: 571444
X-Gentoo-bug-url: https://bugs.gentoo.org/show_bug.cgi?id=571444
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
|
|
|
|
| |
it for a long time.
|
|
|
|
|
| |
(python as read support and we spawn binaries for any necessary
modifications).
|
|
|
|
| |
build/install it.
|
| |
|
| |
|
|
|
|
| |
svn path=/main/trunk/; revision=3483
|
|
|
|
| |
svn path=/main/branches/2.0/; revision=2116
|
|
|
|
| |
svn path=/main/branches/2.0/; revision=2115
|
|
|
|
| |
svn path=/main/branches/2.0/; revision=2069
|
|
|
|
| |
svn path=/main/branches/2.0/; revision=1951
|
|
svn path=/main/branches/2.0/; revision=1941
|