tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: rust, rust-bin, bulk builds



nia <nia%NetBSD.org@localhost> writes:

> On Fri, Jun 12, 2020 at 10:40:15AM -0400, Greg Troxel wrote:
>> I'd like to ask nia@ to change PKGNAME for rust-bin to rust-bin and drop
>> the "don't build rust/rust-bin if TYPE doesn't match; this is something
>> that would have come out of the pre-commit discussion and expected to be
>> addressed before committing.
>
> Is there any way to deal with packages setting BUILDLINK_API_DEPENDS.rust
> other than by inserting ifs for RUST_TYPE everywhere?

Stepping back, I think the basic issue here is that rust, with the
introduction of rust-bin, is now something that's a bit more like gcc
than it used to be, where there are multiple versions, and we have
compiler framework, GCC_REQD, and so on.

I don't think it would be reasonable to demand a full compiler selection
framework for this, although I do think it's probably a good long-term
project for someone who wants to do this.


My idea to deal with this is to introduce a variable, perhaps RUST_REQ
(to be like GCC_REQ) set to a version, and have packages set that
instead of setting BUILDLINK_API_DEPENDS.rust.  Then the switch on TYPE
can be just once in the bl3 (or twice with cargo).   We could also have
RUST_RUNTIME or some better name with the idea being that if unset, rust
is a build-time dependency only, and if set, the dependency is recorded,
sort of like the variable to depend on gcc runtime libs.

With that, I think the switch stufff would bd contained to rust and
cargo, and the things that use rust would have just these variables, and
it would work ok.   But I could be missing something.


Home | Main Index | Thread Index | Old Index