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

samples: minimal: refactor meta data #85446

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

hakehuang
Copy link
Collaborator

@hakehuang hakehuang commented Feb 8, 2025

remove platform_allow, extend integration_platform, and try to use feature tag to extend support for platforms

@hakehuang
Copy link
Collaborator Author

hakehuang commented Feb 8, 2025

with this change there is a minor issue for qemu_x86_64_atom.

image

FAILED: zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj
ccache /home/ubuntu/zephyr-sdk/zephyr-sdk-0.17.0-rc1/x86_64-zephyr-elf/bin/x86_64-zephyr-elf-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__ZEPHYR__=1 -I/home/shared/disk/zephyr_project/zephyr_test/zephyr/kernel/include -I/home/shared/disk/zephyr_project/zephyr_test/zephyr/arch/x86/include -I/home/shared/disk/zephyr_project/zephyr_test/zephyr/twister-out/qemu_x86_64_atom/zephyr/samples/basic/minimal/sample.minimal.mt/zephyr/include/generated/zephyr -I/home/shared/disk/zephyr_project/zephyr_test/zephyr/include -I/home/shared/disk/zephyr_project/zephyr_test/zephyr/twister-out/qemu_x86_64_atom/zephyr/samples/basic/minimal/sample.minimal.mt/zephyr/include/generated -I/home/shared/disk/zephyr_project/zephyr_test/zephyr/soc/intel/atom -I/home/shared/disk/zephyr_project/zephyr_test/zephyr/soc/intel/atom/. -isystem /home/shared/disk/zephyr_project/zephyr_test/zephyr/lib/libc/common/include -m64  -fno-strict-aliasing -Werror -Os -imacros /home/shared/disk/zephyr_project/zephyr_test/zephyr/twister-out/qemu_x86_64_atom/zephyr/samples/basic/minimal/sample.minimal.mt/zephyr/include/generated/zephyr/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -m64 -Wa,--divide --sysroot=/home/ubuntu/zephyr-sdk/zephyr-sdk-0.17.0-rc1/x86_64-zephyr-elf/x86_64-zephyr-elf -imacros /home/shared/disk/zephyr_project/zephyr_test/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/shared/disk/zephyr_project/zephyr_test/zephyr/samples/basic/minimal=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/shared/disk/zephyr_project/zephyr_test/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/shared/disk/zephyr_project/zephyr_test=WEST_TOPDIR -ffunction-sections -fdata-sections -mno-red-zone -mno-sse3 -mno-ssse3 -mno-sse4.1 -mno-sse4.2 -mno-sse4a -specs=picolibc.specs -std=c99 -MD -MT zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj -MF zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj.d -o zephyr/CMakeFiles/zephyr.dir/lib/os/printk.c.obj -c /home/shared/disk/zephyr_project/zephyr_test/zephyr/lib/os/printk.c
/home/shared/disk/zephyr_project/zephyr_test/zephyr/lib/os/printk.c:33:26: error: 'lock' defined but not used [-Werror=unused-variable]
   33 | static struct k_spinlock lock;
      |                          ^~~~
cc1: all warnings being treated as errors
ninja: build stopped: subcommand failed.

@nashif
Copy link
Member

nashif commented Feb 8, 2025

with this change there is a minor issue for qemu_x86_64_atom.

try ./scripts/twister -T samples/basic/minimal/ --all and report back please.

remove platform_allow, extend integration_platform

why is this needed? what do we get out of this?

extra_args: CONF_FILE='common.conf;mt.conf;arm.conf'
sample.minimal.mt:
arch_allow:
- arm
Copy link
Member

@nashif nashif Feb 8, 2025

Choose a reason for hiding this comment

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

why arch_allow is good but not platform_allow?

Copy link
Contributor

Choose a reason for hiding this comment

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

why arch_allow is good but not platform_allow?

This is better than adding a list of all arm and x86 boards.

Copy link
Collaborator Author

@hakehuang hakehuang Feb 10, 2025

Choose a reason for hiding this comment

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

I find arc and riscv has its own minimal test config already. so my assumption is that the minimal setting config is arch depended.

  sample.minimal.arc.runtime:
    extra_args:
      - CONF_FILE='common-runtime.conf;no-timers.conf'
    arch_allow: arc
    tags:
      - kernel
    integration_platforms:
      - qemu_arc/qemu_arc_em
  sample.minimal.riscv.runtime:
    extra_args:
      - CONF_FILE='common-runtime.conf;no-timers.conf;no-mt.conf;riscv.conf'
    platform_allow: qemu_riscv32
    tags:
      - kernel
    integration_platforms:
      - qemu_riscv32

@hakehuang
Copy link
Collaborator Author

hakehuang commented Feb 10, 2025

why is this needed? what do we get out of this?

There are 3 reasons on enable this for general.

  1. evaluate the minimal settings with right HAL/Driver dependency,
    such as

Below are closed as venders do not plan to support

#85560
#85563
#85566
#85568
#85578
#85584
#85585
#85588
#85593
#85594
#85595
#85596
#85936

is founded. and there are more issues found by this setting, I will report them.
2. monitoring code size and data size the each platform default settings in minimal config.
3. just want to prompt Zephyr as a replacement to bear-metal, and provide the CI checking in downstream/upstream.

@hakehuang
Copy link
Collaborator Author

try ./scripts/twister -T samples/basic/minimal/ --all and report back please.

sure. I am testing many config confliction found, I will report.

@zephyrbot zephyrbot added the area: Base OS Base OS Library (lib/os) label Feb 10, 2025
@hakehuang hakehuang marked this pull request as draft February 10, 2025 10:59
@hakehuang hakehuang marked this pull request as ready for review February 12, 2025 03:23
@hakehuang hakehuang requested a review from nashif February 12, 2025 03:23
@hakehuang
Copy link
Collaborator Author

@nashif I add fixes for integration platforms, and some of NXP platforms. please review. Thanks

remove platform_allow, extend integration_platform

Signed-off-by: Hake Huang <[email protected]>
if CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC is not config a default value,
it will just defined, and will have below error

zephyr/include/zephyr/sys_clock.h:158:45:
  error: operator '==' has no left operand
  158 |         (CONFIG_SYS_CLOCK_HW_CYCLES_PER_SEC == 0)

Signed-off-by: Hake Huang <[email protected]>
fix a printk dependency issue

printk.c:33:26: error: 'lock' defined but not used

Signed-off-by: Hake Huang <[email protected]>
@hakehuang hakehuang force-pushed the refactor_minial_config branch from 4b94e58 to 3e274ef Compare February 18, 2025 06:38
@zephyrbot zephyrbot added platform: STM32 ST Micro STM32 platform: NXP MPU platform: ARM Arm Limited platform: NXP Drivers NXP Semiconductors, drivers platform: nRF Nordic nRFx labels Feb 18, 2025
@zephyrbot zephyrbot requested a review from JiafeiPan February 18, 2025 06:39
Copy link
Collaborator

@kartben kartben left a comment

Choose a reason for hiding this comment

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

Introducing a supported tag for indicating whether a board can run a particular sample doesn't sound like a solution that scales when there are 500 samples potentially calling for the same "supported" tags?

@hakehuang hakehuang marked this pull request as draft February 18, 2025 08:47
@hakehuang
Copy link
Collaborator Author

Introducing a supported tag for indicating whether a board can run a particular sample doesn't sound like a solution that scales when there are 500 samples potentially calling for the same "supported" tags?

This is only for minimal, as discussion in the #85359, we can not remove the platform_allow, and we do not want this to be kept adding. Then tag is the only way to move platforms in, for now only, integration_platform and NXP platforms are enabled.

@hakehuang hakehuang force-pushed the refactor_minial_config branch from 3e274ef to 2d2d2a0 Compare February 18, 2025 11:12
@nashif
Copy link
Member

nashif commented Feb 18, 2025

This is only for minimal, as discussion in the #85359, we can not remove the platform_allow, and we do not want this to be kept adding. Then tag is the only way to move platforms in, for now only, integration_platform and NXP platforms are enabled.

The discussion in #85359 is still ongoing, no conclusions or recommendations were made, lets not get ahead of ourselves with solutions like this.

@hakehuang
Copy link
Collaborator Author

The discussion in #85359 is still ongoing, no conclusions or recommendations were made, lets not get ahead of ourselves with solutions like this.

@nashif , I see, I move this PR to draft. and the issues I found with this PR are real issue, if you look at my fixes, many coding issues and dependency issue found.

add minimal as tag for platforms

Signed-off-by: Hake Huang <[email protected]>
for soc only fls_common.h need to be include, and port
need depends on usage

fixes: zephyrproject-rtos#85923

Signed-off-by: Hake Huang <[email protected]>
the define in wrong sequence

fixes: 85924

Signed-off-by: Hake Huang <[email protected]>
include port fsl_port.h when needed

fixes: zephyrproject-rtos#85923

Signed-off-by: Hake Huang <[email protected]>
add CONFIG_SHELL=n as some defconf enable it

Signed-off-by: Hake Huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Base OS Base OS Library (lib/os) area: Samples Samples platform: ARM Arm Limited platform: nRF Nordic nRFx platform: NXP Drivers NXP Semiconductors, drivers platform: NXP MPU platform: NXP S32 NXP Semiconductors, S32 platform: NXP NXP platform: STM32 ST Micro STM32
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants