nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

[BUG] nsh free is not present even if not disabled in the config.

Open cederom opened this issue 1 year ago • 2 comments

Description / Steps to reproduce the issue

  1. Check the .config to contain # CONFIG_NSH_DISABLE_FREE is not set.
  2. Build and flash the firmware.
  3. See that free command is not present.
nsh> ?
help usage:  help [-v] [<cmd>]

    ?          exec       exit       help       hexdump    xd

On which OS does this issue occur?

[OS: BSD]

What is the version of your OS?

FreeBSD 13.3-RELEASE-p7 GENERIC amd64

NuttX Version

12.7.0-RC0

Issue Architecture

[Arch: arm]

Issue Area

[Area: Applications], [Area: Configuring], [Area: Memory Management]

Verification

  • [X] I have verified before submitting the report.

cederom avatar Oct 07 '24 19:10 cederom

CONFIG_FS_PROCFS=y must be set, otherwise free doesn't work: https://github.com/apache/nuttx-apps/blob/c30583dda48a812f045961f88e0d751f06196b28/nshlib/nsh.h#L498-L501

This 'silent' disabling of commands in nsh.h can be really irritating and if someone doesn't know where to look, it can cause problems. But I don't know if there is a more user-friendly solution here, PROCFS must be supported for free.

raiden00pl avatar Oct 07 '24 19:10 raiden00pl

@raiden00pl maybe we should put "depends on FS_PROCFS" there, but this solution it bad because it hides the option from users.

A clumsy workaround is creating a menu entry depending on !FS_PROCFS just to warn the user:

+menu "[ ] Disable free (please enable FS_PROCFS first)"
+       depends on !FS_PROCFS
+endmenu

But I think many people don't like this approach (it pollutes the Kconfig). In fact Kconfig has some limitations when we think about some user friendly interface

acassis avatar Oct 08 '24 14:10 acassis