Skip to content

[BREAKING]libc/elf: rename modlib to libelf #15765

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

Merged
merged 1 commit into from
Apr 11, 2025
Merged

Conversation

anchao
Copy link
Contributor

@anchao anchao commented Feb 5, 2025

Summary

libc/elf: rename modlib to libelf

Renaming "modlib" to "elf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an [email protected]

Impact

N/A, depends on apache/nuttx-apps#2985

Testing

sim/sotest

@github-actions github-actions bot added Area: Documentation Improvements or additions to documentation Area: Tooling Area: Build system Arch: arm Issues related to ARM (32-bit) architecture Arch: arm64 Issues related to ARM64 (64-bit) architecture Arch: avr Issues related to all AVR(8-bit or 32-bit) architectures Arch: ceva Issues related to CEVA architecture Arch: mips Issues related to the MIPS architecture Arch: openrisc Issues related to the OpenRISC architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: simulator Issues related to the SIMulator Arch: sparc Issues related to the SPARC architecture Arch: tricore Issues related to the TriCore architecture from Infineon Arch: x86 Issues related to the x86 architecture Arch: x86_64 Issues related to the x86_64 architecture Arch: xtensa Issues related to the Xtensa architecture Arch: z16 Issues related to the Z16 architecture Arch: z80 Issues related to the Z80 architecture Area: Memory Management Memory Management issues Area: OS Components OS Components issues Area: BINFMT Board: arm Board: arm64 Board: renesas Board: risc-v Board: simulator Board: sparc Board: xtensa Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces. labels Feb 5, 2025
@nuttxpr
Copy link

nuttxpr commented Feb 5, 2025

[Experimental Bot, please feedback here]

No. This PR, as described, does not fully meet the NuttX requirements. Here's why:

  • Insufficient Impact Assessment: Simply stating "N/A" for impact is unacceptable. Even a seemingly simple rename can have impacts. At a minimum, the developer needs to confirm:

    • Impact on user: Will any application code need to be changed due to the config option rename? Even if the answer is no, it needs to be explicitly stated.
    • Impact on documentation: The documentation needs to be updated to reflect the name change. The PR should either include these changes or explain why they are not necessary.
    • Impact on compatibility: Does this change break any backward compatibility? Again, even if the answer is no, it needs to be explicitly stated and justified.
  • Insufficient Testing Information: "sim/sotest" is not enough information. The PR needs to specify:

    • Build Host: What operating system, compiler version, etc. was used to build NuttX?
    • Target Details: What simulator was used (qemu, etc.)? What architecture? What configuration?
    • Testing Logs: The PR includes placeholders for logs, but no actual logs are provided. There needs to be concrete evidence that the change works as intended. What tests were run? What were the results before and after the change?

In short, while the summary provides a reasonable explanation for the why, the impact and testing sections lack crucial details required for proper review and acceptance.

@anchao
Copy link
Contributor Author

anchao commented Apr 9, 2025

@anchao Is there a tiny possibility that we misread this? Because I see that we have support for the Breaking PR: https://lists.apache.org/thread/v7d7k1n2d1tl8n6o3pnocbz33knx3gmp

i personally like the change itself and prefer loosening the rules in CONTRIBUTING.md though.

In any case: An objection to the Breaking PR should rightfully be accompanied by an Alternative Solution: https://www.apache.org/foundation/voting.html#Veto

A -1 vote by a qualified voter stops a code-modification proposal in its tracks. This constitutes a veto, and it cannot be overruled nor overridden by anyone. Vetoes stand until and unless the individual withdraws their veto.

To prevent vetoes from being used capriciously, the voter must provide with the veto a technical justification showing why the change is bad (opens a security exposure, negatively affects performance, etc. ). A veto without a justification is invalid and has no weight.

It doesn't matter, I have done what I should do and explained a lot

@xiaoxiang781216
Copy link
Contributor

@anchao please rebase the patch, so we can merge it after your close the vote with approving.

@lupyuen
Copy link
Member

lupyuen commented Apr 9, 2025

Sorry @xiaoxiang781216: We can't merge this Breaking PR because we have a Blocking Vote:

According to the Apache Rules for Code Changes: We need to resolve the Blocking Vote before merging the Breaking PR:

@anchao
Copy link
Contributor Author

anchao commented Apr 10, 2025

@anchao please rebase the patch, so we can merge it after your close the vote with approving.

Done

@anchao
Copy link
Contributor Author

anchao commented Apr 10, 2025

Sorry @xiaoxiang781216: We can't merge this Breaking PR because we have a Blocking Vote:

According to the Apache Rules for Code Changes: We need to resolve the Blocking Vote before merging the Breaking PR:

I asked @yamt san for his opinion again in the email. Let's wait for reply.

@lupyuen
Copy link
Member

lupyuen commented Apr 10, 2025

Thanks @anchao! The CI Jobs are still running non-stop, I'll check for errors here:
https://gist.github.com/nuttxpr

@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Apr 10, 2025

Sorry @xiaoxiang781216: We can't merge this Breaking PR because we have a Blocking Vote:

* [[BREAKING]libc/elf: rename modlib to libelf #15765 (comment)](https://github.com/apache/nuttx/pull/15765#issuecomment-2788825199)

According to the Apache Rules for Code Changes: We need to resolve the Blocking Vote before merging the Breaking PR:

* https://www.apache.org/foundation/voting.html#Veto

one person(not PMC or contributor) vote -1 shouldn't block the merge, otherwise the project will be dead.

@xiaoxiang781216 xiaoxiang781216 marked this pull request as ready for review April 10, 2025 02:38
@xiaoxiang781216
Copy link
Contributor

@anchao please go ahead to close vote with approving, I will merge this patch.

@lupyuen
Copy link
Member

lupyuen commented Apr 10, 2025

@xiaoxiang781216: Unfortunately that's what our NuttX Community has agreed on. And it's also consistent with the Apache Way. Perhaps you would like to propose a change to the NuttX Contribution Rules:
#15950

@xiaoxiang781216
Copy link
Contributor

xiaoxiang781216 commented Apr 10, 2025

@xiaoxiang781216: Unfortunately that's what our NuttX Community has agreed on. And it's also consistent with the Apache Way. Perhaps you would like to propose a change to the NuttX Contribution Rules: #15950

  1. One -1 vote from non PMC/commiter shouldn't block the breaking change.
  2. If the number of "vote +1" exceeds a certain ratio of "vote -1" votes, the breaking change can be merged.

@tmedicci do you consider relax the breaking change rule? it's too restrict that one -1 vote block the patch merge.

@anchao
Copy link
Contributor Author

anchao commented Apr 10, 2025

@xiaoxiang781216: Unfortunately that's what our NuttX Community has agreed on. And it's also consistent with the Apache Way. Perhaps you would like to propose a change to the NuttX Contribution Rules: #15950

@xiaoxiang781216 @lupyuen

@yamt withdrew his -1 vote, I think we can go ahead

@lupyuen
Copy link
Member

lupyuen commented Apr 10, 2025

@anchao Great! Let's wait for 72 hours before closing the vote, thanks for pushing this through :-)

@lupyuen
Copy link
Member

lupyuen commented Apr 10, 2025

Sorry @anchao: Would you know why esp32-devkitc:elf is failing?
https://gist.github.com/lupyuen/4753bc001049f284dde7105d50726aa5

sudo docker run -it ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest /bin/bash -c '
  set -x ;
  uname -a ;
  cd ;
  pwd ;
  git clone https://github.com/anchao/nuttx nuttx --branch 25020501 ;
  git clone https://github.com/anchao/nuttx-apps apps --branch 25020501 ;
  pushd nuttx ; git reset --hard HEAD ; echo NuttX Source: https://github.com/apache/nuttx/tree/$(git rev-parse HEAD) ; popd ;
  pushd apps  ; git reset --hard HEAD ; echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/$(git rev-parse HEAD) ; popd ;
  cd nuttx ;
  tools/configure.sh esp32-devkitc:elf ;
  make -j || echo '\''***** BUILD FAILED'\'' ;
'

xtensa-esp32-elf-ld: cannot open linker script file /root/nuttx/libs/libc/modlib/gnu-elf.ld: No such file or directory

Update: The build is OK now: https://gist.github.com/lupyuen/764344525cd60840c2a06cfd06bf758b

Renaming "modlib" to "libelf" is more in line with the implementation content,
which makes it easier for individual developers to understand the capabilities of this module.

CONFIG_LIBC_MODLIB -> CONFIG_LIBC_ELF

Signed-off-by: chao an <[email protected]>
@anchao
Copy link
Contributor Author

anchao commented Apr 10, 2025

Sorry @anchao: Would you know why esp32-devkitc:elf is failing? https://gist.github.com/lupyuen/4753bc001049f284dde7105d50726aa5

sudo docker run -it ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest /bin/bash -c '
  set -x ;
  uname -a ;
  cd ;
  pwd ;
  git clone https://github.com/anchao/nuttx nuttx --branch 25020501 ;
  git clone https://github.com/anchao/nuttx-apps apps --branch 25020501 ;
  pushd nuttx ; git reset --hard HEAD ; echo NuttX Source: https://github.com/apache/nuttx/tree/$(git rev-parse HEAD) ; popd ;
  pushd apps  ; git reset --hard HEAD ; echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/$(git rev-parse HEAD) ; popd ;
  cd nuttx ;
  tools/configure.sh esp32-devkitc:elf ;
  make -j || echo '\''***** BUILD FAILED'\'' ;
'

xtensa-esp32-elf-ld: cannot open linker script file /root/nuttx/libs/libc/modlib/gnu-elf.ld: No such file or directory

Update: The build is OK now: https://gist.github.com/lupyuen/764344525cd60840c2a06cfd06bf758b

@lupyuen Conflict with #16154, please help to trigger again...
#16154

@lupyuen
Copy link
Member

lupyuen commented Apr 10, 2025

Wonder if anyone has a faster Ubuntu PC that can run the script below and capture the CI Logs? Otherwise we'll be stuck waiting another 36 hours for my PC to complete the CI Checks :-(

  for job in \
    arm-01 arm-02 arm-03 arm-04 \
    arm-05 arm-06 arm-07 arm-08 \
    arm-09 arm-10 arm-11 arm-12 \
    arm-13 arm-14 \
    arm64-01 \
    other \
    risc-v-01 risc-v-02 risc-v-03 risc-v-04 \
    risc-v-05 risc-v-06 risc-v-07 \
    sim-01 sim-02 sim-03 \
    x86_64-01 \
    xtensa-01 xtensa-02 xtensa-03
  do

    sudo docker run -it \
      ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest \
      /bin/bash -c "
      set -x ;
      uname -a ;
      cd ;
      pwd ;
      git clone https://github.com/anchao/nuttx nuttx --branch 25020501 ;
      git clone https://github.com/anchao/nuttx-apps apps --branch 25020501 ;
      pushd nuttx ; git reset --hard HEAD ; echo NuttX Source: https://github.com/apache/nuttx/tree/\$(git rev-parse HEAD) ; popd ;
      pushd apps  ; git reset --hard HEAD ; echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/\$(git rev-parse HEAD) ; popd ;
      cd nuttx/tools/ci ;
      ( sleep 10800 ; echo Killing pytest after timeout... ; pkill -f pytest )&
      (./cibuild.sh -c -A -N -R testlist/$job.dat || echo '***** BUILD FAILED') ;    
      "
  done

@anchao
Copy link
Contributor Author

anchao commented Apr 10, 2025

Wonder if anyone has a faster Ubuntu PC that can run the script below and capture the CI Logs? Otherwise we'll be stuck waiting another 36 hours for my PC to complete the CI Checks :-(

  for job in \
    arm-01 arm-02 arm-03 arm-04 \
    arm-05 arm-06 arm-07 arm-08 \
    arm-09 arm-10 arm-11 arm-12 \
    arm-13 arm-14 \
    arm64-01 \
    other \
    risc-v-01 risc-v-02 risc-v-03 risc-v-04 \
    risc-v-05 risc-v-06 risc-v-07 \
    sim-01 sim-02 sim-03 \
    x86_64-01 \
    xtensa-01 xtensa-02 xtensa-03
  do

    sudo docker run -it \
      ghcr.io/apache/nuttx/apache-nuttx-ci-linux:latest \
      /bin/bash -c "
      set -x ;
      uname -a ;
      cd ;
      pwd ;
      git clone https://github.com/anchao/nuttx nuttx --branch 25020501 ;
      git clone https://github.com/anchao/nuttx-apps apps --branch 25020501 ;
      pushd nuttx ; git reset --hard HEAD ; echo NuttX Source: https://github.com/apache/nuttx/tree/\$(git rev-parse HEAD) ; popd ;
      pushd apps  ; git reset --hard HEAD ; echo NuttX Apps: https://github.com/apache/nuttx-apps/tree/\$(git rev-parse HEAD) ; popd ;
      cd nuttx/tools/ci ;
      ( sleep 10800 ; echo Killing pytest after timeout... ; pkill -f pytest )&
      (./cibuild.sh -c -A -N -R testlist/$job.dat || echo '***** BUILD FAILED') ;    
      "
  done

Maybe we can just run the configuration if CONFIG_ELF enabled:

$ grep -nIr CONFIG_ELF=y boards/ | awk -F'/' '{print $4"/"$6}' 
xx3823/nsh
s698pm-dkit/nsh
s698pm-dkit/smp
xx3803/nsh
spresense/rndis_smp
spresense/module
spresense/wifi
spresense/wifi_smp
spresense/rndis
spresense/posix_spawn
spresense/rndis_composite
spresense/elf
nucleo-h743zi/elf
same70-xplained/pysim
olimex-stm32-p407/kelf
stm32f4discovery/composite
stm32f4discovery/wifi
stm32f4discovery/rndis
stm32f4discovery/posix_spawn
stm32f4discovery/adb
stm32f4discovery/elf
lm3s6965-ek/qemu-flat
lm3s6965-ek/qemu-protected
...
rv-virt/knsh64
arty_a7/knsh-tickless
arty_a7/knsh
esp32c3-devkit/elf
esp32-devkitc/elf
esp32s3-devkit/elf
avaota-a1/nsh
qemu-armv8a/knsh

e.g esp32-devkitc:elf that just failed is in this list

@cederom cederom linked an issue Apr 10, 2025 that may be closed by this pull request
@lupyuen
Copy link
Member

lupyuen commented Apr 10, 2025

Hi @anchao: Please remember to Close the Voting, so we don't receive any more Blocking Votes. Thanks :-)

I'm now running 6 Concurrent CI Jobs on my Ubuntu Server, hope to finish all CI Checks within 12 hours. The CI Logs will appear here: https://gist.github.com/search?q=user%3Anuttxpr+8b9d2c0cfc74361c212733fdcd119c9f6da628b4&ref=searchresults

Screenshot 2025-04-10 at 9 26 45 PM

Copy link
Member

@lupyuen lupyuen left a comment

Choose a reason for hiding this comment

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

@anchao Please close the voting. Thanks :-)

This Breaking PR compiles with the NuttX Breaking Changes Handling Process:

@anchao
Copy link
Contributor Author

anchao commented Apr 11, 2025

@anchao Please close the voting. Thanks :-)

This Breaking PR compiles with the NuttX Breaking Changes Handling Process:

@lupyuen Thank you, I have sent the voting end email in the community group, the final result is:

+1: 9
+0: 3
-1: 0

@lupyuen lupyuen merged commit 5248221 into apache:master Apr 11, 2025
13 of 40 checks passed
@tmedicci
Copy link
Contributor

Sorry @tmedicci: Is the build for esp32s3-devkit:python successful when we see these messages for our Special CI Build? https://gist.github.com/nuttxpr/ea0bcb70eec1207d7b83290535d4ea34#file-ci-xtensa-03-log-L183-L233

configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
  WARNING: The scripts pip3 and pip3.13 are installed in '/root/apps/interpreters/python/install/host/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
configure: WARNING: using cross tools not prefixed with host triplet
configure: WARNING: xtensa-esp32s3-nuttx/gcc is not supported
/root/apps/interpreters/python/Python/configure: line 10553: test: too many arguments
configure: WARNING: no system libmpdecimal found; falling back to bundled libmpdecimal (deprecated and scheduled for removal in Python 3.15)
/root/apps/interpreters/python/Python/configure: line 27327: test: =: unary operator expected
configure: WARNING:
Platform "xtensa-esp32s3-nuttx" with compiler "gcc" is not supported by the
CPython core team, see https://peps.python.org/pep-0011/ for more information.
Created /root/apps/interpreters/python/build/target/lib/python313.zip (3.11 MiB)
  [1/1] Normalize esp32s3-devkit/python
Untracked files:
	libs/libc/elf_sys_symtab.c

The above messages have appeared since March 30 (probably earlier), so I assume they are OK? testbuild.sh is terminating with an error, probably because of the Untracked File. Thanks!

Sorry Lup, I completely missed your message. Just tested it: everything is fine with the build/runtime testing. Just wondering why it's generating this file (not ignored).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Arch: arm Issues related to ARM (32-bit) architecture Arch: arm64 Issues related to ARM64 (64-bit) architecture Arch: avr Issues related to all AVR(8-bit or 32-bit) architectures Arch: ceva Issues related to CEVA architecture Arch: mips Issues related to the MIPS architecture Arch: openrisc Issues related to the OpenRISC architecture Arch: risc-v Issues related to the RISC-V (32-bit or 64-bit) architecture Arch: simulator Issues related to the SIMulator Arch: sparc Issues related to the SPARC architecture Arch: tricore Issues related to the TriCore architecture from Infineon Arch: x86 Issues related to the x86 architecture Arch: x86_64 Issues related to the x86_64 architecture Arch: xtensa Issues related to the Xtensa architecture Arch: z16 Issues related to the Z16 architecture Arch: z80 Issues related to the Z80 architecture Area: BINFMT Area: Build system Area: Documentation Improvements or additions to documentation Area: Memory Management Memory Management issues Area: OS Components OS Components issues Area: Tooling Board: arm Board: arm64 Board: renesas Board: risc-v Board: simulator Board: sparc Board: xtensa breaking change This change requires a mitigation entry in the release notes. Size: XL The size of the change in this PR is very large. Consider breaking down the PR into smaller pieces.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[RELEASE] 13.0.0 (gathering ideas).
10 participants