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

grub-tb-common.inc: clone gnulib in do_fetch() #36

Merged
merged 4 commits into from
Aug 5, 2024

Conversation

macpijan
Copy link
Member

@macpijan macpijan commented Aug 1, 2024

Fixes #32

@macpijan
Copy link
Member Author

macpijan commented Aug 1, 2024

pre-commit fails for these changes:

OOPS - That shouldn't happen: list index out of range - ['recipes-extended/packagegroups/packagegroup-tb.bb', 'recipes-bsp/grub/grub-efi_%.bbappend', 'recipes-kernel/linux/linux-tb_6.6.bb', 'recipes-bsp/grub/grub_%.bbappend']
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/usr/lib64/python3.12/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
                    ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/multiprocessing/pool.py", line 48, in mapstar
    return list(map(*args))
           ^^^^^^^^^^^^^^^^
  File "/home/macpijan/.cache/pre-commit/repom6gr6rcr/py_env-python3/lib/python3.12/site-packages/oelint_adv/core.py", line 151, in group_run
    fixedfiles += r.fix(f, stash)
                  ^^^^^^^^^^^^^^^
  File "/home/macpijan/.cache/pre-commit/repom6gr6rcr/py_env-python3/lib/python3.12/site-packages/oelint_adv/rule_base/rule_var_multilineindent.py", line 72, in fix
    i.Raw = i.Raw.replace(_lines[index + 1], " " * _likeliest_indent + _lines[index + 1].lstrip())
                          ~~~~~~^^^^^^^^^^^
IndexError: list index out of range
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/macpijan/.cache/pre-commit/repom6gr6rcr/py_env-python3/lib/python3.12/site-packages/oelint_adv/__main__.py", line 107, in main
    issues = run(args)
             ^^^^^^^^^
  File "/home/macpijan/.cache/pre-commit/repom6gr6rcr/py_env-python3/lib/python3.12/site-packages/oelint_adv/core.py", line 385, in run
    issues = flatten(pool.map(partial(group_run, quiet=args.quiet, fix=args.fix,
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/multiprocessing/pool.py", line 367, in map
    return self._map_async(func, iterable, mapstar, chunksize).get()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.12/multiprocessing/pool.py", line 774, in get
    raise self._value
IndexError: list index out of range

Most likely, it does not like the SRCREV_something stuff? Should we report it to the upstream tool?

EDIT: asked here: priv-kweihmann/oelint-adv#603

@macpijan
Copy link
Member Author

macpijan commented Aug 1, 2024

BTW @m-iwanicki , we have had another failure on main branch already:

/home/macpijan/projects/trenchboot/meta-trenchboot/recipes-bsp/grub/grub-tb-common.inc:3:warning:oelint.var.order.PV:'PV' should be placed before 'SRC_URI'

@macpijan
Copy link
Member Author

macpijan commented Aug 1, 2024

pre-commit.ci run

@m-iwanicki
Copy link
Contributor

@macpijan We are using our fork of oelint and error is in multiline indent fix which was done by @PLangowski. From what I can see we use old commit, maybe tagged version fixes it.

@m-iwanicki
Copy link
Contributor

@macpijan added fix for .pre-commit (changed to newer version) and fixed oelint errors. But pre-commit.ci still errors out. This time it can't reach HOMEPAGE website. Maybe CI doesn't have internet connection?

Copy link
Contributor

@m-iwanicki m-iwanicki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine. From log.do_configure we can see that bootstrap doesn't clone gnulib:

DEBUG: Executing shell function do_configure
/build/tmp/work/core2-64-tb-linux/grub/2.06/git/bootstrap: Bootstrapping from checked-out grub sources...
/build/tmp/work/core2-64-tb-linux/grub/2.06/git/bootstrap: consider installing git-merge-changelog from gnulib
Note: switching to 'd271f868a8df9bbec29049d01e056481b7a1a263'.

@SergiiDmytruk
Copy link
Member

I later noticed that while this fixes building the image, tb.sh build grub still fails the same. The build probably needs to pass --gnulib-srcdir to bootstrap and point it at gnulib checkout.

I simply edited bootstrap to hardcode GNULIB_SRCDIR=/build/workspace/sources/gnulib, put gnulib there and committed the change (seems like building does git reset and possibly git clean). Then after first tb.sh build grub doing rm grub-core/extra_deps.lst in sources is necessary because despite out-of-tree build, it appears in the source tree and causes an error.

Another change was needed because grub 2.12+ installes bash completion which maybe wasn't installed in 2.06 by default:

 recipes-bsp/grub/grub_%.bbappend | 1 +
 1 file changed, 1 insertion(+)

diff --git a/recipes-bsp/grub/grub_%.bbappend b/recipes-bsp/grub/grub_%.bbappend
index 9d1688b..4430dfe 100644
--- a/recipes-bsp/grub/grub_%.bbappend
+++ b/recipes-bsp/grub/grub_%.bbappend
@@ -6,6 +6,7 @@ SRC_URI += "file://0001-add-root-flag-to-grub-bios-setup.patch"
 
 FILES:${PN}-common += " \
     ${libdir}/grub/i386-pc \
+    ${datadir}/bash-completion \
 "
 
 RDEPENDS:${PN}-common += "diffutils freetype"

Don't know if that's the proper way of handling it. Will these steps combined building and deploying grub with tb.sh works.

@m-iwanicki
Copy link
Contributor

@SergiiDmytruk tb.sh build deletes gnulib folder every time because otherwise build failed as described in #31

I guess I could either try to copy gnulib from cache before each build or try to find more precise reason why it fails.

@m-iwanicki
Copy link
Contributor

@macpijan I changed homepageping to info on oelint config. Now all checks pass.

@macpijan macpijan merged commit 27d464a into master Aug 5, 2024
1 check passed
@macpijan macpijan deleted the clone-gnulib-in-do-fetch branch August 5, 2024 11:15
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.

grub build issue
3 participants