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

tools/sethost.sh: Correct error in setting a different host. #897

Merged
merged 1 commit into from
Apr 27, 2020

Conversation

patacongo
Copy link
Contributor

@patacongo patacongo commented Apr 27, 2020

Summary

In an older PR, the standard kconfig-tweak calls were replaced with sed edit. This is an incorrect change and results in invalid configurations. This change restores the use of kconfig-tweak and always generates correct configurations.

This change resolves issue #386

Impact

sed edits do not handle all of the dependencies correct and generates invalid configurations. Most defconfig files specify Linux by default, so you will only see the effect of the corruped configuration when sethost changes changes to a different configuration. Then, when 'make olddefconfig' is subsequentyly run, the corruption in the defconfig file is reflected by warnings such as:

$ tools/configure.sh -c stm32f4discovery:nsh
  Copy files
  Select CONFIG_HOST_WINDOWS=y
  Select CONFIG_WINDOWS_CYGWIN=y
  Refreshing...
.config:62:warning: override: reassigning to symbol HOST_WINDOWS
.config:62:warning: override: HOST_WINDOWS changes choice state

Those and similar warnings are eliminated by this changed.

Testing

Tested by repeatedly doing:

tools/configure.sh -c stm32f4discovery:nsh

I've also tested these configurations and they all work (after one forced push):

tools/configure.sh -c imxrt1060-evk:nsh  # Linux to Windows Cygwin
rm .config Make.defs
tools/configure.sh -l imxrt1060-evk:nsh  # Linux to Linux
rm .config Make.defs
tools/configure.sh -g imxrt1060-evk:nsh  # Linux to MSYS
rm .config Make.defs
tools/configure.sh -l stm32f4discovery:nsh # Windows to Linux
rm .config Make.defs
tools/configure.sh -c stm32f4discovery:nsh # Windows to Windows Cygwin
rm .config Make.defs
tools/configure.sh -m stm32f4discovery:nsh # Windows to macOS
rm .config Make.defs
tools/configure.sh -g stm32f4discovery:nsh # Windows to Windows MSYS
rm .config Make.defs
tools/configure.sh -g sim:nsh  # Linux to Windows MSYS
rm .config Make.defs
tools/configure.sh -l sim:nsh  # Linux to Linux
rm .config Make.defs
tools/configure.sh -c sim:nsh  # Linux to Windows Cygwin
rm .config Make.defs
tools/configure.sh -m sim:nsh   # Linux to macOS
rm .config Make.defs
tools/configure.sh -l sim:module  # macOS to Linux
rm .config Make.defs
tools/configure.sh -c sim:module # macOS to Windows Cygwin

At this point, I have not come up with any way that results in a corrupted defconfig file or in any warning from 'make olddefconfig'

BTW: If you want to experiment with this, you don't need to have Windows or a macOS. configure.sh doesn't care what platform you are on. So you can configure -l, -g, -c, -m on any plaform, including Linux.

@patacongo patacongo linked an issue Apr 27, 2020 that may be closed by this pull request
@patacongo
Copy link
Contributor Author

patacongo commented Apr 27, 2020

With further testing, I am seeing other issues:

Now, with further testing, I see some problems:

$ tools/configure.sh -l stm32f4discovery:nsh
  Copy files
  Select CONFIG_HOST_LINUX=y
  Refreshing...
.config:62:warning: override: HOST_LINUX changes choice state

I need to study further. I think I may indeed have to disable features with kconfig-tweak.

I just pushed a fix... lets check again. The problem was that in windows defconfig files there were Windows environment options that were not being reset before 'make olddefconfig'. If Linux or macOS are selected, it looks like we do have to explicitly disable Windows so that the windows enivoronment choices will not be a problem. Not sure precisely why.

In an older PR, the standard kconfig-tweak calls were replaced with sed edit.  This is an incorrect change and results in invalid configurations.  This change restores the use of kconfig-tweak and always generates correct configurations.

This change resolves issue apache#386

sed edits do not handle all of the dependencies correct and generates invalid configurations.  Most defconfig files specify Linux by default, so you will only see the effect of the corruped configuration when sethost changes changes to a different configuration.  Then, when 'make olddefconfig' is subsequentyly run, the corruption in the defconfig file is reflected by warnings such as:

   $ tools/configure.sh -c stm32f4discovery:nsh
      Copy files
      Select CONFIG_HOST_WINDOWS=y
      Select CONFIG_WINDOWS_CYGWIN=y
      Refreshing...
    .config:62:warning: override: reassigning to symbol HOST_WINDOWS
    .config:62:warning: override: HOST_WINDOWS changes choice state

Those warnings are eliminated by this changed.

Tested by repeatedly doing:

  tools/configure.sh -c stm32f4discovery:nsh
@patacongo
Copy link
Contributor Author

patacongo commented Apr 27, 2020

@btashton @xiaoxiang781216 I am trying to test pr #897 but there is a problem with the macOS builds. When the kconfig-frontend package was build, it did not enable kconfig-tweak which is one of the kconfig-frontend utilities that must be built for the build to be successful.

We cannot use sed. We must use kconfig-tweak!

The problem is in Build / macOS (mips-riscv-x86-xtensa) (pull_request) :

running CONFIG_SHELL=/bin/sh /bin/sh ./configure --prefix=/Users/runner/runners/2.169.1/work/incubator-nuttx/incubator-nuttx/sources/testing/../prebuilt/kconfig-frontends --disable-kconfig --disable-nconf --disable-qconf --disable-gconf --disable-mconf --disable-static --disable-shared --disable-L10n --disable-utils --no-create --no-recursion

--disable-utils suppresses building of all kconfig-frontend utils. That is a very bad idea. For one thing, it suppresses kconfig-tweak and cause this problem. Just removing this should resolve the issues.

This addressed to incubator-nuttx-testing PR 38. The checks for this PR depend on that PR 38.

@Ouss4 Ouss4 merged commit 100bd74 into apache:master Apr 27, 2020
@patacongo
Copy link
Contributor Author

patacongo commented Apr 27, 2020

A logical flaw in the testing is that we do not have any defconfig files with MSYS as the Windows environment. There could be undiscovered issues there.

Another testing hole is the windows native build. But those builds tend to be handled as special cases: Because of the differences in the file system paths, you usually need to do some special interactions to get the configurations working correctly. tools/sethost.sh -n will probably not work in the general case.

@patacongo patacongo deleted the tweak branch April 27, 2020 21:18
@btashton btashton added this to To-Add in Release Notes - 9.1 Jun 4, 2020
@btashton btashton moved this from To-Add to Not Applicable in Release Notes - 9.1 Jun 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Release Notes - 9.1
  
Not Applicable
Development

Successfully merging this pull request may close these issues.

Windows Configure Warnings
3 participants