[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT/HTTP-PARSER PATCH 1/1] Initial port of http-parser to Unikraft



Hey Felipe,

I have a few comments inline to your port but it generally looks good.

Thanks,

Simon

On 08.05.19 12:27, Felipe Huici wrote:
This is our initial port of http-parser to Unikraft as an external
library. Libc is required.

Signed-off-by: Felipe Huici <felipe.huici@xxxxxxxxx>
---
  CODING_STYLE.md |  4 ++++
  CONTRIBUTING.md |  4 ++++
  COPYING.md      | 39 +++++++++++++++++++++++++++++++++++
  Config.uk       |  4 ++++
  MAINTAINERS.md  | 10 +++++++++
  Makefile.uk     | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  README.md       |  5 +++++
  exportsyms.uk   | 14 +++++++++++++
  8 files changed, 143 insertions(+)
  create mode 100644 CODING_STYLE.md
  create mode 100644 CONTRIBUTING.md
  create mode 100644 COPYING.md
  create mode 100644 Config.uk
  create mode 100644 MAINTAINERS.md
  create mode 100644 Makefile.uk
  create mode 100644 README.md
  create mode 100644 exportsyms.uk

diff --git a/CODING_STYLE.md b/CODING_STYLE.md
new file mode 100644
index 0000000..5730041
--- /dev/null
+++ b/CODING_STYLE.md
@@ -0,0 +1,4 @@
+Coding Style
+============
+
+Please refer to the `CODING_STYLE.md` file in the main Unikraft repository.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..5f55eca
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,4 @@
+Contributing to Unikraft
+=======================
+
+Please refer to the `CONTRIBUTING.md` file in the main Unikraft repository.
diff --git a/COPYING.md b/COPYING.md
new file mode 100644
index 0000000..d7b3f41
--- /dev/null
+++ b/COPYING.md
@@ -0,0 +1,39 @@
+License
+=======
+
+Unikraft http-parser wrappers
+------------------------
+
+This repository contains wrapper code to build libuuid with Unikraft.
+Each C code file in this repository should declare who is the
+copyright owner and under which terms and conditions the code is
+licensed. If such a licence note is missing, the following copyright
+notice will apply:
+
+       Copyright (c) 2019, NEC Europe Ltd., NEC Corporation. All rights 
reserved.
+
+       Redistribution and use in source and binary forms, with or without
+       modification, are permitted provided that the following conditions
+       are met:
+
+       1. Redistributions of source code must retain the above copyright
+          notice, this list of conditions and the following disclaimer.
+       2. Redistributions in binary form must reproduce the above copyright
+          notice, this list of conditions and the following disclaimer in the
+          documentation and/or other materials provided with the distribution.
+       3. Neither the name of the copyright holder nor the names of its
+          contributors may be used to endorse or promote products derived from
+          this software without specific prior written permission.
+
+       THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 
IS"
+       AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 
THE
+       IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 
PURPOSE
+       ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS 
BE
+       LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+       SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+       INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+       CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+       ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 
THE
+       POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/Config.uk b/Config.uk
new file mode 100644
index 0000000..5b608ba
--- /dev/null
+++ b/Config.uk
@@ -0,0 +1,4 @@
+menuconfig HTTP_PARSER

Since we do not have sub configurations you can just use "config" instead of "menuconfig".

+          bool "http-parser - a parser for HTTP messages written in C"
+          default y
+           select HAVE_LIBC

Select HAVE_LIBC is breaking the build. With this option you say that your library provides a libc which is not the case - the build breaks because nolibc disappears (it has internally a check that it goes off as soon as HAVE_LIBC is there). These feature options (defined in lib/Makefile.uk) should only be used to check if required features are available.

You should state this as:

        select LIBNOLIBC if !HAVE_LIBC

or:

        depends on HAVE_LIBC

...if nolibc is incompatible with your library (but according to my tests nolibc works).

Could you also check to use TABS-only indention?

diff --git a/MAINTAINERS.md b/MAINTAINERS.md
new file mode 100644
index 0000000..5a4abc4
--- /dev/null
+++ b/MAINTAINERS.md
@@ -0,0 +1,10 @@
+Maintainers List
+================
+
+For notes on how to read this information, please refer to `MAINTAINERS.md` in
+the main Unikraft repository.
+
+       LIBUUID-UNIKRAFT
+       M:      Felipe Huici <felipe.huici@xxxxxxxxx>
+       L:      minios-devel@xxxxxxxxxxxxx
+       F: *
diff --git a/Makefile.uk b/Makefile.uk
new file mode 100644
index 0000000..2955699
--- /dev/null
+++ b/Makefile.uk
@@ -0,0 +1,63 @@
+#  http-parser Makefile.uc
+#
+#  Authors: Felipe Huici <felipe.huici@xxxxxxxxx>
+#
+#
+#  Copyright (c) 2019, NEC Europe Ltd., NEC Corporation. All rights reserved.
+#
+#  Redistribution and use in source and binary forms, with or without
+#  modification, are permitted provided that the following conditions
+#  are met:
+#
+#  1. Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+#  2. Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#  3. Neither the name of the copyright holder nor the names of its
+#     contributors may be used to endorse or promote products derived from
+#     this software without specific prior written permission.
+#
+#  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+#  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+#  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+#  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+#  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+#  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+#  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+#  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+#  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+#  POSSIBILITY OF SUCH DAMAGE.
+#
+#  THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+#
+
+################################################################################
+# Library registration
+################################################################################
+$(eval $(call addlib_s,http_parser,$(CONFIG_HTTP_PARSER)))

A minor thing: I would prefer calling the library as libhttp_parser in order to be inline with the other libraries that we have.

+
+################################################################################
+# Sources
+################################################################################
+HTTP_PARSER_VERSION=v2.8.1
+HTTP_PARSER_URL=https://github.com/nodejs/http-parser/archive/$(HTTP_PARSER_VERSION).zip
+HTTP_PARSER_DIR=http-parser-2.8.1
+$(eval $(call fetch,http_parser,$(HTTP_PARSER_URL),$(HTTP_PARSER_VERSION).zip))
+
+################################################################################
+# Helpers
+################################################################################
+HTTP_PARSER_SRC=$(HTTP_PARSER_ORIGIN)/$(HTTP_PARSER_DIR)
+
+################################################################################
+# Library includes
+################################################################################
+CINCLUDES-$(CONFIG_HTTP_PARSER) += -I$(HTTP_PARSER_BASE)/include \
+                                  -I$(HTTP_PARSER_SRC)

I could not find any /include folder in the archive. I would also prefer preparing an include folder (like in libuuid) so that only the public header files are exposed to the build.

+
+################################################################################
+# Sources
+################################################################################
+HTTP_PARSER_SRCS-y += $(HTTP_PARSER_SRC)/http_parser.c
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..0fcb53e
--- /dev/null
+++ b/README.md
@@ -0,0 +1,5 @@
+http-parser for Unikraft
+===================
+
+Please refer to the `README.md` as well as the documentation in the `doc/`
+subdirectory of the main unikraft repository.
diff --git a/exportsyms.uk b/exportsyms.uk
new file mode 100644
index 0000000..995b256
--- /dev/null
+++ b/exportsyms.uk
@@ -0,0 +1,14 @@
+http_body_is_final
+http_errno_description
+http_errno_name
+http_message_needs_eof
+http_method_str
+http_parser_execute
+http_parser_init
+http_parser_parse_url
+http_parser_pause
+http_parser_settings_init
+http_parser_url_init
+http_parser_version
+http_should_keep_alive
+http_strerror_tab


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.