storaged-project / libbytesize Goto Github PK
View Code? Open in Web Editor NEWA tiny library providing a C "class" for working with arbitrary big sizes in bytes
License: GNU Lesser General Public License v2.1
A tiny library providing a C "class" for working with arbitrary big sizes in bytes
License: GNU Lesser General Public License v2.1
Somehow this change broke the Debian build.
libbytesize 2.7
====================
prefix: /usr
libdir: ${prefix}/lib/x86_64-linux-gnu
libexecdir: ${exec_prefix}/libexec
bindir: ${exec_prefix}/bin
sbindir: ${exec_prefix}/sbin
datadir: ${datarootdir}
sysconfdir: /etc
localstatedir: /var
docdir: ${datarootdir}/doc/${PACKAGE_TARNAME}
compiler: gcc
cflags: -g -O2 -ffile-prefix-map=/home/michael/debian/build-area/libbytesize-2.7=. -fstack-protector-strong -Wformat -Werror=format-security -DENABLE_NLS
cppflags: -Wdate-time -D_FORTIFY_SOURCE=2
ldflags: -Wl,-z,relro -Wl,-z,now
Python 3 bindings: yes
tools: no
...
/bin/mkdir -p '/home/michael/debian/build-area/libbytesize-2.7/debian/tmp/usr/local/lib/python3.10/dist-packages/bytesize'
/usr/bin/install -c -m 644 bytesize.py __init__.py '/home/michael/debian/build-area/libbytesize-2.7/debian/tmp/usr/local/lib/python3.10/dist-packages/bytesize'
Notice how it installs the files in /usr/local despite using --prefix=/usr
Reverting this commit, I get:
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
<string>:1: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
<string>:1: DeprecationWarning: The distutils.sysconfig module is deprecated, use sysconfig instead
/bin/mkdir -p '/home/michael/debian/build-area/libbytesize-2.7/debian/tmp/usr/lib/python3/dist-packages/bytesize'
/usr/bin/install -c -m 644 bytesize.py __init__.py '/home/michael/debian/build-area/libbytesize-2.7/debian/tmp/usr/lib/python3/dist-packages/bytesize'
A few warnings but installed into the proper path
Originally posted by @mbiebl in #98 (comment)
When using convert_to
final conversion to Decimal
in bytesize.py
doesn't work because of radix char.
Current implementation of blivet.size.Size
has a fix for this problem -- https://github.com/rhinstaller/blivet/blob/1.x-branch/blivet/size.py#L177
pcre has been replaced by its successor pcre2.
Please consider porting libbytesize to it.
Trying to run bscalc on Void Linux (which packages libbytesize 2.7, though I can reproduce the issue when I bump the package to 2.8 locally), I get this error:
Traceback (most recent call last):
File "/bin/bscalc", line 6, in <module>
from bytesize import Size, ZeroDivisionError
File "/usr/lib/python3.11/site-packages/bytesize/__init__.py", line 1, in <module>
from .bytesize import Size
File "/usr/lib/python3.11/site-packages/bytesize/bytesize.py", line 23, in <module>
c_bytesize = ctypes.CDLL("libbytesize.so.1")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ctypes/__init__.py", line 376, in __init__
self._handle = _dlopen(self._name, mode)
^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: /usr/lib/libbytesize.so.1: undefined symbol: pcre2_substring_get_byname_8
Here's the output of ldd /usr/lib/libbytesize.so.1
:
linux-vdso.so.1 (0x00007ffe39931000)
libmpfr.so.6 => /usr/lib/libmpfr.so.6 (0x00007f27d3ded000)
libgmp.so.10 => /usr/lib/libgmp.so.10 (0x00007f27d3d70000)
libc.so.6 => /usr/lib/libc.so.6 (0x00007f27d3b87000)
/usr/lib64/ld-linux-x86-64.so.2 (0x00007f27d3ebb000)
So for some reason, libbytesize.so.1
is not linking to libpcre2-8.so.0
. I asked on the Void Linux support channels about this, and was told that I should report this issue to libbytesize. Any idea how to fix this?
Hello, the Fedora project migrates its translation platform to Weblate [1].
This tool directly interact with your git repository, and requires us to know:
Please note:
[1] https://communityblog.fedoraproject.org/fedora-localization-platform-migrates-to-weblate/
[2] https://docs.weblate.org/en/latest/admin/continuous.html#avoiding-merge-conflicts
[3] https://docs.weblate.org/en/latest/user/checks.html#translation-checks
Hello!
Trying to build this project (on Debian) but running into issues when enabling the python3 bindings (python2 disabled so far):
The configure.ac references $exec_prefix in relation to the python bindings. The configure file generated in my build puts the code expanded from configure.ac related to $exec_prefix before it puts the code to expand exec_prefix from $prefix if exec_prefix is left at its default NONE value. I thus end up with python bindings being installed in NONE/lib/python3.*/....
rather than /usr/lib/python3.*/....
root@mbpah:/build/libbytesize-0.9# cat -n configure | grep -A 2 -B 2 PYTHON3_EXECDIR=
13641 PYTHON3_EXEC_PREFIX='${exec_prefix}'
13642
13643 PYTHON3_EXECDIR=`$python3 -c "import distutils.sysconfig; \
13644 print(distutils.sysconfig.get_python_lib(1,0,prefix='${exec_prefix}'))"`
13645 py3execdir=$PYTHON3_EXECDIR
root@mbpah:/build/libbytesize-0.9# cat -n configure | grep -A 2 -B 2 'test.*exec_prefix.*NONE.*prefix'
13824 test "x$prefix" = xNONE && prefix=$ac_default_prefix
13825 # Let make expand exec_prefix.
13826 test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
13827
13828 # Transform confdefs.h into DEFS.
root@mbpah:/build/libbytesize-0.9#
I was told the solution was to move the usage of $exec_prefix from configure to make phase, but don't see how to do that here.
When executing test suite, it displayed the following error message.
ERROR: testSubBytes (main.SizeTestCase)
Traceback (most recent call last):
File "/home/abuild/rpmbuild/BUILD/libbytesize-2.6/tests/locale_utils.py", line 26, in decorated
return test_method(test, *args)
File "/home/abuild/rpmbuild/BUILD/libbytesize-2.6/tests/./libbytesize_unittest.py", line 31, in setUp
locale.setlocale(locale.LC_ALL, DEFAULT_LOCALE)
File "/usr/lib64/python3.9/locale.py", line 610, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
It seems that python3.9 doesn't recognize "en_US.utf8".
DEFAULT_LOCALE should use "en_US.UTF-8" in tests/libbytesize_unittest.py
-DEFAULT_LOCALE = "en_US.utf8"
+DEFAULT_LOCALE = "en_US.UTF-8"
You upgraded for version 0.11 to 1.0. What changed?
Note that the git changelog is not really satisfactory. It gives equal weight to a typo in a comment and major functionality changes.
Why not run 'make dist' before releasing a new tarball?
L10N Korean Team maintains the settings proposed through official translations.
Please apply the changed translation.
Originally posted by @simmon-nplob in storaged-project/blivet#1189 (comment)
Hi there! Would be to much work to create a switch to disable python 2 support?
I am running the build and test as a part of the Ubuntu distribution for ppc64le.
This helps us simplify testing later when distributions are re-building and re-releasing.
During the build and test (DOCKER_FILE=".travis/Dockerfile.debian-testing"), I found that it makes use of --privileged
for docker run
.
It fails for ppc64le since privileged containers are not supported for lxd backend.
I also verified that without using this option, the travis build succeeds for ppc64le.
Wanted to check if it is okay to remove this option for ppc64le or is there any specific reason for including --privileged
option.
Packit failed on creating pull-requests in dist-git (https://src.fedoraproject.org/rpms/libbytesize.git):
dist-git branch | error |
---|---|
f36 |
See https://dashboard.packit.dev/results/propose-downstream/2014 |
f37 |
See https://dashboard.packit.dev/results/propose-downstream/2012 |
f38 |
See https://dashboard.packit.dev/results/propose-downstream/2013 |
rawhide |
See https://dashboard.packit.dev/results/propose-downstream/2011 |
You can retrigger the update by adding a comment (/packit propose-downstream
) into this issue.
Should the version in the pkgconfig file match the project version?
Hi,
running the libbytesize unit tests on my system results in the following error:
Traceback (most recent call last):
File "./libbytesize_unittest.py", line 346, in testHumanReadable
locale.setlocale(locale.LC_ALL, 'cs_CZ.UTF-8')
File "/usr/lib64/python3.5/locale.py", line 594, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
because I only have the following locales on my system:
# locale -a
C
POSIX
de_DE
de_DE.iso88591
de_DE.iso885915@euro
de_DE.utf8
de_DE@euro
deutsch
en_US
en_US.iso88591
en_US.utf8
german
I suggest to run tests that require specific locales only if the required locaes are really available.
Quoting from this bugzilla comment by Stefan Ring:
"The bug is in libbytesize's Python binding:
>>> import bytesize.bytesize
>>> bytesize.bytesize.Size(0) + 2**36
Size (0 B)
Well, actually it's in the C part of libbytesize, because for example bs_size_add_bytes (responsible for the error shown above) takes a uint64_t, which it happily passes on to mpz_add_ui, which takes an unsigned long, and thus truncation happens.
A workaround would be replacing every occurrence of MAXUINT64 in bytesize.py with sys.maxsize. Of course, it would be better fixing the C interface, which would probably take a bit more work. Although, it would mostly consist of replacing uint64_t with unsigned long."
I'm seeing bunch of these messages at the end of the blivet examples on rawhide (2.1-devel
, 2.2-devel
):
Exception ignored in: <object repr() failed>
Traceback (most recent call last):
File "/usr/lib64/python3.5/site-packages/bytesize/bytesize.py", line 100, in __del__
AttributeError: 'NoneType' object has no attribute 'bs_size_free'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.