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

Autoconf tweaks #265

Merged
merged 5 commits into from
Feb 9, 2025
Merged

Autoconf tweaks #265

merged 5 commits into from
Feb 9, 2025

Conversation

jnikula
Copy link
Owner

@jnikula jnikula commented Feb 8, 2025

I toyed with the new autoconf stuff and ran into some small issues. Fix and tweak it a bit.

The config options used by autoconf have type hints, but turns out the
type checks are run as config-inited events with a priority of 800. The
default priority is 500, making autoconf run before type checks.

This means having wrong type config settings in conf.py might throw a
backtrace from _autoconf before any warnings about it. It can be as
simple as setting hawkmoth_autoconf = None, leading to TypeError:
'NoneType' object is not iterable.

Use a priority of 850 for autoconf to delay it until after type
checks. This won't avoid any backtraces, but we'll get the warning
first, making the problem easier for the user to fix:

WARNING: The config value `hawkmoth_autoconf' has type `NoneType'; expected `list'.
Similar to hawkmoth_compiler. Seems slightly more natural than having to
set to [] to disable.
Indicate where None is allowed and that the lists are lists of
strings. (Though the Sphinx type checker does not seem to enforce this.)
It can be difficult to debug issues with header search path. Debug log
the discovered include arguments for each language.
Document the default value of ['stdinc'] and describe how to disable
autoconf.

Drop the same from hawkmoth_compiler, as it's not quite
accurate. Setting hawkmoth_compiler to None leads to WARNING: autoconf:
'stdinc' option ignored (missing compiler).
@jnikula jnikula requested a review from BrunoMSantos February 8, 2025 15:47
@BrunoMSantos
Copy link
Collaborator

Shiny. Looks great!

@jnikula jnikula merged commit b07a1ff into master Feb 9, 2025
6 checks passed
@jnikula jnikula deleted the autoconf-tweaks branch February 9, 2025 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants