From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 8433615817D for ; Sat, 15 Jun 2024 22:22:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 77E89E2BCE; Sat, 15 Jun 2024 22:22:22 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E4850E2BC7 for ; Sat, 15 Jun 2024 22:22:21 +0000 (UTC) Message-ID: Subject: Re: [gentoo-dev] [PATCH] cargo.eclass: Add cargo_target_dir helper function From: James Le Cuirot To: gentoo-dev@lists.gentoo.org Date: Sat, 15 Jun 2024 23:22:10 +0100 In-Reply-To: References: <20240613150530.24679-1-chewi@gentoo.org> <3596ff34-6a36-41e3-944d-ea11c1bfe737@gentoo.org> Autocrypt: addr=chewi@gentoo.org; prefer-encrypt=mutual; keydata=mQINBFPBLZQBEACkc6lcPvLMWaFupeWreFCnJebwLjiQgYlizl/nUzIcXXmj4gostejm/ k8ulAjTSrqFnHtcJs+TkriJfQtFZUyGTmdH2GQeZKcjx6ugwsjGiPksigRHcwrDdIrtempsNjXGaZ 0cZyrO6BHfUZ3irSUT3X4agSFQxsGnTfK1zLZCdMychY1vUlg9WynxSlnW+P7MsHM9ZtFquuPp2BD 45AdPjSFyxlwIaaEqApWNXE96mewv3jX6C5voGLVTk1XD52gm8DVeVKcUFOhbu0tQO2nk/v88XTrN kEWEVRfHa1/zkue/YG1JGu21gfVIC/0wdZCu90AY9lo/4qaAy/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ZtDKhH3GntKB9aG9Peg8yFMzziZEUqnFUwzKHOwKtMHSNRDKNfMrH1 KipEzL1Rf5K7y/SFdt3gLnwNFTuPpFz2p+vBjqX2QH23EM8xBxXWFU/PmOTn69dEh/3NaRVP3442t UgU2P7gLqFVou1oWHLsg0/lmz1LatA5BqBQMcXIJldcg8XhHw5uaNJ6casUT2udWHqWjYxs8KU4CS 1RKHa8If5PbImy9aapcHgI4ng60sw4rhqgJB1ogTx7+VbF1qZHe41IMoLdI+jvAkCUPDZJh2/C8WX mT/L8+tq6spdSGTN/p/zDLbBiwKMoAxs3xVPbnee0RzPouJ1Hmjcf1lgslqa2r1+wivdFXR/HJ/Lr ozCNwKOF4S5qBy2ptBe7SfWHtd4poly4Eq3J63zwE5YhU4shUstNudybXc/JdIbhVTql/U6wtW6MW RcbKGu+9p+gzb+MLk26JQwbr8noRkpv2f+4oGKcLSc7GdYoOHz4CpFL7hlEFQbLXyT5rI1A0sTJYV 6oAIqDyLoO0Mfk7JxVlYjPLWu/0Dvdt539Pmh6MDcB6Jj052LlQXO5ijqgwrZ4dT6I= Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-6AiHYiQ5C9MO4U9zoWvG" User-Agent: Evolution 3.52.1 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 X-Archives-Salt: 74ce46c5-8c2d-47ba-ac9f-e2428e260c1c X-Archives-Hash: f94e826d9b6cd85ea5f1b3a7e5a41fca --=-6AiHYiQ5C9MO4U9zoWvG Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sat, 2024-06-15 at 17:56 -0400, Ionen Wolkens wrote: > On Sat, Jun 15, 2024 at 08:14:34PM +0200, Florian Schmaus wrote: > > On 13/06/2024 17.03, James Le Cuirot wrote: > > > Several Cargo-based ebuilds cannot use cargo_src_install for various > > > reasons and manually install binaries from within the target director= y > > > instead. It is common to see `target/$(usex debug debug release)`, bu= t > > > this lacks the target ABI when cross-compiling, so provide a helper > > > function. > >=20 > > Glad that someone is working on better cross-compilation support for= =20 > > rust. :) > >=20 > > That said, many rust ebuilds generate shell completions by invoking the= =20 > > just compiled binary in src_install(). This does not work out of the bo= x=20 > > when cross-compiling. > >=20 > > Is there anything we can or should do about it (besides binfmt_misc)?= =20 > > For example, asking the according projects to implement a mechanism to= =20 > > extract the completions files from the binary without running it, or= =20 > > have the build system generate the completion files as result of the bu= ild? >=20 > All I can think of without changing entirely how they're generated is: > 1. (worst) either make a 2nd build using CBUILD (yeah no), or BDEPEND > on same-version self with a USE only when cross compiling > 2. (lazy) skip completions w/ ewarn if tc-is-cross-compiler, just so > it at least won't break cross over completion files that the user > may not even care much about > 3. generate them yourself with each releases and ship in a tarball, > works out for users but extra burden for maintainer over little > 4. ask upstream to provide proper release tarballs if not already and > include pre-generated completions/docs/etc... so it's otherwise > only a problem with arbitrary git checkouts > (3+4 may possibly be more complicated if cargo features / USE change > cli options and thus completion files) >=20 > For one of my ebuilds I went with better-than-nothing #2. I've been doing this work for Flatcar, which doesn't use any of the package= s affected by this, but it does still concern me a little. Unfortunately, non= e of the options are great. I've seen #2 in one or two cases, and thanks for doing that. For #1, the BDEPEND approach isn't possible with current Portage/PMS. The experimental EAPI 5-hdepend, which led to BDEPEND in EAPI 7, had a USE flag called targetroot (terrible name!) for this purpose. It wasn't based on cross-compiling, because Portage/PMS don't actually have any concept of tha= t. It applied when ROOT!=3D/. We decided not to keep it though. Chances are th= at / won't already have an identical or at least compatible version already installed. Doing another temporary build was therefore deemed preferable. O= n the plus side, that's quite easy with Cargo. On the minus side, almost all Rust builds take ages. It hardly seems worth it for shell completions. I really don't see #4 happening, given that most end-user applications are normally installed using cargo install. Regarding binfmt_misc,=C2=A0you could explicitly invoke via qemu-user inste= ad, making it less dependent on a particular setup. I have hacked together some helpers to do stuff like this because we really need it for Perl. In Perl's case, it would be mandatory when cross-compiling because there's really no other way. I wouldn't want it to be mandatory in this case though. --=-6AiHYiQ5C9MO4U9zoWvG Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iQJFBAABCAAvFiEEPxcZ3tkwcedKm2a8EiZBXQDdMTcFAmZuFBIRHGNoZXdpQGdl bnRvby5vcmcACgkQEiZBXQDdMTeN2g//XLXajdR3FIS/huXD9rfGDJV/SSGk1nwQ z34vxUED0JXyWWhIoLO0PtJRp2N9CLjSMxOx3ZEgqUnV9ZBHUXP+QJH2lFS1QqFi oXgbnb95wMQg5pGoBAiR7lTiigWzltG1JdJXVyvdCmzVAg0Yuw5Ku2EZPWblmTtW DnOf5eZyaIuS68h0PO3V4TuJN9MJn0Cg4XlrumTClnw79HfaV+S3usoWU/AHDnUH XcNL5j+3GG/9zGlDhdW8IneiwnPPE96prV5k9aVrLWshRXNejinXwhJjsupJ+hEG qMcau6Fx/Vz7QywymFTnFQ5+fPCnIU7YNYVeb6ibPOZifnL8IdEHpt7D8Nt4OXB6 ECltSCO9oWBZxX5vhZ2ouGmFzgzTlfY2DTA8Y2uWeXR1EuHPJyg0Hh5iPuGfN/GL ZOLxMDPGiRHZczTyLOX5lKJ8ATxDxVpM2YvSQuD+1PsbBytS3WKDY0canZjOidpF ESG/aYwh5ZrSci0Gtbsbnx6W6A3xHfLIHbs0CLMVenlb/28mZ5NaswBkAA/rbsDC JR8i0gVquEqwwsr3+mI8NOx274hwhJMwKOCdBHc73HdAVWHmA3eFMkamDj4xZGNQ pAwWSbpzMz8/0iqfdpueFmn/MboDrdrbSXBxuSQZUF7X92ApZBPWUeYCn8ZsAu6G LmvPqMTkYfc= =UvOb -----END PGP SIGNATURE----- --=-6AiHYiQ5C9MO4U9zoWvG--