{"id":15148726,"url":"https://github.com/semarie/build-rust","last_synced_at":"2025-08-31T11:50:05.928Z","repository":{"id":43537293,"uuid":"83135644","full_name":"semarie/build-rust","owner":"semarie","description":"Script helper for building rustc and cargo from source on OpenBSD (without rustup)","archived":false,"fork":false,"pushed_at":"2025-02-11T08:02:23.000Z","size":131,"stargazers_count":64,"open_issues_count":1,"forks_count":17,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-07-27T21:53:56.211Z","etag":null,"topics":["cargo","openbsd","rust"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/semarie.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-02-25T14:05:13.000Z","updated_at":"2025-06-28T14:48:10.000Z","dependencies_parsed_at":"2022-08-26T03:10:28.377Z","dependency_job_id":"b698bceb-35aa-40c3-8d8c-d6f5ef7a2517","html_url":"https://github.com/semarie/build-rust","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/semarie/build-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semarie%2Fbuild-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semarie%2Fbuild-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semarie%2Fbuild-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semarie%2Fbuild-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/semarie","download_url":"https://codeload.github.com/semarie/build-rust/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/semarie%2Fbuild-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272976975,"owners_count":25025043,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-31T02:00:09.071Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cargo","openbsd","rust"],"created_at":"2024-09-26T13:22:08.339Z","updated_at":"2025-08-31T11:50:00.887Z","avatar_url":"https://github.com/semarie.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# build-rust\n\nbuild-rust is a shell script for getting a Rust beta or nightly running on\nOpenBSD.\n\nThe script works by using the stable Rust from the OpenBSD package repo to\nbuild a beta Rust, then (if you want a nightly) it uses this beta Rust to build\na nightly Rust. It also deals with ensuring the right cargo version is used at\neach stage.\n\n## Quick Start\n\nFirst, choose a program to allow build-rust to be root. You usually want either\n`doas` or `sudo`. E.g.:\n\n```\necho \"SUDO=doas\" \u003e ~/.build_rust.conf\n```\n\nNext:\n\n```\n$ ./build.sh init\n```\n\nThis step uses the `SUDO` command you chose in the first step to install some\npackages. Please read the script to ensure you are happy with the commands that\nwill be run as root.\n\nNow run:\n```\n$ ./build.sh \u003ctarget\u003e\n```\n\nWhere `\u003ctarget\u003e` is either `beta` or `nightly`. If you choose `nightly` but\nhave not yet built  `beta`, then `beta` will be built first automatically.\n\nOnce this is done you will have a working Rust environment (including cargo) in\n`install_dir/\u003ctarget\u003e`. If you want this to be your default rustc and cargo,\nthen you probably want to add `install_dir/\u003ctarget\u003e/bin` to your `PATH` in your\nshell rc.\n\n## Why is the Installed Cargo Old?\n\nThe script uses the version of cargo indicated in upstream `src/stage0.txt`.\nThis is not necessarily the newest cargo, but is guaranteed to work for\nbootstrapping.\n\nIf you would like a newer cargo, you can either manually build one off the\nupstream master branch, or you can use the bootstrap cargo to install a new one\nin `~/.cargo/bin`:\n\n```\n$ cargo install cargo\n```\n\nIf you want that as your default cargo, don't forget to add it to the `PATH`.\n\n## Why do we Need this Script?\n\nWhy not just use `rustup`? In short, OpenBSD has tier 3 Rust support, meaning\nthat the Rust upstream does not make binaries available via `rustup`. There are\na couple of reasons for this.\n\n### Reason 1: Cross compiling.\n\nUnder normal circumstances, Rust upstream would cross compile beta and nightly\nRust on their Linux machines, making the resulting binaries available via\n`rustup`. However, OpenBSD has a modified linker meaning that targeting OpenBSD\nwith a cross compiler is not straightforward.\n\n### Reason 2: No Backward Compatibility\n\nOpenBSD makes no attempt to be backward compatible. At any given time there are\ntwo supported stable releases of OpenBSD, and a frequently regenerated\ndeveloper version called `-current`. Generally speaking, binaries from an older\nstable release do not run on a newer stable release. Furthermore, there is no\nguarantee that the binary built on last week's `-current` will work on this\nweek's. Compatibility breakage can occur not only at the library level, but\nalso at the ABI level.\n\nEven if the Rust upstream could cross compile to OpenBSD, it's not clear which\nversion's of OpenBSD would be useful to target.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemarie%2Fbuild-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsemarie%2Fbuild-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsemarie%2Fbuild-rust/lists"}