• Re: [gentoo-dev] [PATCH 1/3] cargo.eclass: Add cargo_env helper and use

    From Eli Schwartz@21:1/5 to James Le Cuirot on Thu Jul 25 00:20:01 2024
    This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------WhEbMflQ07JMmJkqU9RNgGEU
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: quoted-printable

    On 7/24/24 6:07 PM, James Le Cuirot wrote:
    Rust packages have a tendency to rebuild parts during test and install.
    It is not clear whether this can be addressed. We were therefore relying
    on some environment variables set during the compile phase for cross-compiling to work in the later phases. This is not ideal,
    especially if you need to build for multiple targets.


    Oof, yeah, as I mentioned on Monday in -dev, I have a package that
    actually produces meaningfully different programs if you rebuild it
    during test.

    dev-util/ruff will, when built with FEATURES=test, not show color when
    you run it. Don't know why, feel a bit too freaked out about rebuilding
    for tests *at all* to even think about fixing this in a "src_test
    compatible way".

    So I wonder if maybe we can somehow switch to e.g. doing the test phase
    in a different directory such that it doesn't modify the artifacts we
    actually want to install.


    --
    Eli Schwartz


    --------------WhEbMflQ07JMmJkqU9RNgGEU--

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

    wnsEABYIACMWIQTnFNnmK0TPZHnXm3qEp9ErcA0vVwUCZqF81gUDAAAAAAAKCRCEp9ErcA0vV12Y AP0aH4KDKlnDPlvybijBCZtOVYXtav+KywN4U88sNworBQD9EsVCRNPKIhGbyAE2n5urQxW1ZTZK oG1u8+75Gf5u7w8=
    =nQGK
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Le Cuirot@21:1/5 to Eli Schwartz on Thu Jul 25 10:10:01 2024
    On Wed, 2024-07-24 at 18:14 -0400, Eli Schwartz wrote:
    On 7/24/24 6:07 PM, James Le Cuirot wrote:
    Rust packages have a tendency to rebuild parts during test and install.
    It is not clear whether this can be addressed. We were therefore relying
    on some environment variables set during the compile phase for cross-compiling to work in the later phases. This is not ideal,
    especially if you need to build for multiple targets.


    Oof, yeah, as I mentioned on Monday in -dev, I have a package that
    actually produces meaningfully different programs if you rebuild it
    during test.

    dev-util/ruff will, when built with FEATURES=test, not show color when
    you run it. Don't know why, feel a bit too freaked out about rebuilding
    for tests *at all* to even think about fixing this in a "src_test
    compatible way".

    So I wonder if maybe we can somehow switch to e.g. doing the test phase
    in a different directory such that it doesn't modify the artifacts we actually want to install.

    It can happen due to files or environment variables changing. It sounds like the tests inadvertently cause that in this case. You could copy the $(cargo_target_dir) to $(cargo_target_dir)-test and then set CARGO_TARGET_DIR to the latter before running the tests.

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

    iQJFBAABCAAvFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmaiB54RHGNoZXdpQGdl bnRvby5vcmcACgkQEiZBXQDdMTc+Sw/9EWgVsZZmXaUAju+5Cz/Dxh/VnzmnyP3E JqXp8FxaS1BVM1VDqKt9bpXzp+NBzP2fhHt+ijhp+yrfIJshDlhUx/qIH2eFb4My HbAfTacuSFrDlmC2e+xf9pXrUUBTM9p/rHeBqDDw3LnttAloqStAnUnj7kQKJ0gs PZuqDKaIjQkH3frgOoYY0nqOL2ClDlASRiLsFpEoJ4WmI/LYQrNzRH+aiht59Aji nkgqB9hVLDeoj/aJ8q5f8yyj5f/FNLgGzNEgUjr7qNA1jAEbGVtf4/EUrtxQVAIY IkLrSEVUAfTyXTKVdkvIs3mDoQnm9Jtd9/W2jr+3XgJIUXslO21aD098irdYY1yp sYgBuT46IbsR4ETIPiTsGyaN/4xSMDZ25wN6dEeZcbaY0bBejp2OHVr1xfFaYRB5 o9fPodAj7sNZYmUsYM19nheeDMm+PvOY5Yc0Lo9OuUj99gTw/tUIvaTuxJ+k1BSM pSgf5n+LoeFbzg8IbnXleNw/966dxNNeaB8LUAJCmSima6xyjPffEeZmSzr8o8hv k6fVXGPIjLhcapLr7QT9AEUqp05kvJI1I4tSC8bx4sfMiDdKZuvv92Yp3J9tI2iW qay/IYnNhAtHhraXtsM7DZlKKNpOwc7AVFIbB/h03WV6KD5yExzQeqVzKBmZXfk8
    qjZISTLzhIQ=
    =5bxu
    -----END PGP SIGNATURE-----

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)