You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "anchao (via GitHub)" <gi...@apache.org> on 2023/02/07 06:00:23 UTC
[GitHub] [nuttx] anchao opened a new pull request, #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
anchao opened a new pull request, #8449:
URL: https://github.com/apache/nuttx/pull/8449
## Summary
build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
First decoupling changes from https://github.com/apache/nuttx/pull/6718
Signed-off-by: chao an <an...@xiaomi.com>
## Impact
N/A
## Testing
cmake (https://github.com/apache/nuttx/pull/6718)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 merged pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 merged PR #8449:
URL: https://github.com/apache/nuttx/pull/8449
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1098274504
##########
tools/Win.mk:
##########
@@ -571,33 +571,38 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: https://bitbucket.org/nuttx/tools/downloads/. See
# misc\tools\README.txt for additional information.
+KCONFIG_ENV = set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set EXTERNALDIR=$(EXTERNALDIR)& \
+ set APPSBINDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
Review Comment:
add sapce before all &
##########
tools/Win.mk:
##########
@@ -571,33 +571,38 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: https://bitbucket.org/nuttx/tools/downloads/. See
# misc\tools\README.txt for additional information.
+KCONFIG_ENV = set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set EXTERNALDIR=$(EXTERNALDIR)& \
+ set APPSBINDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set BINDIR=$(patsubst "%",%,${TOPDIR})&
+
config:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
- $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& set EXTERNALDIR=$(EXTERNALDIR)& kconfig-conf Kconfig
+ $(Q) $() kconfig-conf Kconfig
Review Comment:
```suggestion
$(Q) $(KCONFIG_ENV) kconfig-conf Kconfig
```
##########
tools/Win.mk:
##########
@@ -571,33 +571,38 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: https://bitbucket.org/nuttx/tools/downloads/. See
# misc\tools\README.txt for additional information.
+KCONFIG_ENV = set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set EXTERNALDIR=$(EXTERNALDIR)& \
+ set APPSBINDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set BINDIR=$(patsubst "%",%,${TOPDIR})&
Review Comment:
```suggestion
set BINDIR=$(patsubst "%",%,${TOPDIR})
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1098347166
##########
tools/Win.mk:
##########
@@ -571,33 +571,38 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: https://bitbucket.org/nuttx/tools/downloads/. See
# misc\tools\README.txt for additional information.
+KCONFIG_ENV = set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set EXTERNALDIR=$(EXTERNALDIR)& \
+ set APPSBINDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set BINDIR=$(patsubst "%",%,${TOPDIR})&
+
config:
$(Q) $(MAKE) clean_context
$(Q) $(MAKE) apps_preconfig
- $(Q) set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& set EXTERNALDIR=$(EXTERNALDIR)& kconfig-conf Kconfig
+ $(Q) $() kconfig-conf Kconfig
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1098677197
##########
Kconfig:
##########
@@ -2124,7 +2132,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
-source "$APPSDIR/Kconfig"
+source "$APPSBINDIR/Kconfig"
Review Comment:
NuttX's kconfig system is different from other RTOS. Some Kconfigs are dynamically generated through different configurations of the system. For example:
https://github.com/apache/nuttx/blob/1cb11968b7b207806cbfef9012943efae9819258/Kconfig#L2127
https://github.com/apache/nuttx/blob/1cb11968b7b207806cbfef9012943efae9819258/arch/Kconfig#L232
In the latest cmake environment, we will support out-of-tree build, which means that the "out" directory can be specified through compilation parameters, and multiple configurations can be built with same code base:
```bash
cmake -B nsh -DBOARD_CONFIG=sim/nsh -GNinja
cmake -B nsh2 -DBOARD_CONFIG=sim/nsh2 -GNinja
```
cmake can help us solve the source code out-of-tree support, but the kconfig system does not work, so we optimize the dynamically created Kconfig to a version with configurable paths, so that when compiling different configurations, only the "out" directory generate a temporary Kconfig,
To achieve the purpose of decoupling temporary files and nuttx directories:
```bash
nuttx/out/nsh/apps$ ls
audioutils crypto graphics _home_archer_code_nuttx_n8_apps_fsutils_Kconfig _home_archer_code_nuttx_n8_apps_math_Kconfig include mlearning testing
boot dummy.c _home_archer_code_nuttx_n8_apps_audioutils_Kconfig _home_archer_code_nuttx_n8_apps_games_Kconfig _home_archer_code_nuttx_n8_apps_mlearning_Kconfig industry modbus wireless
builtin examples _home_archer_code_nuttx_n8_apps_boot_Kconfig _home_archer_code_nuttx_n8_apps_gpsutils_Kconfig _home_archer_code_nuttx_n8_apps_netutils_Kconfig interpreters netutils
canutils fsutils _home_archer_code_nuttx_n8_apps_canutils_Kconfig _home_archer_code_nuttx_n8_apps_graphics_Kconfig _home_archer_code_nuttx_n8_apps_system_Kconfig Kconfig nshlib
CMakeFiles games _home_archer_code_nuttx_n8_apps_crypto_Kconfig _home_archer_code_nuttx_n8_apps_industry_Kconfig _home_archer_code_nuttx_n8_apps_testing_Kconfig libapps.a platform
cmake_install.cmake gpsutils _home_archer_code_nuttx_n8_apps_examples_Kconfig _home_archer_code_nuttx_n8_apps_interpreters_Kconfig _home_archer_code_nuttx_n8_apps_wireless_Kconfig math system
```
Of course, if you are not familiar with kconfig, you can try PR https://github.com/apache/nuttx/pull/6718 to experience it.
In addition, this change will not break ./tools/configure.sh, you can see that ci can pass normally, so if you don't use cmake, you don't need to care about this PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1098349093
##########
tools/Win.mk:
##########
@@ -571,33 +571,38 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: https://bitbucket.org/nuttx/tools/downloads/. See
# misc\tools\README.txt for additional information.
+KCONFIG_ENV = set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set EXTERNALDIR=$(EXTERNALDIR)& \
+ set APPSBINDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set BINDIR=$(patsubst "%",%,${TOPDIR})&
Review Comment:
Last symbol is also required
##########
tools/Win.mk:
##########
@@ -571,33 +571,38 @@ pass2dep: context tools\mkdeps$(HOSTEXEEXT)
# location: https://bitbucket.org/nuttx/tools/downloads/. See
# misc\tools\README.txt for additional information.
+KCONFIG_ENV = set APPSDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
+ set EXTERNALDIR=$(EXTERNALDIR)& \
+ set APPSBINDIR=$(patsubst "%",%,${CONFIG_APPS_DIR})& \
Review Comment:
Done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] davids5 commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1098550101
##########
Kconfig:
##########
@@ -2124,7 +2132,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
-source "$APPSDIR/Kconfig"
+source "$APPSBINDIR/Kconfig"
Review Comment:
Is this correct?
Please add a comments to the declarations of APPSDIR, APPSBINDIR and BINDIR to give the context.
Please state what they are and what they are used for including lifecycle (source, created by, precious or deleted etc)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1100371882
##########
Kconfig:
##########
@@ -2124,7 +2132,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
-source "$APPSDIR/Kconfig"
+source "$APPSBINDIR/Kconfig"
Review Comment:
@davids5 do you have more concern?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1098951035
##########
Kconfig:
##########
@@ -2124,7 +2132,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
-source "$APPSDIR/Kconfig"
+source "$APPSBINDIR/Kconfig"
Review Comment:
@davids5 since apps/Kconfig is generated dynamically. Changing $APPSDIR to $APPSBINDIR could move the generated Kconfig to the different directory, so it's the required step to support the out of tree build. BTW, since APPSBINDIR is same as APPSDIR by default. The behaviour keeps the same as before, but APPSBINDIR will set to a different path in cmake build system for out of tree build.
So you can see that all generated Kconfig change to BINDIR or APPSBINDIR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] davids5 commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "davids5 (via GitHub)" <gi...@apache.org>.
davids5 commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1100490226
##########
Kconfig:
##########
@@ -2124,7 +2132,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
-source "$APPSDIR/Kconfig"
+source "$APPSBINDIR/Kconfig"
Review Comment:
@xiaoxiang781216 Yes. I asked for comments in the Kconfig file, they were not added
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1098951035
##########
Kconfig:
##########
@@ -2124,7 +2132,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
-source "$APPSDIR/Kconfig"
+source "$APPSBINDIR/Kconfig"
Review Comment:
@davids5 since apps/Kconfig is generated dynamically. Changing $APPSDIR to $APPSBINDIR could move the generated Kconfig to the different directory, so it's the required step to support the out of tree build. BTW, since APPSBINDIR is same as APPSDIR by default. The behaviour keeps the same as before, but APPSBINDIR will set to a different path in cmake build system for out of tree build.
So, you can see that all generated Kconfig change to BINDIR for nuttx repo or APPSBINDIR for apps repo, but all manual written Kconfig doesn't change.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1098951035
##########
Kconfig:
##########
@@ -2124,7 +2132,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
-source "$APPSDIR/Kconfig"
+source "$APPSBINDIR/Kconfig"
Review Comment:
@davids5 since apps/Kconfig is generated dynamically. Changing $APPSDIR to $APPSBINDIR could move the generated Kconfig to the different directory, so it's the required step to support the out of tree build. BTW, since APPSBINDIR is same as APPSDIR by default. The behaviour keeps the same as before, but APPSBINDIR will set to a different path in cmake build system for out of tree buid.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] anchao commented on a diff in pull request #8449: build/Kconfig: add BINDIR/APPSBINDIR to support out of tree build
Posted by "anchao (via GitHub)" <gi...@apache.org>.
anchao commented on code in PR #8449:
URL: https://github.com/apache/nuttx/pull/8449#discussion_r1101165021
##########
Kconfig:
##########
@@ -2124,7 +2132,7 @@ source "openamp/Kconfig"
endmenu
menu "Application Configuration"
-source "$APPSDIR/Kconfig"
+source "$APPSBINDIR/Kconfig"
Review Comment:
Done, added some comments on help manual:
```bash
config APPSBINDIR
string
option env="APPSBINDIR"
---help---
Output path of Kconfig which dynamically generated by NuttX Apps
This option is consistent with the APPSDIR by default, and will
be changed when out-of-tree compilation is supported
config BINDIR
string
option env="BINDIR"
---help---
Output path of Kconfig which dynamically generated by NuttX Kernel
This option is consistent with the TOPDIR by default, and will
be changed when out-of-tree compilation is supported
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org