All Projects → semarie → build-rust

semarie / build-rust

Licence: other
Script helper for building rustc and cargo from source on OpenBSD (without rustup)

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to build-rust

gsmartcontrol
GSmartControl - Hard disk drive and SSD health inspection tool
Stars: ✭ 183 (+454.55%)
Mutual labels:  openbsd
rust-kernel-barebones
A minimal 64-bit rust kernel and a bunch of configuration scripts that can be used to bootstrap Operating system development using Nightly-Rust compiler.
Stars: ✭ 42 (+27.27%)
Mutual labels:  cargo
Awesome-BSD-Ports-Programs-And-Projects
A Repo Detailing BSD Ports, Programs, and Projects.
Stars: ✭ 46 (+39.39%)
Mutual labels:  openbsd
nix-template
Make creating nix expressions easy
Stars: ✭ 161 (+387.88%)
Mutual labels:  cargo
openbsd-server-setup
A collection of scripts to ease bootstrapping of a new OpenBSD server. Includes nginx with SSL, mail with DKIM, WireGuard and IKEv2 VPN setup.
Stars: ✭ 33 (+0%)
Mutual labels:  openbsd
pkg ping
Prints or writes the fastest OpenBSD mirror(s); or easily replace the mirror in /etc/installurl which went down.
Stars: ✭ 18 (-45.45%)
Mutual labels:  openbsd
oxbar
configurable X11 status bar for OpenBSD (and xstatbar successor)
Stars: ✭ 36 (+9.09%)
Mutual labels:  openbsd
dcos-k8s-rust-skaffold-demo
A demo of pipelining Rust application development to Kubernetes on DC/OS with Skaffold.
Stars: ✭ 40 (+21.21%)
Mutual labels:  cargo
cargo-valgrind
A cargo subcommand, that runs valgrind and displays its output in a helpful manner.
Stars: ✭ 66 (+100%)
Mutual labels:  cargo
cargo-msrv
🦀 Find the minimum supported Rust version (MSRV) for your project
Stars: ✭ 247 (+648.48%)
Mutual labels:  cargo
crates.nvim
A neovim plugin that helps managing crates.io dependencies
Stars: ✭ 252 (+663.64%)
Mutual labels:  cargo
www
my website built using Rust (stdweb) → .wasm (also: dat://ricky.codes)
Stars: ✭ 12 (-63.64%)
Mutual labels:  cargo
psutil
Cross-platform lib for process and system monitoring in Python
Stars: ✭ 8,488 (+25621.21%)
Mutual labels:  openbsd
GoRAT
GoRAT (Go Remote Access Tool) is an extremely powerful reverse shell, file server, and control plane using HTTPS reverse tunnels as a transport mechanism.
Stars: ✭ 34 (+3.03%)
Mutual labels:  openbsd
cargo-deny-action
❌ GitHub Action for cargo-deny 🦀
Stars: ✭ 45 (+36.36%)
Mutual labels:  cargo
cargo-release
Cargo subcommand `release`: everything about releasing a rust crate.
Stars: ✭ 854 (+2487.88%)
Mutual labels:  cargo
RustLabs
The Ultimate Workshop Track for #Rust Developer
Stars: ✭ 22 (-33.33%)
Mutual labels:  cargo
osutil
Go library to easily detect current operating system, current Linux distribution, macOS version and more...
Stars: ✭ 22 (-33.33%)
Mutual labels:  openbsd
cargo-esr
Extended Search & Ranking tool for crates.
Stars: ✭ 23 (-30.3%)
Mutual labels:  cargo
cargo-trim
Binary application to clean up .cargo/registry & .cargo/git cache
Stars: ✭ 15 (-54.55%)
Mutual labels:  cargo

build-rust

build-rust is a shell script for getting a Rust beta or nightly running on OpenBSD.

The script works by using the stable Rust from the OpenBSD package repo to build a beta Rust, then (if you want a nightly) it uses this beta Rust to build a nightly Rust. It also deals with ensuring the right cargo version is used at each stage.

Quick Start

First, choose a program to allow build-rust to be root. You usually want either doas or sudo. E.g.:

echo "SUDO=doas" > ~/.build_rust.conf

Next:

$ ./build.sh init

This step uses the SUDO command you chose in the first step to install some packages. Please read the script to ensure you are happy with the commands that will be run as root.

Now run:

$ ./build.sh <target>

Where <target> is either beta or nightly. If you choose nightly but have not yet built beta, then beta will be built first automatically.

Once this is done you will have a working Rust environment (including cargo) in install_dir/<target>. If you want this to be your default rustc and cargo, then you probably want to add install_dir/<target>/bin to your PATH in your shell rc.

Why is the Installed Cargo Old?

The script uses the version of cargo indicated in upstream src/stage0.txt. This is not necessarily the newest cargo, but is guaranteed to work for bootstrapping.

If you would like a newer cargo, you can either manually build one off the upstream master branch, or you can use the bootstrap cargo to install a new one in ~/.cargo/bin:

$ cargo install cargo

If you want that as your default cargo, don't forget to add it to the PATH.

Why do we Need this Script?

Why not just use rustup? In short, OpenBSD has tier 3 Rust support, meaning that the Rust upstream does not make binaries available via rustup. There are a couple of reasons for this.

Reason 1: Cross compiling.

Under normal circumstances, Rust upstream would cross compile beta and nightly Rust on their Linux machines, making the resulting binaries available via rustup. However, OpenBSD has a modified linker meaning that targeting OpenBSD with a cross compiler is not straightforward.

Reason 2: No Backward Compatibility

OpenBSD makes no attempt to be backward compatible. At any given time there are two supported stable releases of OpenBSD, and a frequently regenerated developer version called -current. Generally speaking, binaries from an older stable release do not run on a newer stable release. Furthermore, there is no guarantee that the binary built on last week's -current will work on this week's. Compatibility breakage can occur not only at the library level, but also at the ABI level.

Even if the Rust upstream could cross compile to OpenBSD, it's not clear which version's of OpenBSD would be useful to target.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].