Bug 274658 - lang/rust fails to build after upgrading Perl to 5.36
Summary: lang/rust fails to build after upgrading Perl to 5.36
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: FreeBSD Rust Team
URL:
Keywords:
Depends on: 274717
Blocks:
  Show dependency treegraph
 
Reported: 2023-10-22 20:53 UTC by web
Modified: 2023-12-09 15:05 UTC (History)
11 users (show)

See Also:
bugzilla: maintainer-feedback? (rust)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description web 2023-10-22 20:53:17 UTC
In my attempt to upgrade to Perl 5.36 several other ports were
affected and had to be rebuilt/reinstalled.  One of these was
lang/rust -- which failed to build (I can send error strings).
  
However, I decided to try downloading the lang/rust package
and work around the build-from-source problems I was having.

I did that, and look what happened (note the version of Perl):

 =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

unix# pwd
/usr/ports
unix# pkg install lang/rust
Updating FreeBSD repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01
Fetching packagesite.pkg: 100%    7 MiB   1.4MB/s    00:05
Processing entries: 100%
FreeBSD repository update completed. 34120 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        perl5.34: 5.34.1_3
        rust: 1.72.0

Number of packages to be installed: 2

The process will require 1 GiB more space.
144 MiB to be downloaded.

Proceed with this action? [y/N]: N

 =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=

This defeats updating Perl from 5.34 to 5.36 -- what am I to do?
Comment 1 Robert 2023-10-22 21:35:59 UTC
Thanks to the original poster for starting this bug report: I've had that same issue myself running FBSD v12.4, compiling ports. The port devel/cargo-c runs into the same issue since it needs Rust in order to finish building. 
The build issue comes toward the end of the Rust compile process, with the link to `cc` failing then saying -lzlibstatic not found. The log for the Rust compile is very long so I'll hold off on that unless there's a request.
Rust compiled perfectly with Perl 5.34 in the system, but not since the change to the new default of 5.36.
I noted on "freshports" that LLVM versions 15 and 16 state they're looking for Perl 5.34, but LLVM 17 shows Perl 5.36 as the version it looks for. There may be issues with that as well eventually.
Until this all settles out, I'll hold off updating the ports.
Comment 2 fgorter 2023-10-25 03:21:59 UTC
(In reply to Robert from comment #1)

I'm seeing the same issue when building lang/rust on 13.2-STABLE, resulting in a build fail:

error: linking with `cc` failed: exit status: 1

along with:

note: ld: error: unable to find library -lzlibstatic



Curiously, on an identical 14-STABLE system, lang/rust builds just fine.

perl5-5.34 / perl5-5.36 does not seem to be the issue, as it occurs with either version perl5-5.* installed.
Comment 3 Mikael Urankar freebsd_committer freebsd_triage 2023-10-25 15:44:49 UTC
lang/rust builds just fine here with perl 5.36. Do you have a full build log somewhere?
Comment 4 skye gänseblum 2023-10-25 18:21:50 UTC
(In reply to Mikael Urankar from comment #3)

i just tried again after doing a make clean, really hope i did my output piping right, here are 170,000 lines of make output. at the beginning it says it found a libzlib and then at the end it can’t link to it. i tried if it gets any better if i install the .36 perl version but it does not

https://gaenseblum.eu/fileshare/buildlogfull.txt
Comment 5 Martin Birgmeier 2023-10-25 18:51:15 UTC
Same issue here, upgrading ports using portmaster.

It seems deinstalling assimp does the trick. It installs a /usr/local/lib/libzlibstatic.a.

-- Martin
Comment 6 Piotr Kubaj freebsd_committer freebsd_triage 2023-10-25 19:04:40 UTC
Can you retry after rebuilding assimp with BUILD_SHARED_LIBS appended to CMAKE_OFF and removing lib/libzlibstatic.a from pkg-plist?

Ports generally shouldn't add static libraries.
Comment 7 Martin Birgmeier 2023-10-25 19:15:19 UTC
I used BUILD_STATIC_LIBS instead :-)

Yes this gets rid of /usr/local/lib/libzlibstatic.a

-- Martin
Comment 8 skye gänseblum 2023-10-25 19:38:05 UTC
(In reply to Piotr Kubaj from comment #6)
Do you mean like so? In the assimp Makefile?

CMAKE_OFF=              ASSIMP_BUILD_TESTS BUILD_SHARED_LIBS

Because if I do that, I can’t run make install, because

pkg-static: Unable to access file /usr/ports/multimedia/assimp/work/stage/usr/local/lib/libassimp.so:No such file or directory
pkg-static: Unable to access file /usr/ports/multimedia/assimp/work/stage/usr/local/lib/libassimp.so.5:No such file or directory
pkg-static: Unable to access file /usr/ports/multimedia/assimp/work/stage/usr/local/lib/libassimp.so.5.3.0:No such file or directory
*** Error code 1
Comment 9 Piotr Kubaj freebsd_committer freebsd_triage 2023-10-25 19:44:40 UTC
(In reply to skye gänseblum from comment #8)
No, that was a mistake, I meant BUILD_STATIC_LIBS.
Comment 10 skye gänseblum 2023-10-25 20:38:47 UTC
(In reply to Piotr Kubaj from comment #9)
gotcha, sorry, i’m new here :o) 
and yes, can confirm, those changes made it go through finally! thanks a lot
Comment 11 Alexey Vyskubov 2023-10-29 13:37:17 UTC
I have the same Rust compilation issue on FreeBSD 13.2-p4. I have audio/picard installed, which pulls in assimp. So I have added BUILD_STATIC_LIBS to CMAKE_OFF in assimp Makefile and removed and recompiled the package. The result: ...drumroll... the same Rust compilation failure, cannot find zlibstatic. So I have removed assimp at all, and compilation went through.

❯ grep STATIC /usr/ports/multimedia/assimp/Makefile
CMAKE_OFF=              ASSIMP_BUILD_TESTS BUILD_STATIC_LIBS
❯ ls /usr/local/lib/*zlibstatic*
ls: /usr/local/lib/*zlibstatic*: No such file or directory
[...compilation and installation of audio/picard, which pulls in multimedia/assimp...]
❯ ls /usr/local/lib/*zlibstatic*
/usr/local/lib/libzlibstatic.a


What am I doing wrong?
Comment 12 Martin Birgmeier 2023-10-29 18:06:20 UTC
Could be
- not properly deinstalling the old assimp
- not completely removing the port build dir before retrying (the libzlibstatic is cached from the first configure run)

-- Martin
Comment 13 Alexey Vyskubov 2023-10-31 07:57:07 UTC
(In reply to Martin Birgmeier from comment #12)
Maybe the second. The first is unlikely: as I've shown there is no libzlibstatic after deinstallation. Thanks!