diff --git a/cmake/os.cmake b/cmake/os.cmake index 851565c07..7608d7d12 100644 --- a/cmake/os.cmake +++ b/cmake/os.cmake @@ -177,6 +177,7 @@ function(os_add_executable TARGET NAME) ${INCLUDEOS_PACKAGE}/lib/libos.a ${INCLUDEOS_PACKAGE}/libcxx/lib/libc++.a ${INCLUDEOS_PACKAGE}/libc/lib/libc.a + ${INCLUDEOS_PACKAGE}/http-parser/lib/libhttp_parser.a ${INCLUDEOS_PACKAGE}/lib/libmusl_syscalls.a ${INCLUDEOS_PACKAGE}/libunwind/lib/libunwind.a ${INCLUDEOS_PACKAGE}/libgcc/lib/linux/${LIBGCC} diff --git a/deps/http-parser/default.nix b/deps/http-parser/default.nix deleted file mode 100644 index 45e3e7aa7..000000000 --- a/deps/http-parser/default.nix +++ /dev/null @@ -1,23 +0,0 @@ -{ - stdenv -}: -let - # Add needed $out/include/http-parser directory to match IncludeOS' use of - # "#include ". - # TODO: Upstream doesn't use that subdir though, so better fix IncludeOS - # sources. - # - # Uses a more recent version of nixpkgs to get support for static builds - nixpkgsHttpfix = builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/33f464b661f939689aa56af6b6e27b504c5afb93.tar.gz"; - sha256 = "15bdlccjg14qa7lwkcc7pikvi386ig108ca62hbxfas5wyw1fr62"; - }; - pkgsHttpfix = import nixpkgsHttpfix { crossSystem = { config = stdenv.targetPlatform.config; }; }; -in - pkgsHttpfix.pkgsStatic.http-parser.overrideAttrs (oldAttrs: { - inherit stdenv; - postInstall = (oldAttrs.postInstall or "") + '' - mkdir "$out/include/http-parser" - ln -sr "$out/include/http_parser.h" "$out/include/http-parser" - ''; - }) diff --git a/overlay.nix b/overlay.nix index 94b2d34ba..907f6bbd6 100644 --- a/overlay.nix +++ b/overlay.nix @@ -89,7 +89,6 @@ final: prev: { # Deps botan2 = self.callPackage ./deps/botan/default.nix { }; libfmt = self.callPackage ./deps/libfmt/default.nix { }; - http-parser = self.callPackage ./deps/http-parser/default.nix { }; s2n-tls = self.callPackage ./deps/s2n/default.nix { }; uzlib = self.callPackage ./deps/uzlib/default.nix { }; @@ -161,7 +160,7 @@ final: prev: { buildInputs = [ self.libfmt self.botan2 - self.http-parser + prev.pkgsStatic.http-parser prev.pkgsStatic.openssl prev.pkgsStatic.rapidjson #self.s2n-tls 👈 This is postponed until we can fix the s2n build. @@ -179,6 +178,7 @@ final: prev: { cp -r -v ${final.stdenvIncludeOS.libraries.libcxx.include} $out/libcxx/include cp -r -v ${final.stdenvIncludeOS.libraries.libunwind} $out/libunwind cp -r -v ${final.stdenvIncludeOS.libraries.libgcc} $out/libgcc + cp -r -v ${final.pkgsStatic.http-parser} $out/http-parser ''; archFlags = if self.stdenv.targetPlatform.system == "i686-linux" then @@ -206,7 +206,6 @@ final: prev: { passthru = { inherit (self) uzlib; - inherit (self) http-parser; inherit (self) botan2; inherit (self) libfmt; #inherit (self) s2n-tls; diff --git a/test/integration/net/http/service.cpp b/test/integration/net/http/service.cpp index 009b08b40..99b43f445 100644 --- a/test/integration/net/http/service.cpp +++ b/test/integration/net/http/service.cpp @@ -88,7 +88,7 @@ void Service::ready() printf("Error: %s \n", err.to_string().c_str()); CHECKSERT(!err, "No error"); - printf("Received body: %s\n", res->body()); + printf("Received body: %.*s\n", static_cast(res->body().length()), res->body().data()); CHECKSERT(res->body() == "/testing", "Received body: \"/testing\""); printf("SUCCESS\n"); diff --git a/test/test.sh b/test/test.sh index 9fd8c7942..1d9eabab6 100755 --- a/test/test.sh +++ b/test/test.sh @@ -238,7 +238,6 @@ exclusions=( "dhcpd" # Times out, requires certain routes to be set up. Seems easy. "dhcpd_dhclient_linux" # We can't run userspace tests with this setup yet. "gateway" # Requires NaCl which is currently not integrated - "http" # Linking fails, undefined ref to http_parser_parse_url, http_parser_execute "microLB" # Missing dependencies: microLB, diskbuilder, os_add_os_library "nat" # Times out after 3 / 6 tests seem to pass. Might be a legit bug here. "router" # Times out, requies sudo and has complex network setup. @@ -258,6 +257,7 @@ unsandbox_list=( "${INTEGRATION_TESTS}/net/tcp" "${INTEGRATION_TESTS}/net/udp" "${INTEGRATION_TESTS}/net/dns" # except this one which times out instead + "${INTEGRATION_TESTS}/net/http" ) run_testsuite "${INTEGRATION_TESTS}/net" "${exclusions[@]}" unsandbox_list=()