iustin / pyxattr

A python module for accessing filesystem Extended Attributes
https://pyxattr.k1024.org/
GNU Lesser General Public License v2.1
30 stars 15 forks source link

Build Fail #25

Closed tmsincomb closed 4 years ago

tmsincomb commented 4 years ago

pip install pyxattr worked on Catalina 10.15.5 with python3.7.7 (and still does), but when I updated to python3.8.1 I get this error.

  Building wheel for pyxattr (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /Users/tmsincomb/anaconda3/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/2c/fywj_5ks7n5bqyj_b6dx3zl80000gn/T/pip-install-sbiep0tc/pyxattr/setup.py'"'"'; __file__='"'"'/private/var/folders/2c/fywj_5ks7n5bqyj_b6dx3zl80000gn/T/pip-install-sbiep0tc/pyxattr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/2c/fywj_5ks7n5bqyj_b6dx3zl80000gn/T/pip-wheel-pstzqbbj
       cwd: /private/var/folders/2c/fywj_5ks7n5bqyj_b6dx3zl80000gn/T/pip-install-sbiep0tc/pyxattr/
  Complete output (11 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'xattr' extension
  creating build
  creating build/temp.macosx-10.9-x86_64-3.8
  x86_64-apple-darwin13.4.0-clang -fno-strict-aliasing -Wsign-compare -Wunreachable-code -DNDEBUG -fwrapv -O3 -Wall -Wstrict-prototypes -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 -pipe -fdebug-prefix-map=${SRC_DIR}=/usr/local/src/conda/${PKG_NAME}-${PKG_VERSION} -fdebug-prefix-map=/Users/tmsincomb/anaconda3=/usr/local/src/conda-prefix -flto -Wl,-export_dynamic -march=core2 -mtune=haswell -mssse3 -ftree-vectorize -fPIC -fPIE -fstack-protector-strong -O3 /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -D_XATTR_VERSION="0.7.1" -D_XATTR_AUTHOR="Iustin Pop" -D_XATTR_EMAIL="iustin@k1024.org" -I/Users/tmsincomb/anaconda3/include/python3.8 -c xattr.c -o build/temp.macosx-10.9-x86_64-3.8/xattr.o -Wall -Werror -Wsign-compare
  clang-10: error: -Wl,-export_dynamic: 'linker' input unused [-Werror,-Wunused-command-line-argument]
  clang-10: error: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk: 'linker' input unused [-Werror,-Wunused-command-line-argument]
  clang-10: error: /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk: 'linker' input unused [-Werror,-Wunused-command-line-argument]
  error: command 'x86_64-apple-darwin13.4.0-clang' failed with exit status 1

However testing it with MacOS Mojave with python3.8.1 I do not get an error. From what I can tell is that this is a Catalina specific issue so please feel free to close this issue, it is very likely it will work itself out.

I just wanted to bring this to your attention incase of any usefulness that would come from it.

iustin commented 4 years ago

Hey, thanks for the report, at least good to know. Unfortunately I don't have access to any MacOS, so debugging will be hard.

Just curious, what clang version is there on MacOS Mojave? I wonder if it's a MacOS difference, or a clang difference.

Another option is to edit the setup.py file and remove the -Werror setting; I think the "linker input unused" is just a warning, but -Werror makes it a hard error.

tmsincomb commented 4 years ago

You were correct about the clang difference - thanks! The issue was luckily already solved.

My current default Clang that works without LLVM installed:

> clang -v
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I was using LLVM where the Clang version read as:

> clang -v
clang version 10.0.0 
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Users/tmsincomb/anaconda3/envs/py38/bin

I was able to track down the specific error in building xattr. It would seem there is a default option -platform_version that is deprecated. The people working on LLVM mention it here https://reviews.llvm.org/D74784. Although LLVM was indicated as up-to-date on both brew and anaconda it would still crash for me. A forced reinstall for either being used would fix it. Although that Clang version printout for LLVM is the same with the reinstall there are no more errors/warnings.

There was someone else with the same issue here indicating this might be a lingering issue for the MacOS - LLVM users. https://stackoverflow.com/questions/62726754/mujoco-on-macos-catalina-ld-unknown-option-platform-version-when-importing/62746029#62746029.

iustin commented 4 years ago

Thanks for clarifying, and glad to hear it was solved.