Parallel Rust Versions Roadmap

Jump to: navigation, search
Updating Rust to support parallel versions for openSUSE Build Service requirements.

Introduction

Today in Leap we are limited to Rust 1.43 due to the requirements of Firefox ESR. However, many other pieces of software that we wish to package may have other requirements for specific Rust versions, or may wish to use the latest available. Todays method of packaging Rust is not able to meet these as we can only provide a single Rust version at any one time.

Other languages such as Go have the capability to install the latest version with the named "go" package, or the ability to install a specific version with the package named "goX.Y" where "X.Y" is a version.

We should update Rust to be capable of this behaviour.

Use Cases

  • You are a developer, and want the latest version of Rust from zypper
  • You are a packager, and your software BuildRequires the latest version of Rust
  • You are a packager, and your software BuildRequires a specific version of Rust

Non-Use Cases

  • You are a developer, and want multiple parallel versions of Rust (this is already solved by rustup in a way better than we could provide via zypper)

Implementation

An example implementation can be found in firstyear's rust_versioned repository on OBS.

In this configuration there is a rust "meta package" that is requiring the latest version. Each version package then holds a single version of rust, and conflicts with the other versions of rust.

Test Cases

Install the raw parts

zypper in cargo1.52 rls1.52 rust1.52-gdb

result: rust1.52 should be installed

Install an older version and upgrade

zypper in cargo1.51 rls1.51 rust1.51-gdb
zypper dup

result: rust1.52 should NOT be upgraded to, due to the explicit install of rust1.51

Migration from current un-versioned rust to versioned

# Disable the rust_versioned repo
zypper in rust cargo rls rust-gdb
# Enable the rust_versioned repo
zypper ref --force
zypper dup

result: rust should upgrade cleanly to the versioned 1.52 package which can be verified with "rpm -qa | grep rust1.52"

Install of an older version, then the meta should conflict

zypper in cargo1.51 rls1.51 rust1.51-gdb
zypper in cargo rls rust-gdb rust

result: cargo/rust should NOT be installed and upgraded to 1.52 as this would violate the explicit 1.51 install. 1.51 must be de-installed manually first.

Persistence of Versions

A common question is "how many versions of Rust will be retained". This is a balance between administrative time and effort, resources to store and build Rust, potential bug and maintenance time and more.

The current considered plan is that for the latest version N, we retain version N-1. In exception cases versions may be persisted for longer if a specific BuildRequires exists IE Firefox ESR.

Today in Leap this would mean that we would attempt to have:

  • 1.43 (FF ESR Exception)
  • 1.51
  • 1.52