Bug 265062 - Mk/Uses/cargo.mk: remove bogus rust version requirement
Summary: Mk/Uses/cargo.mk: remove bogus rust version requirement
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Package Infrastructure (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: FreeBSD Rust Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-07-06 14:21 UTC by Dmitry Marakasov
Modified: 2022-08-25 21:35 UTC (History)
1 user (show)

See Also:


Attachments
Patch (442 bytes, patch)
2022-07-06 14:21 UTC, Dmitry Marakasov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Marakasov freebsd_committer freebsd_triage 2022-07-06 14:21:06 UTC
Created attachment 235098 [details]
Patch

Remove bogus rust minimal version requirement which needlessly breaks build which goes perfectly fine otherwise, such as when rust is installed from packages or when it's unfeasible to rebuild rust right away.
Comment 1 Mikael Urankar freebsd_committer freebsd_triage 2022-07-06 16:00:07 UTC
This check is in place because we can't guarantee that a random rust version will be able to compile our rust dependents ports.
Comment 2 Dmitry Marakasov freebsd_committer freebsd_triage 2022-07-12 17:16:08 UTC
(In reply to Mikael Urankar from comment #1)
> This check is in place because we can't guarantee that a random rust version will be able to compile our rust dependents ports.

"Not being able to guarantee" and "having a check which is guaranteed to break the build" are not really related to each other. In fact, we don't support any configuration which involves building from ports with any package version different from that in the ports tree, but we don't put version requirements on each dependency line, I don't see why rust should be an exception.

It won't be very important in most other cases, but in this specific case a maintainer's workflow is broken by the check, because after rust update a maintainer of rust-consuming port is forced to rebuild rust (multiple times, since ports are tested on multiple arches and multiple FreeBSD versions) just to test a leaf port update, and that may take days on an average machine. There are tools like reprise which -could- use prebuilt packages for testing, but are prohibited from doing that by the check.
Comment 3 Dmitry Marakasov freebsd_committer freebsd_triage 2022-08-15 13:37:38 UTC
So you've just ignored my arguments?
Comment 4 Mikael Urankar freebsd_committer freebsd_triage 2022-08-15 17:12:52 UTC
(In reply to Dmitry Marakasov from comment #3)
I'm not ignoring them but as I said I can't guarantee that a random rust version will be able to compile our rust dependents ports
Comment 5 Dmitry Marakasov freebsd_committer freebsd_triage 2022-08-15 17:30:59 UTC
(In reply to Mikael Urankar from comment #4)
To which I've replied that "not being able to guarantee" has nothing to do with deliberately breaking the build.
Comment 6 commit-hook freebsd_committer freebsd_triage 2022-08-25 21:35:38 UTC
A commit in branch main references this bug:

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

commit 4b500674d50988b7ce3585914be27ef74fea3c1d
Author:     Tobias Kortkamp <tobik@FreeBSD.org>
AuthorDate: 2022-08-25 21:16:22 +0000
Commit:     Tobias Kortkamp <tobik@FreeBSD.org>
CommitDate: 2022-08-25 21:16:22 +0000

    Uses/cargo: Allow using any Rust version if requested

    Skip the Rust version check when CARGO_BUILDDEP=any-version

    The current version check is justified by USES=cargo making use
    of newer toolchain features that not all Cargo versions support
    and the fact that Rust binaries are statically linked against
    libstd (and others) which have been vulnerable in the past.
    We can enforce the use of the correct toolchain only with the
    version check. Together with revision bumps of all ports that
    have lang/rust as input we can ensure that they are kept "fresh"
    and relinked whenever lang/rust is updated.

    According to amdmi3@ skipping the check might be useful for build
    testing in some cases.

    Individual ports should not set CARGO_BUILDDEP=any-version. It
    can be set in make.conf or on the command line by users.

    PR:             265062
    Reported by:    amdmi3

 Mk/Uses/cargo.mk | 2 ++
 1 file changed, 2 insertions(+)