ihaveamac / ninfs

FUSE filesystem Python scripts for Nintendo console files
MIT License
436 stars 18 forks source link

ninfs does not compile with gcc 13.1 due to haccrypto dependency #101

Closed theCapypara closed 6 months ago

theCapypara commented 1 year ago

I'm not much of an expert with gcc and C/C++ compilation, so let me know if you need more info, however I'm unable to install/compile ninfs in either the stable 1.5.1 or alpha 2.0a1 release:

LC_ALL=C gcc --version
gcc (GCC) 13.1.1 20230429
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
LC_ALL=C pip install ninfs==2.0a9
Defaulting to user installation because normal site-packages is not writeable
Collecting ninfs==2.0a9
  Using cached ninfs-2.0a9-py3-none-any.whl (1.2 MB)
Requirement already satisfied: pycryptodomex<4,>=3.9 in /usr/lib/python3.11/site-packages (from ninfs==2.0a9) (3.12.0)
Collecting pyctr<0.7,>=0.5.1 (from ninfs==2.0a9)
  Using cached pyctr-0.6.0-py3-none-any.whl (76 kB)
Collecting haccrypto>=0.1 (from ninfs==2.0a9)
  Using cached haccrypto-0.1.2.tar.gz (4.7 MB)
  Preparing metadata (setup.py) ... done
Collecting pypng>=0.0.21 (from ninfs==2.0a9)
  Using cached pypng-0.20220715.0-py3-none-any.whl (58 kB)
Building wheels for collected packages: haccrypto
  Building wheel for haccrypto (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [40 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-311
      creating build/lib.linux-x86_64-cpython-311/haccrypto
      copying haccrypto/crypto.py -> build/lib.linux-x86_64-cpython-311/haccrypto
      copying haccrypto/__init__.py -> build/lib.linux-x86_64-cpython-311/haccrypto
      copying haccrypto/openssl-license.txt -> build/lib.linux-x86_64-cpython-311/haccrypto
      running build_ext
      building 'haccrypto._crypto' extension
      creating build/temp.linux-x86_64-cpython-311
      creating build/temp.linux-x86_64-cpython-311/haccrypto
      gcc -DNDEBUG -g -fwrapv -O3 -Wall -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -ffat-lto-objects -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -march=x86-64 -mtune=generic -O3 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -g -ffile-prefix-map=/build/python/src=/usr/src/debug/python -flto=auto -fPIC -I/usr/include/python3.11 -c haccrypto/_crypto.cpp -o build/temp.linux-x86_64-cpython-311/haccrypto/_crypto.o -O3 -std=c++11
      haccrypto/_crypto.cpp:125:17: error: 'string' in namespace 'std' does not name a type
        125 |     static std::string GetPathByAddress(const void* addr) {
            |                 ^~~~~~
      haccrypto/_crypto.cpp:29:1: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
         28 | #include <dlfcn.h>
        +++ |+#include <string>
         29 | #define __ldl__ 1
      haccrypto/_crypto.cpp: In function 'void load_lcrypto()':
      haccrypto/_crypto.cpp:549:14: error: 'string' is not a member of 'std'
        549 |         std::string *paths[2] = {nullptr, nullptr};
            |              ^~~~~~
      haccrypto/_crypto.cpp:549:14: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
      haccrypto/_crypto.cpp:549:22: error: 'paths' was not declared in this scope
        549 |         std::string *paths[2] = {nullptr, nullptr};
            |                      ^~~~~
      haccrypto/_crypto.cpp:550:14: error: 'string' is not a member of 'std'
        550 |         std::string modulepath("");
            |              ^~~~~~
      haccrypto/_crypto.cpp:550:14: note: 'std::string' is defined in header '<string>'; did you forget to '#include <string>'?
      haccrypto/_crypto.cpp:552:13: error: 'modulepath' was not declared in this scope
        552 |             modulepath = DynamicHelper::GetPathByAddress((const void * )&load_lcrypto);
            |             ^~~~~~~~~~
      haccrypto/_crypto.cpp:552:41: error: 'GetPathByAddress' is not a member of 'DynamicHelper'
        552 |             modulepath = DynamicHelper::GetPathByAddress((const void * )&load_lcrypto);
            |                                         ^~~~~~~~~~~~~~~~
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for haccrypto
  Running setup.py clean for haccrypto
Failed to build haccrypto
ERROR: Could not build wheels for haccrypto, which is required to install pyproject.toml-based projects
luigoalma commented 1 year ago

This is more of a haccrypto issue than it is ninfs, I need still to build a newer version package with fixes. Current workaround you can do is pip install git+https://github.com/luigoalma/haccrypto.git and then install ninfs. Soon enough I'll get a newer version done.

theCapypara commented 1 year ago

Ah right. Yeah I noticed right before submitting, that this wasn't an issue of ninfs directly and said "screw it" and submitted the issue anyway, if nothing else than a "marker" for others to know.

ihaveamac commented 6 months ago

Seems like this was resolved months ago. Please re-open if it wasn't.