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

Should ./configure script alert of ALL missing packages that python needs before compiling? #118670

Open
osergioabreu opened this issue May 6, 2024 · 8 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@osergioabreu
Copy link

osergioabreu commented May 6, 2024

Bug report

Bug description:

I was installing python, and noticed that ./configure script does NOT alert about ALL missing packages that python needs before compiling. Shouldn't it WARN clearly about all missing packages that SSL module depends?

Sometimes the compiler throws a RED ERROR too fast in the scrolling terminal console but I saw it, it was a C header file missing. So I recompiled with attention to discover "what is this red thing (error)?" and was a header from libffi-dev that I had to install.

Is there a way that the compiler STOPS when a critical error occur at least ? I think using EXIT would be a good approach, as the error would be in the screen doing what I expected.

CPython versions tested on:

3.10

Operating systems tested on:

Linux

@osergioabreu osergioabreu added the type-bug An unexpected behavior, bug, or error label May 6, 2024
@Agent-Hellboy
Copy link
Contributor

yes, I once created #116461

@eli-schwartz
Copy link
Contributor

Do you want it to warn or error?

@osergioabreu
Copy link
Author

It would be friendly to list them:
"ERROR: These packages are required by python to compile but they were not found in your system:

  • package one
  • package foo
  • package bar
    Please install them and retry.

@eli-schwartz
Copy link
Contributor

Reporting on exact package names to install is a hard problem to solve since there are many different linux distros and suggesting:

build-essential checkinstall
libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

will not work since e.g. my distro doesn't have any such packages.

Listing software components like "needs OpenSSL, Readline, ncurses, SQLite, Tk, GDBM, bzip2" could work.

The real trick here is deciding whether they are needed or intentionally omitted. This could be done using autoconf --enable-ssl / --disable-ssl and failing if not found, but you also want a "check" option for the current autodetection...

You can do:

export PYTHONSTRICTEXTENSIONBUILD=1

and make will error out at the end if it failed to build any modules it expected to create -- even if those modules failed for reasons other than a missing configure dependency.

@osergioabreu
Copy link
Author

osergioabreu commented May 7, 2024

Let me explain better:
Sometimes the compiler throws a RED ERROR too fast in the scrolling terminal console but I saw it, it was a C header file missing. So I recompiled with attention to discover "what is this red thing (error)?" and was a header from libffi-dev that I had to install

Is there a way that the compiler STOPS when a critical error occur at least ? I think using EXIT would be a good approach, as the error would be in the screen doing what I expected.

@Agent-Hellboy
Copy link
Contributor

Let me explain better:
Sometimes the compiler throws a RED ERROR too fast in the scrolling terminal console but I saw it, it was a C header file missing. So I recompiled with attention to discover "what is this red thing (error)?" and was a header from libffi-dev that I had to install

pipe the output to grep the missing headers

@osergioabreu
Copy link
Author

osergioabreu commented May 10, 2024 via email

@eli-schwartz
Copy link
Contributor

Well, as I noted you can already tell CPython to emit a make error if a failure occurred.

I guess running make twice could result in the error bubbling up in a much more readable manner. It's a trick I often use to collect build errors:

make -j8 -k # keep going and build everything possible
make -k # print errors for anything that failed the first time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants