diff --git a/autogen.sh b/autogen.sh index f56b53485..111f08ca6 100755 --- a/autogen.sh +++ b/autogen.sh @@ -1,7 +1,7 @@ #!/bin/bash set -e -lark_version=0.11.3 +lark_version=1.1.9 while [[ "$#" -gt 0 ]]; do case $1 in @@ -70,9 +70,14 @@ rm -Rf Makefile.in \ bin/config.h.in \ build-aux \ configure -# Remove Lark, but only if requested. +# Remove Lark if requested or the installed version does not match. +lark_found=$( shopt -s nullglob; \ + echo lib/lark*.dist-info | sed -E 's/^.*-([0-9.]+)\..*$/\1/' ) +if [[ $lark_found && $lark_found != "$lark_version" ]]; then + lark_shovel=yes +fi if [[ $lark_shovel ]]; then - rm -Rfv lib/lark lib/lark-stubs lib/lark*.dist-info lib/lark*.egg-info + rm -Rf lib/lark lib/lark-stubs lib/lark*.dist-info lib/lark*.egg-info fi # Create configure and friends. @@ -91,6 +96,11 @@ if [[ -z $clean ]]; then # Also remove Lark’s installer stuff. rm lib/lark/__pyinstaller/*.py rmdir lib/lark/__pyinstaller + # Some versions of pip install this file, while others don’t [1]. We + # don’t care about it, so remove it to avoid Make errors if it’s + # listed in Makefile.am and then an older pip is used to build. + # [1]: https://github.com/pypa/pip/pull/8026 + rm -f lib/lark-${lark_version}.dist-info/REQUESTED fi if [[ -e lib/lark \ && ! -e lib/lark-${lark_version}.dist-info/INSTALLER ]]; then diff --git a/bin/ch-test b/bin/ch-test index 45907d8ba..d5f3b7bc7 100755 --- a/bin/ch-test +++ b/bin/ch-test @@ -784,7 +784,7 @@ if [[ ! -f ${ch_base}/VERSION ]]; then else # build dir CHTEST_INSTALLED= - if [[ -d ${ch_base}/.git ]]; then + if [[ -e ${ch_base}/.git ]]; then CHTEST_GITWD=yes else CHTEST_GITWD= diff --git a/doc/dev.rst b/doc/dev.rst index 25d4989f0..8f7986c21 100644 --- a/doc/dev.rst +++ b/doc/dev.rst @@ -1574,11 +1574,11 @@ Updating bundled Lark parser ---------------------------- In order to change the version of the bundled lark parser you must modify -multiple files. To find them, e.g. for version 0.11.3 (the regex is hairy to +multiple files. To find them, e.g. for version 1.1.9 (the regex is hairy to catch both dot notation and tuples, but not the list of filenames in :code:`lib/Makefile.am`):: - $ misc/grep -E '0(\.|, )11(\.|, )3($|\s|\))' + $ misc/grep -E '1(\.|, )1(\.|, )9($|\s|\))' What to do in each location should either be obvious or commented. diff --git a/lib/Makefile.am b/lib/Makefile.am index bc2f2365e..8d8f1378c 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -21,39 +21,29 @@ mylib_DATA = contributors.bash \ version.sh \ version.txt -# Bundled Lark (currently version 0.11.3); Automake does not support wildcards +# Bundled Lark (currently version 1.1.9); Automake does not support wildcards # [1], so list the files. Note it's version-specific. Hopefully if a new # version of Lark adds a file and we omit it here by mistake, the tests will # catch it. To get this list: # -# $ (cd lib && find lark lark-stubs lark-*.dist-info -xtype f) | LC_ALL=C sort | sed -E 's/$/ \\/' +# $ (cd lib && find lark lark-*.dist-info -xtype f) | LC_ALL=C sort | sed -E 's/$/ \\/' # # Then, copy-n-paste & remove the last backslash. PROOFREAD YOUR DIFF!!! LARK = \ -lark-0.11.3.dist-info/INSTALLER \ -lark-0.11.3.dist-info/LICENSE \ -lark-0.11.3.dist-info/METADATA \ -lark-0.11.3.dist-info/RECORD \ -lark-0.11.3.dist-info/WHEEL \ -lark-0.11.3.dist-info/entry_points.txt \ -lark-0.11.3.dist-info/top_level.txt \ -lark-stubs/__init__.pyi \ -lark-stubs/ast_utils.pyi \ -lark-stubs/exceptions.pyi \ -lark-stubs/grammar.pyi \ -lark-stubs/indenter.pyi \ -lark-stubs/lark.pyi \ -lark-stubs/lexer.pyi \ -lark-stubs/load_grammar.pyi \ -lark-stubs/reconstruct.pyi \ -lark-stubs/tree.pyi \ -lark-stubs/visitors.pyi \ +lark-1.1.9.dist-info/INSTALLER \ +lark-1.1.9.dist-info/LICENSE \ +lark-1.1.9.dist-info/METADATA \ +lark-1.1.9.dist-info/RECORD \ +lark-1.1.9.dist-info/WHEEL \ +lark-1.1.9.dist-info/entry_points.txt \ +lark-1.1.9.dist-info/top_level.txt \ lark/__init__.py \ lark/ast_utils.py \ lark/common.py \ lark/exceptions.py \ lark/grammar.py \ +lark/grammars/__init__.py \ lark/grammars/common.lark \ lark/grammars/lark.lark \ lark/grammars/python.lark \ @@ -73,8 +63,9 @@ lark/parsers/grammar_analysis.py \ lark/parsers/lalr_analysis.py \ lark/parsers/lalr_interactive_parser.py \ lark/parsers/lalr_parser.py \ -lark/parsers/lalr_puppet.py \ +lark/parsers/lalr_parser_state.py \ lark/parsers/xearley.py \ +lark/py.typed \ lark/reconstruct.py \ lark/tools/__init__.py \ lark/tools/nearley.py \ @@ -82,6 +73,7 @@ lark/tools/serialize.py \ lark/tools/standalone.py \ lark/tree.py \ lark/tree_matcher.py \ +lark/tree_templates.py \ lark/utils.py \ lark/visitors.py if ENABLE_LARK diff --git a/lib/build.py b/lib/build.py index de434a7e2..41130763f 100644 --- a/lib/build.py +++ b/lib/build.py @@ -41,7 +41,7 @@ ## Imports not in standard library ## -# See charliecloud.py for the messy import of this. +# See image.py for the messy import of this. lark = im.lark @@ -1228,7 +1228,7 @@ class Rsync_G(Copy): def __init__(self, *args): super().__init__(*args) self.from_ = None # not supported yet - line_no = self.tree.line + line_no = self.tree.meta.line st = self.tree.child("option_plus") self.plus_option = "l" if st is None else st.terminal("OPTION_LETTER") options_done = False diff --git a/packaging/fedora/charliecloud.spec b/packaging/fedora/charliecloud.spec index 52dfaeabe..604f290f1 100644 --- a/packaging/fedora/charliecloud.spec +++ b/packaging/fedora/charliecloud.spec @@ -42,7 +42,7 @@ Requires: %{name} Requires: python3 Requires: python%{python3_pkgversion}-lark-parser Requires: python%{python3_pkgversion}-requests -Provides: bundled(python%{python3_pkgversion}-lark-parser) = 0.11.3 +Provides: bundled(python%{python3_pkgversion}-lark-parser) = 1.1.9 %description builder This package provides ch-image, Charliecloud's completely unprivileged container @@ -151,8 +151,7 @@ ln -s "${sphinxdir}/js" %{buildroot}%{_pkgdocdir}/html/_static/js %{_prefix}/lib/%{name}/force.py %{_prefix}/lib/%{name}/image.py %{_prefix}/lib/%{name}/lark -%{_prefix}/lib/%{name}/lark-0.11.3.dist-info -%{_prefix}/lib/%{name}/lark-stubs +%{_prefix}/lib/%{name}/lark-1.1.9.dist-info %{_prefix}/lib/%{name}/misc.py %{_prefix}/lib/%{name}/pull.py %{_prefix}/lib/%{name}/push.py diff --git a/packaging/fedora/upstream.spec b/packaging/fedora/upstream.spec index e284f0ed5..2c18743cd 100644 --- a/packaging/fedora/upstream.spec +++ b/packaging/fedora/upstream.spec @@ -151,7 +151,7 @@ ln -s "${sphinxdir}/js" %{buildroot}%{_pkgdocdir}/html/_static/js %{_prefix}/lib/%{name}/charliecloud.py %{_prefix}/lib/%{name}/fakeroot.py %{_prefix}/lib/%{name}/lark -%{_prefix}/lib/%{name}/lark-0.11.3.dist-info +%{_prefix}/lib/%{name}/lark-1.1.8.dist-info %{_prefix}/lib/%{name}/lark-stubs %{_prefix}/lib/%{name}/misc.py %{_prefix}/lib/%{name}/pull.py