Re: [projects/template-specs] use %cargo_* macros
On Wed, Mar 31, 2021 at 4:34 AM Elan Ruusamäe wrote: > > On 30.03.2021 21:57, Jakub Bogusz wrote: > > > On Tue, Mar 30, 2021 at 06:46:46PM +0300, Elan Ruusamäe wrote: > > [...] > > When it comes to crates, It'd better to find some generic solution for > > packaging creates system-wide instead of vendoring everything > > everywhere. I'm aware Fedora has some, but I didn't have enough time to > > do a research. > > their solution to create 120 packages for each of them. > > the same goes for npm and go packages. > As one of the developers of those macros, I can confidently say both ways (per component packaging and vendored packages) are supported. For Rust and Go, we're doing per-component packaging because having to patch and fix the same thing hundreds of times is terrible for security stuff. Fixing the code once and kicking off rebuilds of reverse dependency chains is way easier. For Nodejs, we do vendored by default now: https://fedoraproject.org/wiki/Changes/NodejsLibrariesBundleByDefault > besides, if you diverge from versions present in vendor lock, > > you are bringing package support on your own shoulders. we do not have > such resources! > While it's true you're diverging, this is no different than what you do with C, C++, Ruby, Perl, and Python. In practice, this is where distros sharing resources comes in handy because you can collaborate on it. -- 真実はいつも一つ!/ Always, there's only one truth! ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: [projects/template-specs] use %cargo_* macros
On 30.03.2021 20:57, Jakub Bogusz wrote: > On Tue, Mar 30, 2021 at 06:46:46PM +0300, Elan Ruusamäe wrote: > [...] > > >@@ -40,19 +41,17 @@ EOF > > > %build > > > export CARGO_HOME="$(pwd)/.cargo" > > > > > >-cargo -v build \ > > >+%cargo_build \ > > > %ifarch x32 > > > --target x86_64-unknown-linux-gnux32 \ > > > %endif > > >- --release \ > > > --frozen > > > > > > %install > > > rm -rf $RPM_BUILD_ROOT > > > export CARGO_HOME="$(pwd)/.cargo" > > > > > >-cargo -vv \ > > >- install \ > > >+%cargo_install \ > > > --frozen \ > > > --path . \ > > > --root $RPM_BUILD_ROOT%{_prefix} > > > > > > why not include the crate based build options also into common macros? > > > > > > also, in template-specs/rust.spec, there's comment for source0, creating > > crate, maybe an universal script could be provided by macros package? > > I'd enhance %cargo_build at least by adding x32 --target option. Good point, thanks. I didn't realize rustc on x32 does not compile to x32 by default. Added in 2.004. ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: [projects/template-specs] use %cargo_* macros
On 30.03.2021 21:57, Jakub Bogusz wrote: On Tue, Mar 30, 2021 at 06:46:46PM +0300, Elan Ruusamäe wrote: [...] When it comes to crates, It'd better to find some generic solution for packaging creates system-wide instead of vendoring everything everywhere. I'm aware Fedora has some, but I didn't have enough time to do a research. their solution to create 120 packages for each of them. the same goes for npm and go packages. besides, if you diverge from versions present in vendor lock, you are bringing package support on your own shoulders. we do not have such resources! as for the original topic: the other place where to integrate crates fetch, could be aside `builder` script, maybe builder --update-create option. ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: [projects/template-specs] use %cargo_* macros
On Tue, Mar 30, 2021 at 06:46:46PM +0300, Elan Ruusamäe wrote: [...] > >@@ -40,19 +41,17 @@ EOF > > %build > > export CARGO_HOME="$(pwd)/.cargo" > > > >-cargo -v build \ > >+%cargo_build \ > > %ifarch x32 > > --target x86_64-unknown-linux-gnux32 \ > > %endif > >---release \ > > --frozen > > > > %install > > rm -rf $RPM_BUILD_ROOT > > export CARGO_HOME="$(pwd)/.cargo" > > > >-cargo -vv \ > >-install \ > >+%cargo_install \ > > --frozen \ > > --path . \ > > --root $RPM_BUILD_ROOT%{_prefix} > > > why not include the crate based build options also into common macros? > > > also, in template-specs/rust.spec, there's comment for source0, creating > crate, maybe an universal script could be provided by macros package? I'd enhance %cargo_build at least by adding x32 --target option. When it comes to crates, It'd better to find some generic solution for packaging creates system-wide instead of vendoring everything everywhere. I'm aware Fedora has some, but I didn't have enough time to do a research. -- Jakub Boguszhttp://qboosh.pl/ ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en
Re: [projects/template-specs] use %cargo_* macros
On 30.03.2021 14:26, atler wrote: commit f329c346f35622a09475262bb712ae52aed03f4a Author: Jan Palus Date: Tue Mar 30 13:25:20 2021 +0200 use %cargo_* macros rust.spec | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) --- diff --git a/rust.spec b/rust.spec index 3e3e272..d792e2c 100644 --- a/rust.spec +++ b/rust.spec @@ -14,6 +14,7 @@ Source1: %{name}-crates-%{version}.tar.xz # Source1-md5:- URL: - BuildRequires:cargo +BuildRequires: rpmbuild(macros) >= 2.003 BuildRequires:rust BuildRequires:tar >= 1:1.22 BuildRequires:xz @@ -40,19 +41,17 @@ EOF %build export CARGO_HOME="$(pwd)/.cargo" -cargo -v build \ +%cargo_build \ %ifarch x32 --target x86_64-unknown-linux-gnux32 \ %endif - --release \ --frozen %install rm -rf $RPM_BUILD_ROOT export CARGO_HOME="$(pwd)/.cargo" -cargo -vv \ - install \ +%cargo_install \ --frozen \ --path . \ --root $RPM_BUILD_ROOT%{_prefix} why not include the crate based build options also into common macros? also, in template-specs/rust.spec, there's comment for source0, creating crate, maybe an universal script could be provided by macros package? ___ pld-devel-en mailing list pld-devel-en@lists.pld-linux.org http://lists.pld-linux.org/mailman/listinfo/pld-devel-en