Skip to contentSkip to conversation

LTP drop MUSL specific patch

DISCUSSION Petr Vorel 2 participants 6 messages Apr 26, 2021 – Apr 27, 2021

lore
Share & tools
lore

Petr Vorel

author
#0 lore raw

Hi Khem, Richard,

I'd like to replace MUSL specific patch meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch with just removing broken files. We use this in upstream CI for Alpine, I ported it to Buildroot [2], where works well. It's better because it does allow to handle MUSL without rebasing this patch.

I was looking into the docs, it looks to me that do_configure [3] might be good hook to add it into. But it looks like by default it contains oe_runmake clean [4]. Or should I use different hook? And how to find the default content of chosen hook? (if I need to extend it, I'll have to provide the original as well)

Thanks for info.

Kind regards,
Petr

[1] https://github.com/linux-test-project/ltp/blob/master/travis/alpine.sh#L35
[2] https://git.busybox.net/buildroot/tree/package/ltp-testsuite/ltp-testsuite.mk#n72
[3] https://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#new-dependencies
[4] https://www.yoctoproject.org/docs/2.5/ref-manual/ref-manual.html#ref-tasks-configure

#1 lore raw
Quoted 9 lines · Petr Vorel

Hi Khem, Richard,

I'd like to replace MUSL specific patch meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch with just removing broken files. We use this in upstream CI for Alpine, I ported it to Buildroot [2], where works well. It's better because it does allow to handle MUSL without rebasing this patch.

Quoted 4 lines

I was looking into the docs, it looks to me that do_configure [3] might be good hook to add it into. But it looks like by default it contains oe_runmake clean [4]. Or should I use different hook? And how to find the default content of chosen hook? (if I need to extend it, I'll have to provide the original as well)

Changes to source files, including removing them, should be done as part of the do_patch task. Since do_patch is implemented in python you can't simply _append shell script commands to it, but you can add a shell function via do_patch[postfuncs]. If you grep for "do_patch[postfuncs]" in oe-core you should find a few examples.

Quoted 13 lines

Thanks for info.

Kind regards,
Petr

[1] https://github.com/linux-test-project/ltp/blob/master/travis/alpine.sh#L35
[2] https://git.busybox.net/buildroot/tree/package/ltp-testsuite/ltp-testsuite.mk#n72
[3] https://www.yoctoproject.org/docs/2.5/dev-manual/dev-manual.html#new-dependencies
[4] https://www.yoctoproject.org/docs/2.5/ref-manual/ref-manual.html#ref-tasks-configure

author
#2 lore raw

Hi Andre,

Quoted 15 lines · Petr Vorel
Quoted 9 lines

Hi Khem, Richard,

I'd like to replace MUSL specific patch meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch with just removing broken files. We use this in upstream CI for Alpine, I ported it to Buildroot [2], where works well. It's better because it does allow to handle MUSL without rebasing this patch.

Quoted 4 lines

I was looking into the docs, it looks to me that do_configure [3] might be good hook to add it into. But it looks like by default it contains oe_runmake clean [4]. Or should I use different hook? And how to find the default content of chosen hook? (if I need to extend it, I'll have to provide the original as well)

Quoted 5 lines

Changes to source files, including removing them, should be done as part of the do_patch task. Since do_patch is implemented in python you can't simply _append shell script commands to it, but you can add a shell function via do_patch[postfuncs]. If you grep for "do_patch[postfuncs]" in oe-core you should find a few examples.

Great, thanks a lot!

Kind regards,
Petr

author
#3 lore raw
In reply to Andre McCurdy

Hi all,

Quoted 15 lines · Petr Vorel
Quoted 9 lines

Hi Khem, Richard,

I'd like to replace MUSL specific patch meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch with just removing broken files. We use this in upstream CI for Alpine, I ported it to Buildroot [2], where works well. It's better because it does allow to handle MUSL without rebasing this patch.

Quoted 4 lines

I was looking into the docs, it looks to me that do_configure [3] might be good hook to add it into. But it looks like by default it contains oe_runmake clean [4]. Or should I use different hook? And how to find the default content of chosen hook? (if I need to extend it, I'll have to provide the original as well)

Quoted 5 lines

Changes to source files, including removing them, should be done as part of the do_patch task. Since do_patch is implemented in python you can't simply _append shell script commands to it, but you can add a shell function via do_patch[postfuncs]. If you grep for "do_patch[postfuncs]" in oe-core you should find a few examples.

One more question: how to make this function MUSL specific? I noticed some functions has suffix "_libc-musl" (e.g. do_install_append_libc-musl), but I guess this would not work for do_patch[postfuncs], where I specify the name.

Kind regards,
Petr

#4 lore raw
Quoted 24 lines · Petr Vorel

Hi all,

Quoted 15 lines · Petr Vorel
Quoted 9 lines

Hi Khem, Richard,

I'd like to replace MUSL specific patch meta/recipes-extended/ltp/ltp/0001-build-Add-option-to-select-libc-implementation.patch with just removing broken files. We use this in upstream CI for Alpine, I ported it to Buildroot [2], where works well. It's better because it does allow to handle MUSL without rebasing this patch.

Quoted 4 lines

I was looking into the docs, it looks to me that do_configure [3] might be good hook to add it into. But it looks like by default it contains oe_runmake clean [4]. Or should I use different hook? And how to find the default content of chosen hook? (if I need to extend it, I'll have to provide the original as well)

Quoted 5 lines

Changes to source files, including removing them, should be done as part of the do_patch task. Since do_patch is implemented in python you can't simply _append shell script commands to it, but you can add a shell function via do_patch[postfuncs]. If you grep for "do_patch[postfuncs]" in oe-core you should find a few examples.

Quoted 4 lines

One more question: how to make this function MUSL specific? I noticed some functions has suffix "_libc-musl" (e.g. do_install_append_libc-musl), but I guess this would not work for do_patch[postfuncs], where I specify the name.

You can either use an intermediate variable in the recipe, e.g.

  PRUNESOURCE = ""
  PRUNESOURCE_libc-musl = "the-real-function"
  do_patch[postfuncs] += "${PRUNESOURCE}"

Or you can call the script unconditionally and check if [ "${TCLIBC}" = "musl" ] from inside it.

author
#5 lore raw

Hi Andre,

...

Quoted 5 lines
Quoted 4 lines

One more question: how to make this function MUSL specific? I noticed some functions has suffix "_libc-musl" (e.g. do_install_append_libc-musl), but I guess this would not work for do_patch[postfuncs], where I specify the name.

Quoted 8 lines

You can either use an intermediate variable in the recipe, e.g.

  PRUNESOURCE = ""
  PRUNESOURCE_libc-musl = "the-real-function"
  do_patch[postfuncs] += "${PRUNESOURCE}"

Or you can call the script unconditionally and check if [ "${TCLIBC}" = "musl" ] from inside it.

Thank you!

Kind regards,
Petr