Skip to content
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

build issue (with potential fix) on bigendian architectures #6105

Closed
th0ma7 opened this issue Jan 4, 2022 · 25 comments
Closed

build issue (with potential fix) on bigendian architectures #6105

th0ma7 opened this issue Jan 4, 2022 · 25 comments
Labels
Milestone

Comments

@th0ma7
Copy link

th0ma7 commented Jan 4, 2022

Have you checked borgbackup docs, FAQ, and open Github issues?

Yes

Is this a BUG / ISSUE report or a QUESTION?

Bug, seems already resolved in master but present in 1.1 branch (at least no sign of __BIG_ENDIAN__ in setup.py in master)

System information. For client/server mode post info for both machines.

Your borg version (borg -V).

1.1.17

Operating system (distribution) and version.

SynoCommunity, Synology DSM-6 (linux)

Hardware / network configuration, and filesystems used.

PPC qoriq arch

How much data is handled by borg?

n/a - build issue only on PPC due to endianess

Full borg commandline that lead to the problem (leave away excludes and passwords)

n/a

Describe the problem you're observing.

build log:

Collecting borgbackup==1.1.17
  Using cached borgbackup-1.1.17.tar.gz (3.8 MB)
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
Building wheels for collected packages: borgbackup
  Building wheel for borgbackup (setup.py): started
  Building wheel for borgbackup (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/crossenv/cross/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-wheel-t50qub2n/borgbackup_de5df87e60224e6ca41dbf5168a72ac2/setup.py'"'"'; __file__='"'"'/tmp/pip-wheel-t50qub2n/borgbackup_de5df87e60224e6ca41dbf5168a72ac2/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-zr688xe_
       cwd: /tmp/pip-wheel-t50qub2n/borgbackup_de5df87e60224e6ca41dbf5168a72ac2/
  Complete output (125 lines):
  Detected and preferring liblz4 over bundled LZ4
  Detected and preferring libb2 over bundled BLAKE2
  Detected and preferring libzstd over bundled ZSTD
  /home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/crossenv/build/lib/python3.10/site-packages/setuptools/__init__.py:148: SetuptoolsDeprecationWarning: setup_requires is deprecated. Supply build dependencies using PEP 517 pyproject.toml build-requires.
    warnings.warn(
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.powerpc-e500v2-linux-gnuspe-3.10
  creating build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/__init__.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/__main__.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/_version.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/archive.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/archiver.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/cache.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/constants.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/fuse.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/helpers.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/locking.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/logger.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/lrucache.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/nanorst.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/patterns.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/remote.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/repository.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/selftest.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/shellpattern.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/upgrader.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/version.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/xattr.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  creating build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/algorithms
  copying src/borg/algorithms/__init__.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/algorithms
  creating build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/crypto
  copying src/borg/crypto/__init__.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/crypto
  copying src/borg/crypto/file_integrity.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/crypto
  copying src/borg/crypto/key.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/crypto
  copying src/borg/crypto/keymanager.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/crypto
  copying src/borg/crypto/nonces.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/crypto
  creating build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/platform
  copying src/borg/platform/__init__.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/platform
  copying src/borg/platform/base.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/platform
  creating build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/__init__.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/archive.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/archiver.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/benchmark.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/cache.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/checksums.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/chunker.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/compress.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/crypto.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/file_integrity.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/hashindex.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/helpers.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/item.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/key.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/locking.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/logger.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/lrucache.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/nanorst.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/nonces.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/patterns.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/platform.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/remote.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/repository.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/shellpattern.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/upgrader.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/version.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  copying src/borg/testsuite/xattr.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  creating build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/algorithms/msgpack
  copying src/borg/algorithms/msgpack/__init__.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/algorithms/msgpack
  copying src/borg/algorithms/msgpack/_version.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/algorithms/msgpack
  copying src/borg/algorithms/msgpack/exceptions.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/algorithms/msgpack
  copying src/borg/algorithms/msgpack/fallback.py -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/algorithms/msgpack
  running egg_info
  writing src/borgbackup.egg-info/PKG-INFO
  writing dependency_links to src/borgbackup.egg-info/dependency_links.txt
  writing entry points to src/borgbackup.egg-info/entry_points.txt
  writing requirements to src/borgbackup.egg-info/requires.txt
  writing top-level names to src/borgbackup.egg-info/top_level.txt
  listing git files failed - pretending there aren't any
  reading manifest file 'src/borgbackup.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  warning: no previously-included files found matching '.coafile'
  warning: no previously-included files found matching '.editorconfig'
  warning: no previously-included files found matching '.gitattributes'
  warning: no previously-included files found matching '.gitignore'
  warning: no previously-included files found matching '.mailmap'
  warning: no previously-included files found matching 'Vagrantfile'
  no previously-included directories found matching '.github'
  adding license file 'LICENSE'
  adding license file 'AUTHORS'
  writing manifest file 'src/borgbackup.egg-info/SOURCES.txt'
  copying src/borg/paperkey.html -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg
  copying src/borg/testsuite/attic.tar.gz -> build/lib.powerpc-e500v2-linux-gnuspe-3.10/borg/testsuite
  running build_ext
  skipping 'src/borg/algorithms/msgpack/_packer.cpp' Cython extension (up-to-date)
  skipping 'src/borg/algorithms/msgpack/_unpacker.cpp' Cython extension (up-to-date)
  skipping 'src/borg/compress.c' Cython extension (up-to-date)
  skipping 'src/borg/crypto/low_level.c' Cython extension (up-to-date)
  skipping 'src/borg/hashindex.c' Cython extension (up-to-date)
  skipping 'src/borg/item.c' Cython extension (up-to-date)
  skipping 'src/borg/chunker.c' Cython extension (up-to-date)
  skipping 'src/borg/algorithms/checksums.c' Cython extension (up-to-date)
  skipping 'src/borg/platform/posix.c' Cython extension (up-to-date)
  skipping 'src/borg/platform/linux.c' Cython extension (up-to-date)
  skipping 'src/borg/platform/syncfilerange.c' Cython extension (up-to-date)
  building 'borg.algorithms.msgpack._packer' extension
  creating build/temp.powerpc-e500v2-linux-gnuspe-3.10
  creating build/temp.powerpc-e500v2-linux-gnuspe-3.10/src
  creating build/temp.powerpc-e500v2-linux-gnuspe-3.10/src/borg
  creating build/temp.powerpc-e500v2-linux-gnuspe-3.10/src/borg/algorithms
  creating build/temp.powerpc-e500v2-linux-gnuspe-3.10/src/borg/algorithms/msgpack
  /home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/bin/powerpc-e500v2-linux-gnuspe-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include -mcpu=8548 -mhard-float -mfloat-gprs=double -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install//var/packages/borgbackup/target/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L /home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/lib -I /home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include -I/home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include -mcpu=8548 -mhard-float -mfloat-gprs=double -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install//var/packages/borgbackup/target/include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -L /home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/lib -I /home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include -I/home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include -mcpu=8548 -mhard-float -mfloat-gprs=double -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install//var/packages/borgbackup/target/include -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include/python3.10 -I/home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include -mcpu=8548 -mhard-float -mfloat-gprs=double -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install//var/packages/borgbackup/target/include -fPIC -D__LITTLE_ENDIAN__=1 -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include -Isrc/borg/algorithms/xxh64/. -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/crossenv/cross/include -I/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include/python3.10 -c src/borg/algorithms/msgpack/_packer.cpp -o build/temp.powerpc-e500v2-linux-gnuspe-3.10/src/borg/algorithms/msgpack/_packer.o
  In file included from /home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include/endian.h:36:0,
                   from /home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include/bits/waitstatus.h:64,
                   from /home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include/stdlib.h:42,
                   from /home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/install/var/packages/borgbackup/target/include/python3.10/Python.h:34,
                   from src/borg/algorithms/msgpack/_packer.cpp:6:
  /home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/powerpc-e500v2-linux-gnuspe/sysroot/usr/include/bits/endian.h:26:4: error: #error Both BIG_ENDIAN and LITTLE_ENDIAN defined!
   #  error Both BIG_ENDIAN and LITTLE_ENDIAN defined!
      ^
  error: command '/home/spksrc/borgbackup-udpate/spksrc/toolchain/syno-qoriq-6.1/work/powerpc-e500v2-linux-gnuspe/bin/powerpc-e500v2-linux-gnuspe-gcc' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for borgbackup
  Running setup.py clean for borgbackup
Failed to build borgbackup
ERROR: Failed to build one or more wheels

Can you reproduce the problem? If so, describe how. If not, describe troubleshooting steps you took before opening the issue.

Always, only fails on PPC.

Include any warning/errors/backtraces from the system logs Actual patch we use to circumvent this (a workaround upstream part of next release would be really great!)

SynoCommunity/spksrc@72866f6#diff-7b228d5ca562f5bc3b0ebfbbe98d851ed882feab3721fbb04b57ad844256eb78

Disables pseudo logic made to enforce setting of macros which are actually already defined in corresponding headers.

--- setup.py
+++ setup.py
@@ -804,20 +804,16 @@ if not on_rtd:
                                                system_prefix=libb2_prefix, system=libb2_system,
                                                **crypto_ext_kwargs)

-    msgpack_endian = '__BIG_ENDIAN__' if (sys.byteorder == 'big') else '__LITTLE_ENDIAN__'
-    msgpack_macros = [(msgpack_endian, '1')]
     msgpack_packer_ext_kwargs = dict(
         sources=[msgpack_packer_source],
         include_dirs=include_dirs,
         library_dirs=library_dirs,
-        define_macros=msgpack_macros,
         language='c++',
     )
     msgpack_unpacker_ext_kwargs = dict(
         sources=[msgpack_unpacker_source],
         include_dirs=include_dirs,
         library_dirs=library_dirs,
-        define_macros=msgpack_macros,
         language='c++',
     )
@ThomasWaldmann
Copy link
Member

Big endian isn't much tested any more (at least not by me personally) due to the lack of big endian platforms / OSes.

Maybe the debian build farm has some insights?

@ThomasWaldmann
Copy link
Member

https://buildd.debian.org/status/package.php?p=borgbackup&suite=sid

it seems to work on debian sid ppc64, which is also big endian.

@ThomasWaldmann
Copy link
Member

It's strange that both BIG and LITTLE ENDIAN are defined.

Can you grep -r on that system where these macros are defined?

@ThomasWaldmann
Copy link
Member

Also, what does your python3 sys.byteorder say?

@ThomasWaldmann
Copy link
Member

@FelixSchwarz do you remember why we have that code? git says the changeset was based on a patch by you.

@FelixSchwarz
Copy link
Contributor

FelixSchwarz commented Jan 4, 2022

@ThomasWaldmann Do you have a git commit for me so I can have a look?

Edit: I think you referred to f9cb040

@FelixSchwarz
Copy link
Contributor

I guess "my patch" was referring to a change I created for Fedora's borgbackup package so it would bundle msgpack:

I don't remember any specifics, I probably just did some copy&paste of various code until the magic incantations aligned. I experienced some big endian build issues on Fedora's s390x infrastructure but that was also due to flaky tests.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jan 4, 2022

The question is somehow why we need to define that in our setup.py, guess it should be in some C header, like endian.h (or endian2.h)?

endian2.h comes from the spksrc cross-compile build environment.

@FelixSchwarz
Copy link
Contributor

I agree that two mechanisms to define the byte order are bad.

I guess my inspiration was the code from msgpack's setup.py:

if sys.byteorder == "big":
    macros = [("__BIG_ENDIAN__", "1")]
else:
    macros = [("__LITTLE_ENDIAN__", "1")]

@ThomasWaldmann
Copy link
Member

Suspicion: is the issue because you use a little-endian python with headers for a big-endian target system in your crosscompiling environment?

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jan 4, 2022

@methane do you remember why you do that endian magic in your msgpack setup.py?

msgpack/msgpack-python@7c03f32

@th0ma7
Copy link
Author

th0ma7 commented Jan 4, 2022

@ThomasWaldmann it only fails when cross-compiling (host is always x64_64) to qoriq PPC target (powerpc-e500v2-linux-gnuspe)

I was able to find endian.h (files joined) qoriq-endian.tar.gz :

$ find . -name "endian*.h"
./powerpc-e500v2-linux-gnuspe/sysroot/usr/include/endian.h
./powerpc-e500v2-linux-gnuspe/sysroot/usr/include/bits/endian.h

Hope this helps 🤷

EDIT: Also, found here https://www.nxp.com/docs/en/reference-manual/E500CORERM.pdf page 1-34 it seems it is little endian and would align with the endian.h file. Also page 48 : Support for big-endian and true little-endian memory on a per-page basis

@methane
Copy link

methane commented Jan 6, 2022

@methane do you remember why you do that endian magic in your msgpack setup.py?

Because it is simple than detecting endian from C/C++ source (note that we needed to support old VC++) and I didn't think setup.py should support cross compiling.

@ThomasWaldmann
Copy link
Member

@methane so you think that the suggested patch (just removing that code and relying on the stuff in the C/CPP header files) should not be applied upstream?

@methane
Copy link

methane commented Jan 7, 2022

@methane so you think that the suggested patch (just removing that code and relying on the stuff in the C/CPP header files) should not be applied upstream?

Situation is changed from when I added the code (e.g. I don't need to support Python 2.7 & VC++ 2008 anymore). So I am not sure for now.
But I expect I can not just apply the patch. Need to check many compilers.

@th0ma7
Copy link
Author

th0ma7 commented Jan 7, 2022

@methane and @ThomasWaldmann , just re-mentioning if that helps, there are no traces of that code on master already.

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jan 7, 2022

@th0ma7 you mean borg master? yes, that is because we only bundle a known-good working msgpack into borg 1.1.x (1.1-maint branch).

for master, we just require msgpack (and because of additional wrapper only present in master, we are more flexible concerning new msgpack versions than in 1.1.x). but the msgpack setup.py also has that endian stuff, so the problem then just happens elsewhere.

@ThomasWaldmann
Copy link
Member

@methane it would be great if you could look into fixing this upstream (we would then just copy your solution to our borg 1.1-maint branch setup.py).

Guess it doesn't make much sense fixing it just here for 1.1-maint and still run into same issue in master branch (soon borg 1.2.x) where we use msgpack's setup.py for this.

@ThomasWaldmann ThomasWaldmann added this to the 1.1.x milestone Jan 16, 2022
@ThomasWaldmann
Copy link
Member

So, for borg this is "wait for upstream fix" now, thus tagged "later". Also added 1.1.x scope.

@th0ma7
Copy link
Author

th0ma7 commented Jan 22, 2022

Looking at recent upstream fix from @methane, I now wonder (and for release planning purpose), should I simply wait for a new 1.2.x or 2.x release in the short-term using master, hence fixing the bigendian issue? Or is it expected that a port of the upstream fix to be applied over the 1.1.x?

@ThomasWaldmann ThomasWaldmann modified the milestones: 1.1.x, 1.1.18 Jan 22, 2022
@ThomasWaldmann ThomasWaldmann added bug and removed later labels Jan 22, 2022
@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jan 22, 2022

In borg 1.2.x (current master branch, beta releases available), we do not have msgpack bundled, so this is not a borg issue there (but msgpack is still required as an external dependency, so you'll get the fix as soon as a fixed msgpack is released).

For borg 1.1.18 (which has msgpack 0.5.6 bundled), I am applying an equivalent fix to our setup.py as @methane has applied to msgpack master. Which ends up semantically being the same as the patch proposed by @th0ma7 because borg 1.1.x does not support native win32 anyway.

See #6149.

ThomasWaldmann added a commit to ThomasWaldmann/borg that referenced this issue Jan 22, 2022
thanks to everybody who helped with this, esp. @th0ma7 and @methane.
ThomasWaldmann added a commit that referenced this issue Jan 22, 2022
@ThomasWaldmann
Copy link
Member

Fixed in 1.1-maint branch by #6149, no change in master branch needed (see comment above).

@th0ma7
Copy link
Author

th0ma7 commented Jan 22, 2022

Thnx guys, great work! And confirm working all right (see details below).
@ThomasWaldmann Any idea when an official 1.1.18 is to be released?

Cross-compiling details (SynoCommunity/spksrc#5048)
I confirm issue is fixed using a direct github VCS such as:

git+https://github.com/borgbackup/borg@e41d8e82863bac17d0b64e2091a2fe14f0ffb776#egg=borgbackup==1.1.18

Which now builds fine on PPC (qoriq)

===>  Cross-compiling wheels
===>  Python crossenv found: [/home/spksrc/borgbackup-udpate/spksrc/spk/borgbackup/work-qoriq-6.1/crossenv/bin/activate]
===>  [borgbackup==1.1.18] 
Collecting borgbackup==1.1.18
  Cloning https://github.com/borgbackup/borg (to revision e41d8e82863bac17d0b64e2091a2fe14f0ffb776) to /tmp/pip-wheel-b76kr6zy/borgbackup_4343e168144b400f9ee4851ad061f1eb
  Running command git clone --filter=blob:none -q https://github.com/borgbackup/borg /tmp/pip-wheel-b76kr6zy/borgbackup_4343e168144b400f9ee4851ad061f1eb
  Running command git rev-parse -q --verify 'sha^e41d8e82863bac17d0b64e2091a2fe14f0ffb776'
  Running command git fetch -q https://github.com/borgbackup/borg e41d8e82863bac17d0b64e2091a2fe14f0ffb776
  Running command git checkout -q e41d8e82863bac17d0b64e2091a2fe14f0ffb776
  Resolved https://github.com/borgbackup/borg to commit e41d8e82863bac17d0b64e2091a2fe14f0ffb776
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'done'
  WARNING: Requested borgbackup==1.1.18 from git+https://github.com/borgbackup/borg@e41d8e82863bac17d0b64e2091a2fe14f0ffb776#egg=borgbackup==1.1.18, but installing version 1.1.18.dev53+ge41d8e82
Building wheels for collected packages: borgbackup
  Building wheel for borgbackup (setup.py): started
  Building wheel for borgbackup (setup.py): finished with status 'done'
  Created wheel for borgbackup: filename=borgbackup-1.1.18.dev53+ge41d8e82-cp310-cp310-powerpc_e500v2_linux_gnuspe.whl size=2216792 sha256=8e798ff4e889fc6a9595b5786cb0c14b580748afc1e70094837bf39e84681bf3
  Stored in directory: /home/spksrc/borgbackup-udpate/spksrc/distrib/pip/wheels/1a/c4/09/db2685d62d5cbc4ba747cda07946a9821fe41445422db5a3ab
Successfully built borgbackup

Resulting in a proper wheel:

$ ll work-qoriq-6.1/wheelhouse/borgbackup*.whl 
-rw-r--r-- 1 spksrc spksrc 2216792 Jan 22 16:05 work-qoriq-6.1/wheelhouse/borgbackup-1.1.18.dev53+ge41d8e82-cp310-cp310-powerpc_e500v2_linux_gnuspe.whl

@ThomasWaldmann
Copy link
Member

ThomasWaldmann commented Jan 22, 2022

No date yet for 1.1.18, finally getting 1.2.0 out has priority right now.
also, there is still that strange build issue in 1.1, see #5937.

@klemensn
Copy link

klemensn commented Dec 2, 2022

The fix for this issue broke big-endian sparc64 on OpenBSD, see #6149 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants