[opensuse-factory] Building Rust Packages
From what I recall, network connections cannot be made from within the build service and this is an important part of how the "cargo build"
Hi there, I'm looking into adding several rust packages to OBS including xidlehook (https://github.com/jD91mZM2/xidlehook) and vivid (https://github.com/sharkdp/vivid). process in rust works. Is there any documentation for how to build rust packages in OBS that I can reference? Looking at the ripgrep package for inspiration (https://build.opensuse.org/package/view_file/openSUSE:Factory/ripgrep/ripgre...) it seems like you take a copy of the dependencies locally? Is this a purely manual process or are there some tools to help? Mike -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On nie, Apr 28, 2019 at 9:23 PM, Michael Aquilina <michaelaquilina@gmail.com> wrote:
Hi there,
I'm looking into adding several rust packages to OBS including xidlehook (https://github.com/jD91mZM2/xidlehook) and vivid (https://github.com/sharkdp/vivid).
From what I recall, network connections cannot be made from within the build service and this is an important part of how the "cargo build" process in rust works. Is there any documentation for how to build rust packages in OBS that I can reference?
Looking at the ripgrep package for inspiration (https://build.opensuse.org/package/view_file/openSUSE:Factory/ripgrep/ripgre...) it seems like you take a copy of the dependencies locally? Is this a purely manual process or are there some tools to help?
In theory this should be done through rust2rpm, but that doesn't really work in openSUSE because nobody had the time to review [1] (associated with [2]). Otherwise, there is a cargo-vendor package to gather everything required for the package. [1] https://github.com/openSUSE/post-build-checks/pull/25 [2] https://build.opensuse.org/project/show/devel:languages:rust:crates LCP [Stasiek] https://lcp.world -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 2019-04-28 21:23, Michael Aquilina wrote:
Hi there,
I'm looking into adding several rust packages to OBS including xidlehook (https://github.com/jD91mZM2/xidlehook) and vivid (https://github.com/sharkdp/vivid).
From what I recall, network connections cannot be made from within the build service and this is an important part of how the "cargo build" process in rust works. Is there any documentation for how to build rust packages in OBS that I can reference?
Looking at the ripgrep package for inspiration (https://build.opensuse.org/package/view_file/openSUSE:Factory/ripgrep/ripgre...) it seems like you take a copy of the dependencies locally? Is this a purely manual process or are there some tools to help?
Mike
I recently packaged pijul [1] and also mostly copied the ripgrep spec [2]. Getting the dependencies is indeed a pain right now. As Stasiek Michalski wrote, you need the cargo-vendor package. Either get it from the official repositories or crates.io. Here is how I do it currently: curl -L https://crates.io/api/v1/crates/pijul/0.12.0/download -o pijul-0.12.0.tar.gz gunzip pijul-0.12.0.tar.gz cd pijul-0.12.0 cargo vendor --relative-path tar cfJ vendor.tar.xz vendor cp vendor.tar.xz .. You could build a script around this. Cheers [1] https://pijul.org/ [2] https://build.opensuse.org/package/view_file/home:cney/pijul/pijul.spec -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
cargo vendor seems like exactly what I was looking for. Thanks for this :) On Mon, Apr 29, 2019 at 11:42 AM Christian Neyers <neyers@geod.uni-bonn.de> wrote:
On 2019-04-28 21:23, Michael Aquilina wrote:
Hi there,
I'm looking into adding several rust packages to OBS including xidlehook (https://github.com/jD91mZM2/xidlehook) and vivid (https://github.com/sharkdp/vivid).
From what I recall, network connections cannot be made from within the build service and this is an important part of how the "cargo build" process in rust works. Is there any documentation for how to build rust packages in OBS that I can reference?
Looking at the ripgrep package for inspiration (https://build.opensuse.org/package/view_file/openSUSE:Factory/ripgrep/ripgre...) it seems like you take a copy of the dependencies locally? Is this a purely manual process or are there some tools to help?
Mike
I recently packaged pijul [1] and also mostly copied the ripgrep spec [2].
Getting the dependencies is indeed a pain right now. As Stasiek Michalski wrote, you need the cargo-vendor package. Either get it from the official repositories or crates.io.
Here is how I do it currently:
curl -L https://crates.io/api/v1/crates/pijul/0.12.0/download -o pijul-0.12.0.tar.gz gunzip pijul-0.12.0.tar.gz cd pijul-0.12.0 cargo vendor --relative-path tar cfJ vendor.tar.xz vendor cp vendor.tar.xz ..
You could build a script around this.
Cheers
[1] https://pijul.org/ [2] https://build.opensuse.org/package/view_file/home:cney/pijul/pijul.spec -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
-- Michael Aquilina -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (3)
-
Christian Neyers
-
Michael Aquilina
-
Stasiek Michalski