<20220218122506.4450-1-theone@sm2n.ca>
https://github.com/rust-analyzer/rust-analyzer A Rust compiler front-end for IDEs --- testing/rust-analyzer/APKBUILD | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 testing/rust-analyzer/APKBUILD diff --git a/testing/rust-analyzer/APKBUILD b/testing/rust-analyzer/APKBUILD new file mode 100644 index 0000000000..3be97ba907 --- /dev/null +++ b/testing/rust-analyzer/APKBUILD @@ -0,0 +1,44 @@ +# Contributor: S.M Mukarram Nainar <theone@sm2n.ca> +# Maintainer: S.M Mukarram Nainar <theone@sm2n.ca> +pkgname=rust-analyzer +_pkgver="2022-02-14" +pkgver=${_pkgver//-} +pkgrel=0 +pkgdesc="A Rust compiler front-end for IDEs" +url="https://github.com/rust-analyzer/rust-analyzer" +# limited by rust, x86/armhf/armv7 fail tests +arch="x86_64 aarch64 ppc64le" +license="MIT Apache-2.0" +depends="rust-src" +makedepends="cargo" +checkdepends="rustfmt" +subpackages="$pkgname-doc" +source="$pkgname-$pkgver.tar.gz::https://github.com/rust-analyzer/rust-analyzer/archive/refs/tags/$_pkgver.tar.gz" +builddir="$srcdir/$pkgname-$_pkgver" + +prepare() { + default_prepare + + cargo fetch --locked +} + +build() { + cargo build --frozen --release +} + +check() { + cargo test --frozen +} + +package() { + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer + + install -Dm644 LICENSE-MIT "$pkgdir"/usr/share/licenses/$pkgname/LICENSE-MIT + install -Dm644 LICENSE-APACHE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE-APACHE + + install -Dm644 docs/user/manual.adoc "$pkgdir"/usr/share/doc/$pkgname/manual.adoc +} + +sha512sums=" +cad62bc2837daadf17fadd3e4ccb2cc9ea4203f14cdac6931548a025b2cd5daef5f4b645d36381fea5a5baf44b301d8b83f0136c095dcc3b500df476baab6f1b rust-analyzer-20220214.tar.gz +" -- 2.35.1
<164518723449.985.2872186642381637325.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<20220218122506.4450-1-theone@sm2n.ca>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer you removed the -t by accident so this is invalid -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216542
<164518727298.985.15492967363701615133.gitlab.31077.4dd3788a49122346e134735105d36a76830e45f5@listserv.local>
<20220218122506.4450-1-theone@sm2n.ca>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > +# limited by rust, x86/armhf/armv7 fail tests > +arch="x86_64 aarch64 ppc64le" > +license="MIT Apache-2.0" use an AND or OR depending on how they apply - looks like AND based on the readme ```suggestion:-0+0 license="MIT AND Apache-2.0" ``` -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216543
<164518728743.985.8594964318223694372.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518723449.985.2872186642381637325.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer wouldn't it be better to just use `cargo install` since that is the recommended way of installing Rust bin crates? -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216544
<164518731982.985.3624532095393160948.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518728743.985.8594964318223694372.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer i don't see a point when it's a single file and gives you nothing else anyway -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216545
<164518735851.985.15755599726231244056.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518731982.985.3624532095393160948.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer this is also another fancy workspaces project that probably rebuilds on install, and what is the point of figuring that out when you can just copy one file, hehe -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216547
<164518740718.985.6623088085365030937.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518735851.985.15755599726231244056.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer because it increases build time building whole workspace instead of single binary -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216548
<164518749474.985.18149823047210701689.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518740718.985.6623088085365030937.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer and it's very easy to find where is the required manifest https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/Cargo.toml -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216550
<164518754245.985.15206621881530857624.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518749474.985.18149823047210701689.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer then the solution is to build that single binary instead of the whole workspace- and you can still cp the file after. this is completely unrelated to the cargo install invocation, but only the cargo build one -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216551
<164518761115.985.13486656473333162923.gitlab.31077.4dd3788a49122346e134735105d36a76830e45f5@listserv.local>
<164518727298.985.15492967363701615133.gitlab.31077.4dd3788a49122346e134735105d36a76830e45f5@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > +# limited by rust, x86/armhf/armv7 fail tests > +arch="x86_64 aarch64 ppc64le" > +license="MIT Apache-2.0" actually `license = "MIT OR Apache-2.0"` from https://github.com/rust-analyzer/rust-analyzer/blob/master/crates/rust-analyzer/Cargo.toml -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216552
<164518772623.985.8385715085860625316.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518754245.985.15206621881530857624.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer if the cargo install ever actually did something useful like move some various extra files for you then i would get it, but 99% of the time it is identical to the cp and you have to rm -r some random folder it makes, so what exactly is the point? even in multi-bin projects you invoke `cargo install` once per individual binary, like in wezterm, so it saves absolutely nothing in 'complexity' of installing some build object -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216553
<164518781252.985.493041883453031285.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518772623.985.8385715085860625316.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer but yes, of course a +1 that the build should take the correct binary object to not build the entire workspace- this makes perfect sense :) -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216554
<164518796720.985.8093254361568311569.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518781252.985.493041883453031285.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer Cargo manifests can have multiple binaries and `cargo install` should install all of them with a single command -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216559
<87ley81h06.fsf@bentou.i-did-not-set--mail-host-address--so-tickle-me>
<164518796720.985.8093254361568311569.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
> On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: >> + >> +package() { >> + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer > > Cargo manifests can have multiple binaries and `cargo install` should install all of them with a single command I actually had it using `cargo install` originally, but I switched it because I thought this was clearer. I'll have to test the `--bin` flag for building only the binary instead of the whole workspace — I didn't know it existed.
<164518827356.985.10662536825307226642.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518796720.985.8093254361568311569.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer "S.M Mukarram Nainar" <theone@sm2n.ca> replied via email: ``` > On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: >> + >> +package() { >> + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer > > Cargo manifests can have multiple binaries and `cargo install` should install all of them with a single command I actually had it using `cargo install` originally, but I switched it because I thought this was clearer. I'll have to test the `--bin` flag for building only the binary instead of the whole workspace — I didn't know it existed. ``` -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216560
<164518829555.985.15335782312034367571.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518827356.985.10662536825307226642.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer they can, yes. i know how the cargo manifest works. this doesn't, though, and almost nothing i have ever touched does either, and even in projects with multiple bins they usually don't put them in one manifest (like whatever wezterm is doing). is there some issue with `install` on one file that will nuke everyones systems here, or? -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216562
<164518839930.985.5892343896783758662.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518829555.985.15335782312034367571.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer You can use `cargo build --frozen --release --manifest-path crates/rust-analyzer/Cargo.toml` in `build()` and `cargo install --frozen --offline --root="$pkgdir"/usr --path "$builddir"/crates/rust-analyzer` in `package()` -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216563
<164518844739.985.9778738080696215472.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518839930.985.5892343896783758662.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer @psykose as long as you want to ignore recommended way of installing stuff, then nothing is wrong -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216564
<164518852121.985.17498260226405281511.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
<164518844739.985.9778738080696215472.gitlab.31077.dfc5319443230b19df6e04b88a717295e5dadda0@listserv.local>
(view parent)
On Fri, 18 Feb 2022 07:25:07 -0500, S.M Mukarram Nainar wrote: > + > +package() { > + install -Dm755 "$pkgdir"/usr/bin target/release/rust-analyzer i will definitely ignore the recommended way of calling cp on a single file, thanks -- via https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/31077#note_216565