Falldog / pyconcrete

Protect your python script, encrypt it as .pye and decrypt when import it
Apache License 2.0
692 stars 149 forks source link

Cannot build or install it #94

Closed tbrodbeck closed 2 years ago

tbrodbeck commented 2 years ago

When executing setup.py:

running build
running build_py
creating build
creating build/lib.macosx-12-x86_64-3.9
creating build/lib.macosx-12-x86_64-3.9/pyconcrete
copying src/pyconcrete/version.py -> build/lib.macosx-12-x86_64-3.9/pyconcrete
copying src/pyconcrete/__init__.py -> build/lib.macosx-12-x86_64-3.9/pyconcrete
running build_ext
creating build/temp.macosx-12-x86_64-3.9
creating build/temp.macosx-12-x86_64-3.9/src
creating build/temp.macosx-12-x86_64-3.9/src/pyconcrete_ext
creating build/temp.macosx-12-x86_64-3.9/src/pyconcrete_ext/openaes
creating build/temp.macosx-12-x86_64-3.9/src/pyconcrete_ext/openaes/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Isrc/pyconcrete_ext -Isrc/pyconcrete_ext/openaes/inc -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/pyconcrete_ext/openaes/src/oaes_base64.c -o build/temp.macosx-12-x86_64-3.9/src/pyconcrete_ext/openaes/src/oaes_base64.o
src/pyconcrete_ext/openaes/src/oaes_base64.c:30:19: warning: unused variable '_NR' [-Wunused-const-variable]
static const char _NR[] = {
                  ^
1 warning generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -Isrc/pyconcrete_ext -Isrc/pyconcrete_ext/openaes/inc -I/usr/local/opt/python@3.9/Frameworks/Python.framework/Versions/3.9/include/python3.9 -c src/pyconcrete_ext/openaes/src/oaes_lib.c -o build/temp.macosx-12-x86_64-3.9/src/pyconcrete_ext/openaes/src/oaes_lib.o
src/pyconcrete_ext/openaes/src/oaes_lib.c:475:3: error: implicitly declaring library function 'sprintf' with type 'int (char *, const char *, ...)' [-Werror,-Wimplicit-function-declaration]
                sprintf( _temp, "%02x ", data[_i] );
                ^
src/pyconcrete_ext/openaes/src/oaes_lib.c:475:3: note: include the header <stdio.h> or explicitly provide a declaration for 'sprintf'
src/pyconcrete_ext/openaes/src/oaes_lib.c:515:4: warning: cast to smaller integer type 'uint32_t' (aka 'unsigned int') from 'char *' [-Wpointer-to-int-cast]
                        (uint32_t) ( _test + timer.millitm ) + getpid();
                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/pyconcrete_ext/openaes/src/oaes_lib.c:515:43: error: implicit declaration of function 'getpid' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
                        (uint32_t) ( _test + timer.millitm ) + getpid();
                                                               ^
src/pyconcrete_ext/openaes/src/oaes_lib.c:784:15: warning: comparison of integers of different signs: 'size_t' (aka 'unsigned long') and 'int' [-Wsign-compare]
        if( data_len != _key_length + OAES_BLOCK_SIZE )
            ~~~~~~~~ ^  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2 warnings and 2 errors generated.
error: command '/usr/bin/clang' failed with exit code 1

System:

Python 3.9.10 OS: macOS 12.2.1 21D62 x86_64 Host: MacBookPro16,1 Kernel: 21.3.0 Shell: zsh 5.8

zephyrxvxx7 commented 2 years ago

I had occurred the same error and I tried to set the CFLAGS to dismiss that error. Try this command: CFLAGS="-Wno-implicit-function-declaration" python3 setup.py install

tbrodbeck commented 2 years ago

Thanks this made it work!