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

More user-friendly build-time fatal error messages #13

Open
James-E-A opened this issue Jan 23, 2024 · 3 comments
Open

More user-friendly build-time fatal error messages #13

James-E-A opened this issue Jan 23, 2024 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@James-E-A
Copy link
Owner

Right now, if some innocent person merely tries to run pip install pypqc, they will be greeted with such inscrutable error messages as

error: command 'gcc' failed: No such file or directory`

`build/temp/pqc._lib.mceliece348864f_clean.c:50:14: fatal error: pyconfig.h: No such file or directory

This is simply unacceptable. Our build system should output meaningful messages, like

Couldn't find a C compiler while building from source.

It looks like you're on Windows; you can get a C compiler from: https://visualstudio.microsoft.com/visual-cpp-build-tools/

Once you have a C compiler, please try again. If it's still not working, let us know the problem at https://github.com/JamesTheAwesomeDude/pypqc/issues/new

Couldn't find Python development headers while building from source.

It looks like you're on Ubuntu; you should be able to get them by running:  apt install python3-dev

Once you have the Python development headers, please try again. If it's still not working, let us know the problem at https://github.com/JamesTheAwesomeDude/pypqc/issues/new

This will be seriously triaged if #9 gets resolved first, but it should still be fixed at some point.

@James-E-A James-E-A added the enhancement New feature or request label Jan 23, 2024
@James-E-A
Copy link
Owner Author

Cross-posted to Stack Overflow: https://stackoverflow.com/q/77686182/1874170

@James-E-A
Copy link
Owner Author

Also, #14

LINK : fatal error LNK1104: cannot open file 'build\temp.win-amd64-cpython-311\Release\Modules/PQClean/crypto_sign/sphincs-sha2-128f-simple/clean/../../../common\libsphincs_sha2_128f_simple_clean.exp'

Couldn't complete setup due to a file access error.

This is probably due to https://developercommunity.visualstudio.com/t/clexe-compiler-driver-cannot-handle-long-file-path/975889

Try creating C:\temp, then run  set "TMPDIR=C:\temp"  and try again.

@James-E-A
Copy link
Owner Author

Fw: my own comments on Stack Overflow

Tracing the setuptools spaghetti, it looks like setuptools._distutils.unixccompiler.UnixCCompiler:_compile() (et cetera) is the culprit; it's apparently ultimately called by setuptools.setup itself...

pypa/build ultimately seems to call your "backend"'s build_wheel, which does appear to be in my case setuptools' own.

So now I just need to figure out where and how to inject a try statement. Looks like maybe I'll need to migrate from setuptools-as-default-backend to an explicitly declared pseudo-subclass of build_meta?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant