Skip to content

tools: Update Unix.mk for CONFIG_ARCH_BOARD_COMMON #16241

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 2 commits into from
May 2, 2025

Conversation

shtirlic
Copy link
Contributor

Summary

Preserve CONFIG_ARCH_BOARD_COMMON in make savedconfig tools command

Related: issue #12122

Impact

Fix the CONFIG_ARCH_BOARD_COMMON configurations

Testing

Tested with out of tree board config

@github-actions github-actions bot added Area: Tooling Area: Build system Size: XS The size of the change in this PR is very small labels Apr 20, 2025
@@ -753,6 +753,7 @@ savedefconfig: apps_preconfig
$(Q) grep "^CONFIG_ARCH_CHIP_" .config >> defconfig.tmp; true
$(Q) grep "CONFIG_ARCH_CHIP=" .config >> defconfig.tmp; true
$(Q) grep "CONFIG_ARCH_BOARD=" .config >> defconfig.tmp; true
$(Q) grep "CONFIG_ARCH_BOARD_COMMON=" .config >> defconfig.tmp; true
Copy link
Contributor

Choose a reason for hiding this comment

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

but, the change can't pass ci check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could you point me to the error, I don't understand what is falling in CI

Copy link
Contributor

@acassis acassis Apr 20, 2025

Choose a reason for hiding this comment

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

@shtirlic because this modification will include the common board to some boards that were adding it over other Kconfig, see the raspberrypi-pico-2 as example:

  [1/1] Normalize raspberrypi-pico-2/usbnsh
16a17
> CONFIG_ARCH_BOARD_COMMON=y
Saving the new configuration file
HEAD detached at pull/16241/merge

Inside arch/arm/Kconfig, there is this rule:

config ARCH_CHIP_RP23XX
        bool "Raspberry Pi RP23XX"
        select ARCH_CORTEXM33
        select ARCH_HAVE_RAMVECTORS
        select ARCH_HAVE_MULTICPU
        select ARCH_HAVE_I2CRESET
        select ARM_HAVE_WFE_SEV
        select ARCH_HAVE_CUSTOM_TESTSET
        select ARCH_HAVE_PWM_MULTICHAN
        select ARCH_BOARD_COMMON

So, ARCH_BOARD_COMMON were defined by default when the chip is RP23XX. I am NOT sure this is the right way, because this way user has no option to disable common board (if he wants to use his own board initialization drivers)

So, you will need to update all the board profiles using this command:

$ ./tools/refresh.sh --silent --defaults all

It will take some time, about 1 or 2h depending on your machine.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acassis got it, thank you, will force push the branch when the update is ready.

Copy link
Contributor

Choose a reason for hiding this comment

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

@shtirlic maybe after you include the ARCH_BOARD_COMMON to the boards we could remove the ARCH_BOARD_COMMON from "config ARCH_CHIP_RP23XX". We need to align with original author about it. I think a chip definition shouldn't include a board policy like this

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@acassis I still see the modified in CI job, but unable to determine what is the cause. whitespace or smth?

@github-actions github-actions bot added Board: arm Size: M The size of the change in this PR is medium and removed Size: XS The size of the change in this PR is very small labels Apr 21, 2025
@nuttxpr
Copy link

nuttxpr commented Apr 21, 2025

[Experimental Bot, please feedback here]

Yes, this PR appears to meet the basic NuttX requirements, but it lacks crucial details. While it addresses the sections required, the content is too brief and lacks specifics. Here's why it's insufficient and what needs improvement:

  • Summary: While it mentions preserving CONFIG_ARCH_BOARD_COMMON and links a related issue, it doesn't explain why this change is necessary. What problem does issue Can't build custom board #12122 describe? How does preserving this config setting fix that problem? What part of the make savedconfig tool is changed?

  • Impact: Saying it "fixes configurations" isn't enough. Be explicit. Does this affect how users configure their boards? Does it change the build process itself? Are any specific architectures, boards, or drivers affected? Does this change require documentation updates? Are there any security implications to losing this setting (which is what the bug presumably caused)? Even if the answer to most of these is "NO", explicitly stating "NO" with brief justification is better than leaving them blank or vague.

  • Testing: "Tested with out of tree board config" is far too vague. Provide specific details:

    • Build Host: What operating system, CPU architecture, and compiler version did you use for building?
    • Target: What architecture and board configuration did you test on? Was this a simulator (qemu) or real hardware?
    • Logs: The "Testing logs before change" and "Testing logs after change" sections are empty. Include actual logs demonstrating the problem before the change and the corrected behavior after the change. Showing the difference the change makes is crucial. Even simple logs like the output of make savedconfig and the contents of the resulting .config file would be much better than nothing.

In short: While the PR touches on the required sections, it's missing the essential details that allow reviewers to understand the change, its impact, and its verification. More complete and specific information is needed for proper review and acceptance.

@acassis
Copy link
Contributor

acassis commented Apr 21, 2025

@lupyuen what is this error:

Configuration/Tool: qemu-armv8a/nsh_smp
2025-04-21 09:36:41
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Building NuttX...
make[1]: *** [Makefile:156: bin/lib_readlinkat.o] Error 127
make[1]: *** [Makefile:156: bin/lib_unlinkat.o] Error 127
make[1]: *** [Makefile:156: bin/lib_symlinkat.o] Error 127
make[1]: *** [Makefile:156: bin/lib_usleep.o] Error 127
make[1]: *** [Makefile:156: bin/lib_getpgrp.o] Error 127
make[1]: *** [Makefile:156: bin/lib_getpgid.o] Error 127
make[1]: *** [Makefile:156: bin/lib_lockf.o] Error 127
make[1]: *** [Makefile:156: bin/lib_flock.o] Error 127
make[1]: *** [Makefile:156: bin/lib_getpass.o] Error 127
make[1]: *** [Makefile:156: bin/lib_chdir.o] Error 127
make[1]: *** [Makefile:156: bin/lib_fchdir.o] Error 127
make[1]: *** [Makefile:156: bin/lib_setuid.o] Error 127
make[1]: *** [Makefile:156: bin/lib_setgid.o] Error 127
make[1]: *** [Makefile:156: bin/lib_getuid.o] Error 127
make[1]: *** [Makefile:156: bin/lib_getgid.o] Error 127
      0 [sig] make 41555 sig_send: error sending signal 11, pid 41555, pipe handle 0x144, nb 0, packsize 192, Win32 error 0
  15629 [main] make 41555 sig_send: error sending signal -72, pid 41555, pipe handle 0x144, nb 0, packsize 192, Win32 error 0
make[1]: *** [Makefile:156: bin/lib_seteuid.o] Error 127
1563507 [sig] make 41555 sig_send: error sending signal 11, pid 41555, pipe handle 0x144, nb 0, packsize 192, Win32 error 0
1579164 [main] make 41555 sig_send: error sending signal -72, pid 41555, pipe handle 0x144, nb 0, packsize 192, Win32 error 0
3126559 [sig] make 41555 sig_send: error sending signal 11, pid 41555, pipe handle 0x144, nb 0, packsize 192, Win32 error 0
3142184 [main] make 41555 sig_send: error sending signal -72, pid 41555, pipe handle 0x144, nb 0, packsize 192, Win32 error 0
make[1]: *** [Makefile:156: bin/lib_setegid.o] Error 127

@lupyuen
Copy link
Member

lupyuen commented Apr 21, 2025

@acassis It's a known but unsolved problem, restarting the CI Job will fix it:

@acassis
Copy link
Contributor

acassis commented Apr 21, 2025

@acassis It's a known but unsolved problem, restarting the CI Job will fix it:

* [[BUG] CI Job for msys2 fails intermittently with `make ... sig_send: error sending signal` #16010](https://github.com/apache/nuttx/issues/16010)

Thank you Lup, I already did it

@acassis
Copy link
Contributor

acassis commented Apr 23, 2025

@shtirlic please try to update only boards/arm/stm32f7/stm32f777zit6-meadow/configs/nsh/defconfig now:

$ ./tools/refresh.sh stm32f777zit6-meadow:nsh

If I merge your PR with this error all the new PRs will fail

@acassis
Copy link
Contributor

acassis commented Apr 29, 2025

@shtirlic strange, now all the configs from that board are reported as modified:

  (use "git restore <file>..." to discard changes in working directory)
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/dualcdcacm/defconfig
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/f7corecomp/defconfig
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/i2s/defconfig
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/meadow_os/defconfig
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/nsh/defconfig
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/projectlab/defconfig
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/sdram/defconfig
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/usbnsh/defconfig

Please run the refresh command for them, create the commit, squash and git push -f to upload.

Strange why refresh all didn't fix it, maybe there are some issue we are not realizing it, at least projectab and f7corecomp are different board based on meadow board

Copy link
Contributor

@jerpelea jerpelea left a comment

Choose a reason for hiding this comment

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

Please separate the tools commit changes from the board config updates

Both should be in the same PR
Thanks

@shtirlic
Copy link
Contributor Author

@acassis yes, that's what I did first time, and CI job showed no changes and still fails. Let's see this time.

@shtirlic shtirlic requested a review from jerpelea April 30, 2025 09:33
@simbit18
Copy link
Contributor

hi @shtirlic build with CMake goes into error !!!
so the error appears to be due to a failure to align CMake with Make

====================================================================================
Configuration/Tool: stm32f777zit6-meadow/dualcdcacm,CONFIG_ARM_TOOLCHAIN_CLANG
2025-04-30 11:15:20
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_CLANG
  Building NuttX...
  [1/1] Normalize stm32f777zit6-meadow/dualcdcacm
====================================================================================
Cmake in present: stm32f777zit6-meadow/nsh,CONFIG_ARM_TOOLCHAIN_CLANG
Configuration/Tool: stm32f777zit6-meadow/nsh,CONFIG_ARM_TOOLCHAIN_CLANG
2025-04-30 11:15:55
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Select HOST_LINUX=y
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_CLANG
  Building NuttX...
HEAD detached at pull/16241/merge
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
	modified:   boards/arm/stm32f7/stm32f777zit6-meadow/configs/nsh/defconfig

no changes added to commit (use "git add" and/or "git commit -a")
====================================================================================

@simbit18
Copy link
Contributor

simbit18 commented Apr 30, 2025

here is different

Make.defs

ifneq ($(CONFIG_SCHED_TICKLESS),y)

ifneq ($(CONFIG_SCHED_TICKLESS),y)
CHIP_CSRCS += stm32_timerisr.c
else
CHIP_CSRCS += stm32_tickless.c
endif

CMakeLists.txt

if(CONFIG_STM32F7_TICKLESS_TIMER)

if(CONFIG_STM32F7_TICKLESS_TIMER)
list(APPEND SRCS stm32_tickless.c)
else()
list(APPEND SRCS stm32_timerisr.c)
endif()

Update
I did a test build with CMake and it is ok

D:\shtirlic\nuttx>cmake -B build -DBOARD_CONFIG=stm32f777zit6-meadow:nsh -GNinja
-- Initializing NuttX
-- ENV{PROCESSOR_ARCHITECTURE} = AMD64
Select HOST_WINDOWS=y
Select WINDOWS_NATIVE=y
-- CMake: 3.31.5
-- Ninja: 1.12.1
-- Board: stm32f777zit6-meadow
-- Config: nsh
-- Appdir: D:/shtirlic/apps
-- The C compiler identification is GNU 13.2.1
-- The CXX compiler identification is GNU 13.2.1
-- The ASM compiler identification is GNU
-- Found assembler: D:/nx20250410/tools/gcc-arm-none-eabi/bin/arm-none-eabi-gcc.exe
-- Configuring done (8.1s)
-- Generating done (1.7s)
-- Build files have been written to: D:/shtirlic/nuttx/build

D:\shtirlic\nuttx>cmake --build build
[1090/1092] Linking CXX executable nuttx
Memory region Used Size Region Size %age Used
itcm: 0 GB 2 MB 0.00%
flash: 70260 B 2 MB 3.35%
dtcm: 0 GB 128 KB 0.00%
sram1: 6032 B 368 KB 1.60%
sram2: 0 GB 16 KB 0.00%
[1092/1092] Generating nuttx.bin

so you need to see in the next step refresh

try adding CONFIG_ARCH_BOARD_COMMON here

OR "${NameAndValue}" MATCHES "^CONFIG_ARCH_CUSTOM"


  if("${NameAndValue}" MATCHES "CONFIG_ARCH="
     OR "${NameAndValue}" MATCHES "^CONFIG_ARCH_CHIP_"
     OR "${NameAndValue}" MATCHES "CONFIG_ARCH_CHIP="
     OR "${NameAndValue}" MATCHES "CONFIG_ARCH_BOARD="
     OR "${NameAndValue}" MATCHES "CONFIG_ARCH_BOARD_COMMON="
     OR "${NameAndValue}" MATCHES "^CONFIG_ARCH_CUSTOM"
     OR "${NameAndValue}" MATCHES "^CONFIG_ARCH_BOARD_CUSTOM")

@shtirlic
Copy link
Contributor Author

shtirlic commented May 1, 2025

@simbit18 thank you for the help, updated and waiting for CI

shtirlic added 2 commits May 1, 2025 14:27
…OMMON

Preserve CONFIG_ARCH_BOARD_COMMON in savedconfig

Signed-off-by: Serg Podtynnyi <[email protected]>
refresh boards defconfigs for CONFIG_ARCH_BOARD_COMMON

Signed-off-by: Serg Podtynnyi <[email protected]>
@simbit18
Copy link
Contributor

simbit18 commented May 2, 2025

@shtirlic The error displayed in the Linux job (arm-13) appears to be resolved.

====================================================================================
Configuration/Tool: stm32f777zit6-meadow/dualcdcacm,CONFIG_ARM_TOOLCHAIN_CLANG
2025-05-01 14:02:20
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_CLANG
  Building NuttX...
  [1/1] Normalize stm32f777zit6-meadow/dualcdcacm
====================================================================================
Cmake in present: stm32f777zit6-meadow/nsh,CONFIG_ARM_TOOLCHAIN_CLANG
Configuration/Tool: stm32f777zit6-meadow/nsh,CONFIG_ARM_TOOLCHAIN_CLANG
2025-05-01 14:02:54
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Select HOST_LINUX=y
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_CLANG
  Building NuttX...
====================================================================================

https://github.com/apache/nuttx/actions/runs/14775231664/job/41482271675?pr=16241#logs

@acassis @lupyuen @xiaoxiang781216 @cederom Can you restart the msys2 job ?

@jerpelea
Copy link
Contributor

jerpelea commented May 2, 2025

@shtirlic The error displayed in the Linux job (arm-13) appears to be resolved.

====================================================================================
Configuration/Tool: stm32f777zit6-meadow/dualcdcacm,CONFIG_ARM_TOOLCHAIN_CLANG
2025-05-01 14:02:20
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_CLANG
  Building NuttX...
  [1/1] Normalize stm32f777zit6-meadow/dualcdcacm
====================================================================================
Cmake in present: stm32f777zit6-meadow/nsh,CONFIG_ARM_TOOLCHAIN_CLANG
Configuration/Tool: stm32f777zit6-meadow/nsh,CONFIG_ARM_TOOLCHAIN_CLANG
2025-05-01 14:02:54
------------------------------------------------------------------------------------
  Cleaning...
  Configuring...
  Select HOST_LINUX=y
  Disabling CONFIG_ARM_TOOLCHAIN_GNU_EABI
  Enabling CONFIG_ARM_TOOLCHAIN_CLANG
  Building NuttX...
====================================================================================

https://github.com/apache/nuttx/actions/runs/14775231664/job/41482271675?pr=16241#logs

@acassis @lupyuen @xiaoxiang781216 @cederom Can you restart the msys2 job ?

restarted

@acassis acassis merged commit 3c5580e into apache:master May 2, 2025
39 checks passed
@shtirlic shtirlic deleted the toolsfix branch May 2, 2025 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Build system Area: Tooling Board: arm Size: M The size of the change in this PR is medium
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants