Opened 6 years ago

Closed 3 years ago

#57248 closed defect (fixed)

cargo opportunistically uses http-parser

Reported by: ryandesign (Ryan Carsten Schmidt) Owned by: herbygillot (Herby Gillot)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: cargo

Description

cargo seems to opportunistically use libhttp_parser (from the http-parser port), because building cargo +universal failed on my system when it found only a non-universal libhttp_parser:

  = note: ld: warning: ignoring file /opt/local/lib/libhttp_parser.dylib, file was built for x86_64 which is not the architecture being linked (i386): /opt/local/lib/libhttp_parser.dylib
          Undefined symbols for architecture i386:
            "_http_parser_parse_url", referenced from:
                _gitno_extract_url_parts in liblibgit2_sys-e21f3c3615cda28a.rlib(netops.c.o)
            "_http_errno_description", referenced from:
                _http_stream_read in liblibgit2_sys-e21f3c3615cda28a.rlib(http.c.o)
            "_http_parser_execute", referenced from:
                _http_stream_read in liblibgit2_sys-e21f3c3615cda28a.rlib(http.c.o)
            "_http_should_keep_alive", referenced from:
                _http_connect in liblibgit2_sys-e21f3c3615cda28a.rlib(http.c.o)
            "_http_parser_init", referenced from:
                _http_close in liblibgit2_sys-e21f3c3615cda28a.rlib(http.c.o)
                _http_stream_read in liblibgit2_sys-e21f3c3615cda28a.rlib(http.c.o)
                _http_stream_write_single in liblibgit2_sys-e21f3c3615cda28a.rlib(http.c.o)
                _http_stream_write_chunked in liblibgit2_sys-e21f3c3615cda28a.rlib(http.c.o)
          ld: symbol(s) not found for architecture i386
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

Either add a dependency on http-parser or prevent cargo from using it.

Change History (3)

comment:1 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Owner: set to herbygillot
Status: newassigned

Haven't checked if this is still an issue now.

comment:2 Changed 3 years ago by herbygillot (Herby Gillot)

Unable to reproduce:

$ port echo installed | grep http-parser
http-parser                    @2.9.4_0
$ sudo port -d destroot cargo
...
$ otool -L ./work/destroot/opt/macports-test/bin/cargo | grep http
$
Last edited 3 years ago by herbygillot (Herby Gillot) (previous) (diff)

comment:3 Changed 3 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

Thanks for checking. I also can't reproduce it now. Building cargo, I see no occurrences of the case-insensitive regex http.parser in the log.

Checking the extracted source, I do see references to http-parser in .home/.cargo/macports/libgit2-sys-0.12.26+1.3.0/libgit2 and .home/.cargo/macports/libnghttp2-sys-0.1.7+1.45.0/nghttp2. libgit2-sys could have been the culprit. I'm not clear on the relationship between libgit2-sys and git2. libgit2-sys seems to be a subproject of git2 but both of them are listed in the cargo Portfile. When I filed this ticket in October 2018, the cargo port was at version 0.24.0 and was using git2 0.7.5 and libgit2-sys 0.7.10. At that time libgit2-sys had a bundled copy of http-parser but only used it when cross-compiling. In September 2018 libgit2-sys switched to always using the bundled http-parser. The cargo port didn't update to the fixed 0.8.0 version of git2 until the cargo port was updated to 0.36.0 in June 2019. Or, since libgit2-sys was still at 0.7.11 at that point, maybe it didn't get fixed until cargo was updated to 0.40.0 and libgit2-sys 0.9.2 in November 2019.

So let's call it fixed by some update.

Note: See TracTickets for help on using tickets.