Sunday, December 31, 2023

Re: lang/rust: roadmap for using SYSTEM_VERSION

Theo Buehler <tb@theobuehler.org> writes:

> On Sat, Dec 30, 2023 at 07:32:18PM +0100, Sebastien Marie wrote:
>
> The outlined procedure makes sense to me and I like the approach, but I
> am a bit worried that it makes it harder for people to write Rust ports
> using the devel/cargo module, which is already tricky.
>
> Porters will now need to be able to grasp the separation of concerns to
> understand the distinction between the devel/cargo and lang/rust
> modules. They must now deal with two sets of variables: MODCARGO_* and
> MODRUST_*. The latter only has two user-visible bits for now, so maybe
> it's not that bad.

initially, I tried to hide the "lang/rust" module under "devel/cargo"
module (and have devel/cargo to sets MODULES+=lang/rust), but
arch-defines.mk is included before MODULES processing, which means that
the test ${MODULES:Mlang/rust} to check if lang/rust module is here or
not isn't trigger as the module comes too late in the variable.


Regarding MODCARGO_WANTLIB to MODRUST_WANTLIB transition, it might be
possible to define the first using the second (MODCARGO_WANTLIB = ${MODRUST_WANTLIB}).
But I am unsure if it would really help or not.

I don't intent to push lot of configuration variables in MODRUST_*. In
fact, only the minimal sets: if a port is using lang/rust module alone
without devel/cargo, it usually means the build to be somehow custom, so
no need to try to add magic.

> A small nit below. At the end is a small diff for port-modules which
> you can tweak and commit once we decide to go ahead with your plan.

thanks.

>> commit - a1995e6a715404d542f5d69eadb9a9bac7bbca61
>> path + /home/semarie/repos/openbsd/ports
>> blob - 4c5723bf509e5aaaf1541b76acd3b48119bb5b7c
>> file + devel/cargo/cargo.port.mk
>> --- devel/cargo/cargo.port.mk
>> +++ devel/cargo/cargo.port.mk
>> @@ -1,4 +1,8 @@
>> -CATEGORIES += lang/rust
>> +# we can't just add lang/rust to MODULES
>> +# it makes _SYSTEM_VERSION-rust (in arch-defines.mk) not properly defined
>> +.if defined(MODULES) && ! ${MODULES:Mlang/rust}
>> +ERRORS += "devel/cargo module needs also lang/rust in MODULES"
>
> this should be 'also needs'
>
> ERRORS += "devel/cargo requires lang/rust to be set in MODULES"
>
>> +.endif
>>
>
> Index: port-modules.5
> ===================================================================
> RCS file: /cvs/src/share/man/man5/port-modules.5,v
> diff -u -p -r1.266 port-modules.5
> --- port-modules.5 14 Sep 2023 03:53:26 -0000 1.266
> +++ port-modules.5 31 Dec 2023 08:33:48 -0000
> @@ -978,6 +978,20 @@ See
> .It lang/ruby
> See
> .Xr ruby-module 5 .
> +.It lang/rust
> +Ports using Rust must use this module so a rebuild can be triggered via
> +.Ev SYSTEM_VERSION-rust
> +on updates of the lang/rust port or changes to the Rust standard library.
> +Sets
> +.Ev MODRUST_WANTLIB
> +as appropriate for the architecture so it can be added to
> +.Ev WANTLIB .
> +It adds lang/rust to the
> +.Ev BUILD_DEPENDS
> +unless
> +.Ev MODRUST_BUILDDEP
> +is set to anything but
> +.Dq yes .
> .It lang/tcl
> Sets
> .Ev MODTCL_VERSION ,

--
Sebastien Marie

No comments:

Post a Comment