| Age | Commit message (Collapse) | Author |
|
Parsing performance improvements related to help texts:
- c800f70 ("Simplify _deindent()")
- 707204a ("Get rid of _next_help_line()")
- f0a87cc ("Micro-optimize _T_HELP parsing")
Also includes various code nits.
Brings 'make scriptconfig' with allyesconfig.py down to 1.3 seconds,
including the 'make' overhead.
|
|
|
|
Shaves a few % more from _parse_properties().
|
|
Speeds things up a bit further.
Rework the unget handling to save the ungotten line directly instead of
using a flag.
Add some help texts to tests/Klocation to make sure the line number is
updated properly for those.
|
|
Bit easier to read.
|
|
Factors out some code and makes the logic a bit more transparent. It's
only used for help text lines.
|
|
Bit clearer.
|
|
Old code. Can't remember why it kept lines shorter than the indent as-is
instead of clearing them, but it's pointless for help texts, which is
the only place where _deindent() is used. s[n:] is safe even if
n >= len(s).
Help text parsing is pretty hot code too, so every bit helps.
|
|
|
|
- 97c7501 ("Fix 'source "missing"' error message for Python 3") makes
the hint re. environment variables display properly for Python 3 when
a sourced file can't be opened.
- 8574dc5 ("Make PyPI's README formatter happy") makes PyPI format the
README properly.
|
|
IOError() generates an OSError in Python 3.6. OSError does not have a
'message' attribute, which caused the following error when trying to add
the hint re. environment variables (the rest of the message was still
displayed):
AttributeError: 'OSError' object has no attribute 'message'
Use str(exception) instead, which seems to work for both Python 2 and
Python 3.
|
|
No longer displayed as an unformatted blob of text.
|
|
- 7dc5b74 ("Detect recursive 'source' and print backtrace") makes
debugging recursive 'source's a bit easier.
- Various minor code nits.
|
|
Try to unbreak PyPI display.
|
|
See if this unbreaks the display on PyPI.
|
|
"Active user value" might have been a bit unclear. The symbol needs to
be visible.
|
|
Bit neater.
|
|
|
|
Check for incorrect exceptions instead of propagating them, and get rid
of the flag.
|
|
Easier to debug than a RecursionError.
Point out in the exception message that a common cause is environment
variables not being set correctly.
|
|
|
|
And rename it to _rec_invalidate_if_has_prompt(). Always used in this
way in practice.
|
|
- 94c63de ("Support disabling warnings for redundant assignments")
adds support for disabling warnings in the case where a symbol is
assigned more than once within a .config file but always assigned the
same value.
Contributed by Sebastian Bøe.
- Various other minor code nits.
|
|
Saves a tiny bit of bytecode too.
|
|
|
|
Implicit submenus are created after parsing, in _finalize_tree(), so the
parent can never be a symbol in _parse_block().
|
|
Old code.
|
|
It's set to -1 in every return path, so we can just do it at the
beginning instead.
|
|
|
|
Choice symbols without prompts are pointless and probably nonexistent in
practice, so it's a bit silly to run the no-prompt optimization for
them.
Piggyback copyright year update.
|
|
Saves a tiny bit of bytecode too.
|
|
Already know the value.
|
|
|
|
Also switch to a faster local lookup for the second _T_HELP.
Micro-optimization -- shaves a % or two of the _tokenize() runtime. We
expect a token for valid Kconfig files, so the naming is still fine.
|
|
Support disabling warnings for redundant assignments
|
|
The Linux Kernel's merge_config.sh defaults to disabling warnings for
redundant assignments and has support for enabling them
specifically. This patch reproduces this behaviour in kconfiglib
except that we retaing kconfiglib's default behaviour of enabling the
warnings.
Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
|
|
|
|
Piggyback some cleanup and redundant comment removal.
|
|
|
|
|
|
- d2a2727 (Implement autoconf.h generation) adds support for generating
C headers in the same format as used for include/generated/autoconf.h
in the kernel, contributed by Carles Cufi from the Zephyr project.
- 5d693b2 (Don't write out 'option env' symbols to C header) makes
it so that attempts to manually set user values on 'option env'
symbols are rejected (though such symbols were never written out to
.config files).
|
|
Simpler.
I realized there's actually no need to follow the node pointers, since
menus and comments never generate output.
|
|
|
|
Oversight. SYMBOL_AUTO (env_var) being set indirectly clears
SYMBOL_WRITE (_write_to_conf) in sym_calc_value(). The .config case was
already fine due to an explicit env_var check.
Even non-visible env. symbols ended up in the header, due to
'option env' internally adding a default.
Disallow user values altogether on 'option env' symbols, even if
specified manually. This matches the C implementation. Add a warning
too.
|
|
Implement autoconf.h generation
|
|
Implement the generation of the C header file that mirrors the .config
files, commonly named autoconf.h.
Signed-off-by: Carles Cufi <carles.cufi@nordicsemi.no>
|
|
Functions similarly to scripts/kconfig/merge_config.sh from the kernel.
Came up in https://github.com/zephyrproject-rtos/zephyr/pull/5417.
|
|
Not passing -p1 causes the root Makefile to be patched instead of
scripts/kconfig/Makefile, as discovered in
https://github.com/ulfalizer/Kconfiglib/issues/32.
|
|
- Small parsing performance improvements:
80b9198 (Micro-optimize Symbol.__init__() a bit)
626b6ea (Check for type first when parsing properties)
d6aa5cf (Tokenize in _next_line())
- Minor documentation nits (typos, etc.)
|
|
|