Skip to content
This repository has been archived by the owner on Nov 11, 2024. It is now read-only.

This project is where you fake your home registry for building your Rust projects.

License

Notifications You must be signed in to change notification settings

openSUSE-Rust/obs-service-cargo-vendor-home-registry

Repository files navigation

OBS Service Cargo Vendor Home Registry

Important

This project's logic and code has now been merged to obs-service-cargo as a new method for vendoring.

No further updates will be added here in the future and thus, it will be archived.

CI build result

A rewrite of the OBS Service Cargo Vendor.

The goals of this project are

  • reduce boilerplate code by more than 50%
  • use more idiomatic Rust code
  • handle error messages better

Why rewrite?

cargo vendor is sus so I decided to go with vendoring the cargo home registry $CARGO_HOME instead 😳

Project Structure

.
├── Cargo.lock
├── Cargo.toml
├── cargo_vendor_home_registry.service
├── CHANGELOG
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── CONTRIBUTORS.md
├── justfile
├── LICENCE
├── README.md
├── rustfmt.toml
└── src
    ├── audit.rs
    ├── cli.rs
    ├── lib.rs
    ├── main.rs
    └── opts.rs

2 directories, 16 files

Features

  • Allow custom root directory of the project if in case the "dumb" detection fails.
  • Allow option to set no root manifest. Packages such as s390-tools do not have a root manifest as it is a monorepo. It's not even a cargo workspace. However, users must manually add the path to the extra manifests if needed relative to project top-level directory.
  • Tag support. Like obs-service-cargo, we support tags so you can have multiple registry contexts. However, that I still yet to find any.
  • No need to set respect-lockfiles. Lockfiles are regenerated and shipped in the tarball. Therefore, updated lockfiles are also shipped without worrying if you have mismatching dependencies.

How to use in a specfile

A typical specfile looks like this


%prep
%autosetup -a1

%build
export CARGO_HOME=$PWD/.cargo
%{cargo_build}

%install
export CARGO_HOME=$PWD/.cargo
%{cargo_install}

%check
export CARGO_HOME=$PWD/.cargo
%{cargo_test}


Q&A

For questions and answers, you can head over to our Discussion page on GitHub.

About

This project is where you fake your home registry for building your Rust projects.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published