Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

List index out of range when building #118

Open
MathVerg opened this issue Oct 22, 2022 · 5 comments
Open

List index out of range when building #118

MathVerg opened this issue Oct 22, 2022 · 5 comments
Assignees

Comments

@MathVerg
Copy link

Describe the bug
When building httpreply with kraft I get a python "list index out of range"

To Reproduce
Steps to reproduce the behavior:

  1. kraft up -t httpreply httpreply
  2. Error appears at the beginning of the build phase

Expected behavior
I would expect the template to build properly, or at least to get a more descriptive error.

Screenshots
Screenshot_20221022_120917

Desktop (please complete the following information):

  • OS: Manjaro Linux
  • Version 5.15.74-3-MANJARO

Additional context
GCC 12.2.0
Python 3.10.7
kraft 0.5.0.dev491

@MathVerg
Copy link
Author

Here is the full stack trace of the build stage :

/usr/lib/python3.10/site-packages/pkg_resources/__init__.py:123: PkgResourcesDeprecationWarning: git-archive.dev8b63d73a17 is an invae
  warnings.warn(
[DEBUG   ] Synchronizing cache with filesystem...
[DEBUG   ] Checking cache for staleness...
[DEBUG   ] Building /run/media/matheo/data/Home/Documents/InfoPerso/Unikraft/httpreply...
[DEBUG   ] Using configuration files: /run/media/matheo/data/Home/Documents/InfoPerso/Unikraft/httpreply/kraft.yaml
[DEBUG   ] Retrieving https://github.com/unikraft/plat-* from cache...
[DEBUG   ] Retrieving https://github.com/unikraft/app-* from cache...
[DEBUG   ] Retrieving https://github.com/unikraft/lib-* from cache...
[DEBUG   ] Retrieving https://github.com/unikraft/unikraft.git from cache...
[CRITICAL] list index out of range
[CRITICAL] Traceback (most recent call last):
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/cmd/build.py", line 150, in cmd_build
    kraft_build(
  File "/usr/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/cmd/build.py", line 70, in kraft_build
    app.fetch()
  File "/usr/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/app/app.py", line 478, in fetch
    extra.extend(self.list_possible_mirrors())
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/app/app.py", line 453, in list_possible_mirrors
    for mirror in lib.origin_mirrors:
  File "/usr/lib/python3.10/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/lib/lib.py", line 217, in origin_mirrors
    if self.origin_filename is not None:
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/lib/lib.py", line 193, in origin_filename
    elif self.origin_provider is not None and \
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/lib/lib.py", line 249, in origin_provider
    if self._origin_provider is None and self.origin_url is not None:
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/lib/lib.py", line 147, in origin_url
    self._origin_url = intrusively_determine_lib_origin_url(self._localdir)
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/lib/lib.py", line 96, in intrusively_determine_lib_origin_url
    makefile_vars = make_list_vars(makefile_uk)['makefile']
  File "/home/matheo/.local/lib/python3.10/site-packages/kraft/util/make.py", line 88, in make_list_vars
    M[mname][q[0]] = q[2]
IndexError: list index out of range

@MathVerg
Copy link
Author

I found that the problem occurs when parsing the Makefile output, the format is not as expected. This may be due to my Make version (GNU Make 4.3), or to the fact that Make is running in French on my computer.
Here is the end of the "variables" section of the output of make -pnB -f Makefile.uk with the Makefile of lwip:

LC_IDENTIFICATION = fr_FR.UTF-8
# environnement
PKGFILE_PROMPT_INSTALL_MISSING = 1
# stats des tables de hachage de la variable « set » :
# Load=198/1024=19%, Rehash=0, Collisions=45/395=11%

# Valeurs de variable spécifiques au motif

I guess that in english " stats des tables de hachage de la variable « set » :" is matched by r"^#\s*variable"

@MathVerg
Copy link
Author

@antkern
Copy link

antkern commented Dec 9, 2022

Same problem here for the same reason. Could you merge the MathVerg's pull request (the #121 ) to FIX the issue ?

@nderjung
Copy link
Member

Hi,

We have now deprecated kraft in favour of KraftKit. Please can you try this tool instead, you won't run into this kind of error with it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants