#1076440 dh-rust: internalize CARGO_HOME handling

#1076440#5
Date:
2024-07-16 11:47:15 UTC
From:
To:
dh_rust currently calls external Python-base wrapper script "cargo"
for all interaction with upstream tool "cargo"
that involves CARGO_HOME.

Better if CARGO_HOME functionality could be handled internally
in the D::D::Buildsystem::rust library,
simplifying code and avoiding dependency on python.

Possibly the wrapper does more than only handling CARGO_HOME.
Let's be cautious, and to begin with only internalize that part,
then see what is left to do to eliminate the wrapper.

 - Jonas
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEn+Ppw2aRpp/1PMaELHwxRsGgASEFAmaWXbwACgkQLHwxRsGg
ASEU8A/+PuwNW2pQ1n8tX4eKTc7H82zuGslBZVbLn2BegB/AeroYXAyv4A9JrIdZ
k+885HGcY2a+tRSROC3JGVpyv0Hc2r/spiPcs3q6cX+/05HyLI7cZlYS1WVd9BlL
FUYCz58bNjOxQ+nMqbGi3uc2PBQCFtdSEHkSb5L5QVQj/crl62v6HbTu5ij1Hm7l
AHLF3Mve0zsIC6eVbYVJROoPrqy+HhEbgnhQIQJgnZOzwSVNiBHHdoqKldq8GkCX
YEK/claAv+hUvi+OeH1RFyPDh3SpMHGZAgCnVYS8duS02uXdfFBnrO76l4G61bai
XPv1guGaKT8fQ90C7pBn4124pu4Wn7LoUgzYzVFMxWgcJ+xjnslmoX0/MafyT64+
Q/iiMZzbTKeWwdGgc8Z25bm/bCDGEVxYIUGMDWaYzr59sQF+ae9K/8XKUuBxk7B9
fuAbHxhV198Foj7+4+HBfK7tQCEv3epsjcvE6eBhDY1FPgbQqsyIi9lLaKT9Ufvk
+DyxLgE7o5AoYMCMbM0R5A1vpOnT0GXcX5Dt0tRR7KOxRGO29I7GIG7/bMd8BeUo
qXrmKceVx6BZvjBDqcqpNqI/8z0rPqa0R1YGizg4RC66KrhMk7uwHpqW7UNO7IHL
6w94fw6qVj+iJ5ouVH9kdRl51SuQh+x+QLYFwkC0i+YM0PwwkZU=
=C/FP
-----END PGP SIGNATURE-----

#1076440#10
Date:
2024-07-16 12:04:29 UTC
From:
To:
Quoting Jonas Smedegaard (2024-07-16 13:47:15)

An interesting use case here is helvum:

Upstream build system is meson,
with CARGO_HOME=$BUILDDIR/cargo-home
which ideally should be possible to handle like this:

%:
        dh $@ --buildsystem meson+ninja --builddirectory build

execute_before_dh_auto_configure:
        dh_auto_configure --buildsystem rust --cargo-home build

 - Jonas

#1076440#17
Date:
2024-07-16 12:18:34 UTC
From:
To:
Quoting Jonas Smedegaard (2024-07-16 13:47:15)

An interesting use (and test) case here is rust-tonic:

Upstream includes with source some code in one subproject
which was generated by another subproject.

Debian source package should contain only source code,
so the source package is repackaged, stripping the generated files,
and during build the generating subproject is first run,
before build other parts.

Currently, calling the generating project is done
by setting up the required set of environment variables
and directly calling the Python wrapper.

I imagine that with internalized CARGO_HOME handling
done by dynamically adding/mangling settings in default CARGO_HOME,
then an unusual corner case is to test that rust-tonic still works.

 - Jonas