Packaging Rustlang

Jump to: navigation, search


How to package the Rust compiler for openSUSE Build Service.

Packaging the Rust compiler

Rust 1.54 and later

Process

  • Branch Clone rust and rust1.XX (the previous version)
 osc bco devel:languages:rust/rust1.79
 osc bco devel:languages:rust/rust
  • Create a new package of the next version in devel:languages:rust (i.e. rust1.55)
 osc mkpac home:USERNAME:branches:devel:languages:rust/rust1.80
  • Copy from the previous version, rust1.54.spec, rust1.54-rpmlintrc, README.suse-maint, ignore-Wstring-conversion.patch, _constraints, _service, rust.keyring
 cp rust1.79/{_constraints,ignore-Wstring-conversion.patch,_multibuild,\
    README.suse-maint,rust1.79-rpmlintrc,rust1.79.spec,rust.keyring,_service} rust1.80
  • Rename the files with versions to the new version
 mv rust1.79-rpmlintrc rust1.80-rpmlintrc
 mv rust1.79.spec rust1.80.spec
  • Edit the .spec to correct the versions at the header
 %global version_suffix 1.80
 %global version_current 1.80.0
 %global version_previous 1.79.0
 ...
 %define obsolete_rust_versioned() \
 Obsoletes:      %{1}1.79%{?2:-%{2}} \
 Obsoletes:      %{1}1.78%{?2:-%{2}} \
  • Check and set the required LLVM version requirement

Worth noting that this can be annoying to check. You need to go to https://github.com/rust-lang/rust/tree/master/src and then follow llvm-project. In that go to "llvm/utils/lit/lit/__init__.py" and check the version. Yes I am not kidding. LLVM does NOT put it's version anywhere else it's STUPID.

If the llvm version has changed, set:

 %global llvm_version 18 
  • Create Changelog

Copy the notes from https://raw.githubusercontent.com/rust-lang/rust/master/RELEASES.md omitting HTML tags.

 osc vc
  • Add the first set of files
 osc add  _constraints ignore-Wstring-conversion.patch _multibuild README.suse-maint rust1.80.changes rust1.80-rpmlintrc rust1.80.spec rust.keyring _service
  • Get sources
 osc service ra
  • Add source tars
 osc add *.tar.xz*
  • Build

Ensure you have sccache setup

 osc build
  • Check In
 osc ci
  • submit to d:l:r
 osc sr devel:languages:rust rust1.80
  • Update rust metapackage:

Make sure you cd out of the rust1.XX version folder first.

 osc bco devel:languages:rust rust

Update the .spec similar to the above

Update the change log copying the previous line and update version

 osc vc

Submit

 osc ci
 osc sr
  • Once accepted, forward to factory
 osc sr devel:languages:rust rust1.80 openSUSE:Factory
 osc sr devel:languages:rust rust openSUSE:Factory
  • Once it's all accepted, delete your branch prj

Why? Because this way when you branch next time you get the latest prj config and repos which have definitions for sccache and such.