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

system/argtable3: Update to the latest version(v3.1.5.1c1bb23) #559

Merged
merged 1 commit into from
Jan 14, 2021

Conversation

xiaoxiang781216
Copy link
Contributor

Summary

And remove the patch process since it doesn't need anymore.

Impact

update to the latest version

Testing

@masayuki2009
Copy link
Contributor

@xiaoxiang781216

I tried this PR but the following error happened.

./argtable3/src/getopt_long.c:149:10: fatal error: err.h: No such file or directory
149 | #include <err.h>
| ^~~~~~~
compilation terminated.

Even though I added a dummy err.h to nuttx/include/, the following error happened.

./iperf_main.c:30:10: fatal error: argtable3.h: No such file or directory
30 | #include "argtable3.h"
| ^~~~~~~~~~~~~

Does this PR work with your environment?

@xiaoxiang781216
Copy link
Contributor Author

I built with sim:nsh, err.h may found from Ubuntu. For argtable3.h, I forgot to update the search path:

CFLAGS   += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)/system/argtable3/argtable3/src"}
CXXFLAGS += ${shell $(INCDIR) $(INCDIROPT) "$(CC)" "$(APPDIR)/system/argtable3/argtable3/src"}

Please try again.

@xiaoxiang781216
Copy link
Contributor Author

xiaoxiang781216 commented Jan 14, 2021

@masayuki2009 BTW, since I add this in Makefile:

CFLAGS += ${shell $(DEFINE) "$(CC)" ARG_REPLACE_GETOPT=0}

err.h shouldn't be included in arg_getopt_long.c:

#if ARG_REPLACE_GETOPT == 1
...
#ifdef _WIN32
...
#else
#include <err.h>
#endif /*_WIN32*/
...
#endif /* ARG_REPLACE_GETOPT == 1 */

Could you check why the err.h get included?

@cwespressif
Copy link
Contributor

Hi @xiaoxiang781216 , I tried this PR but Still compile errors:

incubator-nuttx-apps/system/argtable3/argtable3/src/getopt.h:92:20: error: #include nested too deeply
#include <getopt.h>
^
./argtable3/src/getopt_long.c:149:10: fatal error: err.h: No such file or directory
#include <err.h>
^~~~~~~
compilation terminated.
ERROR: xtensa-esp32-elf-gcc failed: 1

@cwespressif
Copy link
Contributor

Hi @xiaoxiang781216 , I tried this PR but Still compile errors:

incubator-nuttx-apps/system/argtable3/argtable3/src/getopt.h:92:20: error: #include nested too deeply
#include <getopt.h>
^
./argtable3/src/getopt_long.c:149:10: fatal error: err.h: No such file or directory
#include <err.h>
^~~~~~~
compilation terminated.
ERROR: xtensa-esp32-elf-gcc failed: 1

It looks like getopt_long.c uses function 'warnx', if remove "#include <err. h>", it will report warnings

argtable3/src/getopt_long.c:243:17: warning: implicit declaration of function ‘warnx’ [-Wimplicit-function-declaration]

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
@xiaoxiang781216
Copy link
Contributor Author

@cwespressif I found the reason why my local machine can pass the build, but the mainline can't. My local machine use the latest mainline of argtable3, which has more patches than 3.1.5.1c1bb23. One particular patch is important on NuttX:

commit 01ba528135afc14c9c407b541ab320d01bc17c9b
Author: Tom G. Huang <tomghuang@gmail.com>
Date:   Sat Dec 12 23:33:43 2020 -0800

    feat: Switch to FreeBSD getopt library
    
    Switching to FreeBSD getopt library can resolve two issues:
      1. FreeBSD getopt always uses the 2-Clause BSD, which is compatible
         to GPL. (Although NetBSD has switched to the 2-Clause BSD in
         2008.)
      2. FreeBSD getopt_long provides getopt_long_only, which is critical
         for developers who want to follow the command-line syntax
         convention, which uses a single '-' character for long options.
    
    resolves: #54 #56

I have updated PR to apply this patch, it should work now, please try again, thanks.

@xiaoxiang781216
Copy link
Contributor Author

xiaoxiang781216 commented Jan 14, 2021

BTW, I am aksing the maintainer when to release the new package:
argtable/argtable3#60

@masayuki2009
Copy link
Contributor

I confirmed that this PR works with esp32-devkitc:wapi

@masayuki2009 masayuki2009 merged commit 35f3b60 into apache:master Jan 14, 2021
@xiaoxiang781216 xiaoxiang781216 deleted the argtable branch January 14, 2021 06:40
@tomghuang
Copy link

tomghuang commented Jan 16, 2021

I've published Argtable3 v3.2.0. Please help to check if this release can be successfully integrated into this project. Thanks.

@xiaoxiang781216
Copy link
Contributor Author

Thanks @tomghuang I just created a PR for the new release here: #565. Let's whether it can pass the build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants