Bug 270271 - lang/rust: Applying extra patch no-hardlinks/patch-src_bootstrap_native.rs fails with rust-1.68.0
Summary: lang/rust: Applying extra patch no-hardlinks/patch-src_bootstrap_native.rs fa...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: FreeBSD Rust Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-03-16 16:08 UTC by Fabian Wenk
Modified: 2023-03-20 08:56 UTC (History)
4 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 Fabian Wenk 2023-03-16 16:08:28 UTC
===>   rust-1.68.0 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by rust-1.68.0 for building
===>  Extracting for rust-1.68.0
=> SHA256 Checksum OK for rust/rustc-1.68.0-src.tar.xz.
=> SHA256 Checksum OK for rust/2023-02-09/rustc-1.67.1-x86_64-unknown-freebsd.tar.xz.
=> SHA256 Checksum OK for rust/2023-02-09/rust-std-1.67.1-x86_64-unknown-freebsd.tar.xz.
=> SHA256 Checksum OK for rust/2023-02-09/cargo-1.67.1-x86_64-unknown-freebsd.tar.xz.
===>  Patching for rust-1.68.0
===>  Applying extra patch patches for rust-1.68.0 from /usr/ports/lang/rust/files/no-hardlinks
Ignoring previously applied (or reversed) patch.
2 out of 2 hunks ignored--saving rejects to src/bootstrap/native.rs.rej
===>  FAILED Applying extra patch patch-src_bootstrap_native.rs
===> Cleanly applied extra patch patch(es)  patch-src_bootstrap_lib.rs
===> FAILED to apply cleanly extra patch patch(es)  patch-src_bootstrap_native.rs
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust
** Command failed [exit code 1]: /usr/bin/script -qa /tmp/portupgrade20230316-74194-mz0wwh env UPGRADE_TOOL=portupgrade UPGRADE_PORT=rust-1.67.1
** Fix the problem and try again.
** Listing the failed packages (-:ignored / *:skipped / !:failed)
        ! lang/rust (rust-1.67.1)       (patch error)


After I have removed /usr/ports/lang/rust/files/no-hardlinks/patch-src_bootstrap_native.rs all patches applied. Building Port is currently running.
Comment 1 Alex 2023-03-16 17:58:19 UTC
Same issue, I will try the temp fix of deleting the patch and re-running. 


I am running FreeBSD meatwad 12.3-RELEASE-p11 FreeBSD 12.3-RELEASE-p11 GENERIC  amd64

I did a simple make install in the rust directory after upgrading the ports tree and rust is failing to build with the below error. I have tried several methods even including pulling the pkg, but the pkg is still on version 1.66. 1.68 does not build at all. 


===> Fetching all distfiles required by rust-1.68.0 for building
===>  Extracting for rust-1.68.0
=> SHA256 Checksum OK for rust/rustc-1.68.0-src.tar.xz.
=> SHA256 Checksum OK for rust/2023-02-09/rustc-1.67.1-x86_64-unknown-freebsd.tar.xz.
=> SHA256 Checksum OK for rust/2023-02-09/rust-std-1.67.1-x86_64-unknown-freebsd.tar.xz.
=> SHA256 Checksum OK for rust/2023-02-09/cargo-1.67.1-x86_64-unknown-freebsd.tar.xz.
===>  Patching for rust-1.68.0
===>  Applying extra patch patches for rust-1.68.0 from /usr/ports/lang/rust/files/no-hardlinks
Ignoring previously applied (or reversed) patch.
2 out of 2 hunks ignored--saving rejects to src/bootstrap/native.rs.rej
===>  FAILED Applying extra patch patch-src_bootstrap_native.rs
===> Cleanly applied extra patch patch(es)  patch-src_bootstrap_lib.rs
===> FAILED to apply cleanly extra patch patch(es)  patch-src_bootstrap_native.rs
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/rust
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust
Comment 2 Bart Ender 2023-03-17 07:55:16 UTC
======================<phase: patch-depends  >============================
===========================================================================
=======================<phase: patch          >============================
===>  Patching for rust-1.68.0
===>  Applying extra patch patches for rust-1.68.0 from /usr/ports/lang/rust/files/no-hardlinks
Ignoring previously applied (or reversed) patch.
2 out of 2 hunks ignored--saving rejects to src/bootstrap/native.rs.rej
===>  FAILED Applying extra patch patch-src_bootstrap_native.rs
===> Cleanly applied extra patch patch(es)  patch-src_bootstrap_lib.rs
===> FAILED to apply cleanly extra patch patch(es)  patch-src_bootstrap_native.rs
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/rust
=>> Cleaning up wrkdir
===>  Cleaning for rust-1.68.0
build of lang/rust | rust-1.68.0 ended at Fri Mar 17 07:34:39 UTC 2023
build time: 00:01:25
!!! build failure encountered !!!


Poudriere fails with same issue. 
Q&D solution is (see OP Fabian Wenk), to remove usr/ports/lang/rust/files/no-hardlinks/patch-src_bootstrap_native.rs   
The file lives twice in usr/ports/lang/rust/files/no-hardlinks/ and   
/usr/ports/lang/rust/files/ and consequently is run twice by patch, leading to the error.
Comment 3 commit-hook freebsd_committer freebsd_triage 2023-03-17 08:20:26 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d050a1c356a566137b1d5c6f74772788a6d08779

commit d050a1c356a566137b1d5c6f74772788a6d08779
Author:     Mikael Urankar <mikael@FreeBSD.org>
AuthorDate: 2023-03-17 08:18:49 +0000
Commit:     Mikael Urankar <mikael@FreeBSD.org>
CommitDate: 2023-03-17 08:19:51 +0000

    lang/rust: garbage collect patch

    PR:             270271

 .../patch-src_bootstrap_native.rs (gone)           | 40 ----------------------
 1 file changed, 40 deletions(-)
Comment 4 Fabian Wenk 2023-03-17 08:34:07 UTC
(In reply to Bart Ender from comment #2)

This are not the same patch files.

As I see it, the patch lang/rust/files/no-hardlinks/patch-src_bootstrap_native.rs failed because what it patched seems to be gone from upstream.

I have no idea about the consequences of not patching this.
On my system I could then build rust and use it to build and run clamav. So far I have not seen any errors.