Re: git: 9204fb371cbe - main - default-versions: add rust-bootstrap to RUST section

From: Enji Cooper <yaneurabeya_at_gmail.com>
Date: Sun, 15 Oct 2023 17:15:29 UTC
Hi Charlie,

> On Oct 2, 2023, at 11:05 PM, Charlie Li <vishwin@freebsd.org> wrote:
> 
> Enji Cooper wrote:
>>     default-versions: add rust-bootstrap to RUST section
>>          lang/rust-bootstrap is another potential option for RUST.
>>     document the value in the comment so others might consider its use.
>> 
> There are some choice words about this part that I will spare the room for now.
>>     lang/rust-bootstrap has more tunable knobs which allow for more minimal
>>     builds of the rust toolchain than lang/rust -- which may be desirable
>>     for appliance or iterative builds.
>> 
> [citation needed]: no OPTIONS exist, amongst other things.
> 
> Ultimately this doesn't make sense. This port has one purpose, for providing a bootstrap toolchain to build the full lang/rust or the tarball outside of the ports framework. "Appliance or iterative builds" fall under the general purpose category. Not only is there a "circular" dependency on the full lang/rust to bootstrap this port, but both rust-std and cargo are built regardless and are required for the toolchain to work at all; neither are light or minimal by any means. cargo especially uses many dependent crates that use the FFI to link to libraries provided by other ports or base or bundled. Finally, the built results are installed/staged into a special bootstrap hierarchy, and not a more "standard" one, for which the singular use case could not be more obvious.

Ok. It would be nice if I had known that earlier.. FWIW, I thought this would have solved the lang/rust bootstrapping problem at work, but it didn’t.

>>     Approved by:    portmgr (bapt)
>>     Reviewed by:    allanjude, bapt
>>     Differential Revision:  https://reviews.freebsd.org/D42052
> Why was rust@ conveniently bypassed here?

That was purely an oversight. I am not a ports committer and am not really aware of the rust ports cadre and didn’t think to look first, so I failed to include rust@. I apologize for that.

I see that tobik@ reverted the change later. I agree that was the right thing to do, but it would be helpful if there was a comment somewhere noting that rust-bootstrap shouldn’t be used for `DEFAULT_VERSIONS+= rust=`, even if it’s in the bsd.default-versions.mk code itself (checking for valid versions), or a separate USES+= rust file. If a check or comment had been in there sooner, I would have known that value was invalid and wouldn’t have bothered with suggesting the change in the first place (and it would have saved me a day or two of wasted time at $work).

Thank you,
-Enji