From b44fed05cae814aad46ce8047463267e8353bc01 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Sun, 22 Feb 2026 15:36:18 +0800 Subject: [PATCH 01/20] docs: Updated docs - Update README.md to adapt the rust9x - Remove INSTALL.md and CODE_OF_CONDUCT.md to remove the unnessary docs --- CODE_OF_CONDUCT.md | 3 - INSTALL.md | 310 --------------------------------------------- README.md | 89 +++++++++---- 3 files changed, 61 insertions(+), 341 deletions(-) delete mode 100644 CODE_OF_CONDUCT.md delete mode 100644 INSTALL.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md deleted file mode 100644 index e3708bc485399..0000000000000 --- a/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,3 +0,0 @@ -# The Rust Code of Conduct - -The Code of Conduct for this repository [can be found online](https://www.rust-lang.org/conduct.html). diff --git a/INSTALL.md b/INSTALL.md deleted file mode 100644 index 98eb825cd10f6..0000000000000 --- a/INSTALL.md +++ /dev/null @@ -1,310 +0,0 @@ -# Installing from Source - -**Note: This document describes _building_ Rust _from source_. -This is _not recommended_ if you don't know what you're doing. -If you just want to install Rust, check out the [README.md](README.md) instead.** - -The Rust build system uses a Python script called `x.py` to build the compiler, -which manages the bootstrapping process. It lives at the root of the project. -It also uses a file named `bootstrap.toml` to determine various configuration -settings for the build. You can see a full list of options in -`bootstrap.example.toml`. - -The `x.py` command can be run directly on most Unix systems in the following -format: - -```sh -./x.py [flags] -``` - -This is how the documentation and examples assume you are running `x.py`. -See the [rustc dev guide][rustcguidebuild] if this does not work on your -platform. - -More information about `x.py` can be found by running it with the `--help` flag -or reading the [rustc dev guide][rustcguidebuild]. - -[gettingstarted]: https://rustc-dev-guide.rust-lang.org/getting-started.html -[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html#what-is-xpy - -## Dependencies - -Make sure you have installed the dependencies: - -* `python` 3 or 2.7 -* `git` -* A C compiler (when building for the host, `cc` is enough; cross-compiling may - need additional compilers) -* `curl` (not needed on Windows) -* `pkg-config` if you are compiling on Linux and targeting Linux -* `libiconv` (already included with glibc on Debian-based distros) - -To build Cargo, you'll also need OpenSSL (`libssl-dev` or `openssl-devel` on -most Unix distros). - -If building LLVM from source, you'll need additional tools: - -* `g++`, `clang++`, or MSVC with versions listed on - [LLVM's documentation](https://llvm.org/docs/GettingStarted.html#host-c-toolchain-both-compiler-and-standard-library) -* `ninja`, or GNU `make` 3.81 or later (Ninja is recommended, especially on - Windows) -* `cmake` version listed on [LLVM's documentation](https://llvm.org/docs/GettingStarted.html#software) -* `libstdc++-static` may be required on some Linux distributions such as Fedora - and Ubuntu - -On tier 1 or tier 2 with host tools platforms, you can also choose to download -LLVM by setting `llvm.download-ci-llvm = true`. -Otherwise, you'll need LLVM installed and `llvm-config` in your path. -See [the rustc-dev-guide for more info][sysllvm]. - -[sysllvm]: https://rustc-dev-guide.rust-lang.org/building/new-target.html#using-pre-built-llvm - - -## Building on a Unix-like system - -### Build steps - -1. Clone the [source] with `git`: - - ```sh - git clone https://github.com/rust-lang/rust.git - cd rust - ``` - -[source]: https://github.com/rust-lang/rust - -2. Configure the build settings: - - If you're unsure which build configurations to use and need a good default, you - can run the interactive `x.py setup` command. This will guide you through selecting - a config profile, setting up the LSP, configuring a Git hook, etc. - - With `configure` script, you can handle multiple configurations in a single - command which is useful to create complex/advanced config files. For example: - - ```sh - ./configure --build=aarch64-unknown-linux-gnu \ - --enable-full-tools \ - --enable-profiler \ - --enable-sanitizers \ - --enable-compiler-docs \ - --set target.aarch64-unknown-linux-gnu.linker=clang \ - --set target.aarch64-unknown-linux-gnu.ar=/rustroot/bin/llvm-ar \ - --set target.aarch64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \ - --set llvm.link-shared=true \ - --set llvm.thin-lto=true \ - --set llvm.libzstd=true \ - --set llvm.ninja=false \ - --set rust.debug-assertions=false \ - --set rust.jemalloc \ - --set rust.use-lld=true \ - --set rust.lto=thin \ - --set rust.codegen-units=1 - ``` - - If you plan to use `x.py install` to create an installation, you can either - set `DESTDIR` environment variable to your custom directory path: - - ```bash - export DESTDIR= - ``` - - or set `prefix` and `sysconfdir` in the `[install]` section to your custom - directory path: - - ```sh - ./configure --set install.prefix= --set install.sysconfdir= - ``` - - When the `DESTDIR` environment variable is present, the `prefix` and - `sysconfdir` values are combined with the path from the `DESTDIR` - environment variable. - -3. Build and install: - - ```sh - ./x.py build && ./x.py install - ``` - - When complete, `./x.py install` will place several programs into - `$PREFIX/bin`: `rustc`, the Rust compiler, and `rustdoc`, the - API-documentation tool. By default, it will also include [Cargo], Rust's - package manager. You can disable this behavior by passing - `--set build.extended=false` to `./configure`. - -[Cargo]: https://github.com/rust-lang/cargo - -### Configure and Make - -This project provides a configure script and makefile (the latter of which just -invokes `x.py`). `./configure` is the recommended way to programmatically -generate a `bootstrap.toml`. `make` is not recommended (we suggest using `x.py` -directly), but it is supported and we try not to break it unnecessarily. - -```sh -./configure -make && sudo make install -``` - -`configure` generates a `bootstrap.toml` which can also be used with normal `x.py` -invocations. - -## Building on Windows - -On Windows, we suggest using [winget] to install dependencies by running the -following in a terminal: - -```powershell -winget install -e Python.Python.3 -winget install -e Kitware.CMake -winget install -e Git.Git -``` - -Then edit your system's `PATH` variable and add: `C:\Program Files\CMake\bin`. -See -[this guide on editing the system `PATH`](https://www.java.com/en/download/help/path.html) -from the Java documentation. - -[winget]: https://github.com/microsoft/winget-cli - -There are two prominent ABIs in use on Windows: the native (MSVC) ABI used by -Visual Studio and the GNU ABI used by the GCC toolchain. Which version of Rust -you need depends largely on what C/C++ libraries you want to interoperate with. -Use the MSVC build of Rust to interop with software produced by Visual Studio -and the GNU build to interop with GNU software built using the MinGW/MSYS2 -toolchain. - -### MinGW - -[MSYS2][msys2] can be used to easily build Rust on Windows: - -[msys2]: https://www.msys2.org/ - -1. Download the latest [MSYS2 installer][msys2] and go through the installer. - -2. Download and install [Git for Windows](https://git-scm.com/download/win). - Make sure that it's in your Windows PATH. To enable access to it from within - MSYS2, edit the relevant `mingw[32|64].ini` file in your MSYS2 installation - directory and uncomment the line `MSYS2_PATH_TYPE=inherit`. - - You could install and use MSYS2's version of git instead with `pacman`, - however this is not recommended as it's excruciatingly slow, and not frequently - tested for compatibility. - -3. Start a MINGW64 or MINGW32 shell (depending on whether you want 32-bit - or 64-bit Rust) either from your start menu, or by running `mingw64.exe` - or `mingw32.exe` from your MSYS2 installation directory (e.g. `C:\msys64`). - -4. From this terminal, install the required tools: - - ```sh - # Update package mirrors (may be needed if you have a fresh install of MSYS2) - pacman -Sy pacman-mirrors - - # Install build tools needed for Rust. If you're building a 32-bit compiler, - # then replace "x86_64" below with "i686". - # Note that it is important that you do **not** use the 'python2', 'cmake', - # and 'ninja' packages from the 'msys2' subsystem. - # The build has historically been known to fail with these packages. - pacman -S make \ - diffutils \ - tar \ - mingw-w64-x86_64-python \ - mingw-w64-x86_64-cmake \ - mingw-w64-x86_64-gcc \ - mingw-w64-x86_64-ninja - ``` - -5. Navigate to Rust's source code (or clone it), then build it: - - ```sh - python x.py setup dist && python x.py build && python x.py install - ``` - -If you want to try the native Windows versions of Python or CMake, you can remove -them from the above pacman command and install them from another source. Follow -the instructions in step 2 to get them on PATH. - -Using Windows native Python can be helpful if you get errors when building LLVM. -You may also want to use Git for Windows, as it is often *much* faster. Turning -off real-time protection in the Windows Virus & Threat protections settings can -also help with long run times (although note that it will automatically turn -itself back on after some time). - -### MSVC - -MSVC builds of Rust additionally requires an installation of: - -- Visual Studio 2022 (or later) build tools so `rustc` can use its linker. Older - Visual Studio versions such as 2019 *may* work but aren't actively tested. -- A recent Windows 10 or 11 SDK. - -The simplest way is to get [Visual Studio], check the "C++ build tools". - -[Visual Studio]: https://visualstudio.microsoft.com/downloads/ - -(If you're installing CMake yourself, be careful that "C++ CMake tools for -Windows" doesn't get included under "Individual components".) - -With these dependencies installed, you can build the compiler in a `cmd.exe` -shell with: - -```sh -python x.py setup user -python x.py build -``` - -Right now, building Rust only works with some known versions of Visual Studio. -If you have a more recent version installed and the build system doesn't -understand, you may need to force bootstrap to use an older version. -This can be done by manually calling the appropriate vcvars file before running -the bootstrap. - -```batch -CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat" -python x.py build -``` - -### Specifying an ABI - -Each specific ABI can also be used from either environment (for example, using -the GNU ABI in PowerShell) by using an explicit build triple. The available -Windows build triples are: -- GNU ABI (using GCC) - - `i686-pc-windows-gnu` - - `x86_64-pc-windows-gnu` -- The MSVC ABI - - `i686-pc-windows-msvc` - - `x86_64-pc-windows-msvc` - -The build triple can be specified by either specifying `--build=` when -invoking `x.py` commands, or by creating a `bootstrap.toml` file (as described in -[Building on a Unix-like system](#building-on-a-unix-like-system)), and passing -`--set build.build=` to `./configure`. - -## Building Documentation - -If you'd like to build the documentation, it's almost the same: - -```sh -./x.py doc -``` - -The generated documentation will appear under `doc` in the `build` directory for -the ABI used. That is, if the ABI was `x86_64-pc-windows-msvc`, the directory -will be `build\x86_64-pc-windows-msvc\doc`. - -## Notes - -Since the Rust compiler is written in Rust, it must be built by a precompiled -"snapshot" version of itself (made in an earlier stage of development). -As such, source builds require an Internet connection to fetch snapshots, and an -OS that can execute the available snapshot binaries. - -See https://doc.rust-lang.org/nightly/rustc/platform-support.html for a list of -supported platforms. -Only "host tools" platforms have a pre-compiled snapshot binary available; to -compile for a platform without host tools you must cross-compile. - -You may find that other platforms work, but these are our officially supported -build environments that are most likely to work. diff --git a/README.md b/README.md index 611260470f12b..020ba0aa860d0 100644 --- a/README.md +++ b/README.md @@ -6,53 +6,82 @@ src="https://raw.githubusercontent.com/rust-lang/www.rust-lang.org/master/static/images/rust-social-wide-light.svg" width="50%"> - -[Website][Rust] | [Getting started] | [Learn] | [Documentation] | [Contributing] -This is the main source code repository for [Rust]. It contains the compiler, +This is the main source code repository for [Rust9x]. It contains the compiler, standard library, and documentation. -[Rust]: https://www.rust-lang.org/ -[Getting Started]: https://www.rust-lang.org/learn/get-started -[Learn]: https://www.rust-lang.org/learn -[Documentation]: https://www.rust-lang.org/learn#learn-use -[Contributing]: CONTRIBUTING.md - -## Why Rust? - -- **Performance:** Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrated with other languages. +Note that this project can not only used on Windows 10 and 11, but also on Windows 7, XP, even +Windows 2000, 98 and 95 -- **Reliability:** Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time. +# Links -- **Productivity:** Comprehensive documentation, a compiler committed to providing great diagnostics, and advanced tooling including package manager and build tool ([Cargo]), auto-formatter ([rustfmt]), linter ([Clippy]) and editor support ([rust-analyzer]). +## Official [Cargo]: https://github.com/rust-lang/cargo [rustfmt]: https://github.com/rust-lang/rustfmt [Clippy]: https://github.com/rust-lang/rust-clippy [rust-analyzer]: https://github.com/rust-lang/rust-analyzer -## Quick Start +## Rust9x +[Wiki]: https://github.com/rust9x/rust/wiki + +# Build + +If you want to build this source by yourself, you can follow [this instructions](https://github.com/rust9x/rust/wiki#installation) and set up your target. + +# Install + +If you think build this source is so sucks, perhaps you can follow this: + +1. Download the latest release + +View [here](https://github.com/zhangxuan/rust9x/releases/latest) and choose the best platform for you. + +If you don't know how to choose, you can click [here](#choose-the-platform) -Read ["Installation"] from [The Book]. +## Choose the platform -["Installation"]: https://doc.rust-lang.org/book/ch01-01-installation.html -[The Book]: https://doc.rust-lang.org/book/index.html +When you visited the release page, you might see these assets: +- `rust9x-toolchain--x86_64-windows.tar.gz` +- `rust9x-toolchain--i686-windows.tar.gz` +- `rust9x-toolchain--i586-windows.tar.gz` -## Installing from Source +For each assets has its own platform, you can choose the one that fits the target system. -If you really want to install from source (though this is not recommended), see -[INSTALL.md](INSTALL.md). +### x86_64 Windows -## Getting Help +File name: `rust9x-toolchain--x86_64-windows.tar.gz` -See https://www.rust-lang.org/community for a list of chat platforms and forums. +Support targets: +- Windows 10 and 11 +- x86_64 systems (simply called "64-bit systems") -## Contributing +### i686 Windows -See [CONTRIBUTING.md](CONTRIBUTING.md). +File name: `rust9x-toolchain--i686-windows.tar.gz` -## License +Support targets: +- Windows 7 and XP +- i686 systems (simply called "32-bit systems") + +### i586 Windows + +File name: `rust9x-toolchain--i586-windows.tar.gz` + +Support targets: +- Windows 2000, Windows 9x and older +- i586 systems (simply called "16-bit systems") + +For more information, please visit [here](https://github.com/rust9x/rust/wiki#installation) + +# Contributing + +Thanks for your interest in contributing to this project! + +If you want to know more, perhaps you can see [CONTRIBUTING.md](CONTRIBUTING.md) for more details. + +# License Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like @@ -61,7 +90,11 @@ licenses. See [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and [COPYRIGHT](COPYRIGHT) for details. -## Trademark +# The Rust Code of Conduct + +The Code of Conduct for this repository can be found [here](https://www.rust-lang.org/conduct.html). + +# Trademark [The Rust Foundation][rust-foundation] owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks"). @@ -74,4 +107,4 @@ Third-party logos may be subject to third-party copyrights and trademarks. See [rust-foundation]: https://rustfoundation.org/ [trademark-policy]: https://rustfoundation.org/policy/rust-trademark-policy/ -[policies-licenses]: https://www.rust-lang.org/policies/licenses +[policies-licenses]: https://www.rust-lang.org/policies/licenses \ No newline at end of file From 045255cb45ba207fc37fed271cf2f75e4d1b146c Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Sun, 22 Feb 2026 15:39:07 +0800 Subject: [PATCH 02/20] refactor(bootstrap): Updated bootstrap - Added some comments of the bootstrap - Enabled some extended tools - Enabled incremental build --- bootstrap.rust9x.toml | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/bootstrap.rust9x.toml b/bootstrap.rust9x.toml index c57817af878a3..e4f11d16b1475 100644 --- a/bootstrap.rust9x.toml +++ b/bootstrap.rust9x.toml @@ -6,7 +6,7 @@ change-id = 148795 # Will download LLVM from CI if available on your platform. download-ci-llvm = true # NOTE: if you set ↑ to false, disable other LLVM targets to save lots of build time! -# targets = "X86" +targets = "X86" # experimental-targets = "" [build] @@ -17,22 +17,16 @@ target = [ "x86_64-rust9x-windows-msvc", "x86_64-pc-windows-msvc", ] - +# The docs is unnessary to build, because it's as same as the official one docs = false -# extended = true -# tools = [ -# # "cargo", -# # "clippy", -# "rustdoc", -# # "rustfmt", -# # "rust-analyzer", -# # "rust-analyzer-proc-macro-srv", -# # "analysis", -# "src", -# # "wasm-component-ld", -# # "miri", "cargo-miri" # for dev/nightly channels -# ] +# We want the extended tools +extended = true +tools = [ + "cargo", + "rustdoc", + "src", +] [install] # for creating a downloadable package: python x.py install, then create and archive this @@ -46,7 +40,7 @@ dist-src = false # you can override this with -i/--incremental # incremental = false -# incremental = true +incremental = true [dist] src-tarball = false From b4eb5f920b7e323698b11b1adb99250ef9da2757 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Sun, 22 Feb 2026 15:40:59 +0800 Subject: [PATCH 03/20] fix(bootstrap): Fixed encoding issue - Uses UTF-8 always to read config file - Friendly in Chinese/otherlang PC [including me :) ] --- src/bootstrap/bootstrap.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bootstrap/bootstrap.py b/src/bootstrap/bootstrap.py index 4dd465edb0df9..1455a47b1ccdf 100644 --- a/src/bootstrap/bootstrap.py +++ b/src/bootstrap/bootstrap.py @@ -1316,7 +1316,7 @@ def bootstrap(args): # Give a hard error if `--config` or `RUST_BOOTSTRAP_CONFIG` are set to a missing path, # but not if `bootstrap.toml` hasn't been created. if not using_default_path or os.path.exists(toml_path): - with open(toml_path) as config: + with open(toml_path, encoding="utf-8") as config: config_toml = config.read() else: config_toml = "" From cda3e5172cc307a3437a263112fcbc0f7e299d05 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Sun, 22 Feb 2026 15:43:18 +0800 Subject: [PATCH 04/20] ci: Added auto-build workflow --- .github/workflows/build-target.yml | 88 ++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 .github/workflows/build-target.yml diff --git a/.github/workflows/build-target.yml b/.github/workflows/build-target.yml new file mode 100644 index 0000000000000..d114157623185 --- /dev/null +++ b/.github/workflows/build-target.yml @@ -0,0 +1,88 @@ +# This workflow will build the current toolchain automatically, and +# push it into release. +# +# It will also built-in an install script, which can scan it as a rustup toolchain, so +# that we can manage them easily. +# +# If we can, we will add multiple platform support (e.g. Windows, macOS, Linux) +# so that you can do cross-compile by using this toolchain. +# +# Workflow file by "zhangxuan2011 " + +name: Build Target Toolchain + +on: + push: + tags: + - "v*" + workflow_dispatch: + +permissions: + contents: write + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + # Windows, x86_64 + - os: windows-latest + arch: x64 + target: x86_64-pc-windows-msvc + target_short: x86_64-windows + + # Windows, i686 + - os: windows-latest + arch: x86 + target: i686-pc-windows-msvc + target_short: i686-windows + + # Windows, i586 + - os: windows-latest + arch: x86 + target: i586-pc-windows-msvc + target_short: i586-windows + + defaults: + run: + shell: cmd + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + + - name: Install NASM + run: choco install nasm -y + + - name: Activate MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + + - name: Build toolchain + run: | + python x.py install --config bootstrap.rust9x.toml + if %errorlevel% neq 0 exit /b 1 + + - name: Pack toolchain + run: | + set VERSION=${{ github.ref_name }} + set ARCHIVE_NAME=rust9x-toolchain-%VERSION%-${{ matrix.target_short }}.tar.gz + + :: Check build folder + if not exist "build" ( + echo Error: build directory not found + exit /b 1 + ) + + :: Pack everything inside build + tar -czvf "%ARCHIVE_NAME%" -C dist/rust9x + + - name: Upload to release + uses: softprops/action-gh-release@v2 + with: + files: rust9x-toolchain-*.tar.gz From b011bfc5449fb82b0c7503093b9f3284f753dcd6 Mon Sep 17 00:00:00 2001 From: zhangxuan <114813512+zhangxuan2011@users.noreply.github.com> Date: Sun, 22 Feb 2026 16:15:37 +0800 Subject: [PATCH 05/20] chore: Removed submodules recursive (because bootstrap will do!) --- .github/workflows/build-target.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-target.yml b/.github/workflows/build-target.yml index d114157623185..7e4aac63b7e87 100644 --- a/.github/workflows/build-target.yml +++ b/.github/workflows/build-target.yml @@ -53,7 +53,7 @@ jobs: - uses: actions/checkout@v4 with: fetch-depth: 0 - submodules: recursive + submodules: false - name: Install NASM run: choco install nasm -y From 6ef9b9afdc79f6c21eac52d791f1224d7354f0e6 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Sun, 22 Feb 2026 15:54:02 +0800 Subject: [PATCH 06/20] fix(config): Fixed some error of bootstrap cfg --- bootstrap.rust9x.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap.rust9x.toml b/bootstrap.rust9x.toml index e4f11d16b1475..e8b52011165d2 100644 --- a/bootstrap.rust9x.toml +++ b/bootstrap.rust9x.toml @@ -6,7 +6,7 @@ change-id = 148795 # Will download LLVM from CI if available on your platform. download-ci-llvm = true # NOTE: if you set ↑ to false, disable other LLVM targets to save lots of build time! -targets = "X86" +# targets = "X86" # experimental-targets = "" [build] @@ -30,7 +30,7 @@ tools = [ [install] # for creating a downloadable package: python x.py install, then create and archive this -prefix = "../dist/rust9x" +prefix = "dist/rust9x" sysconfdir = "." [rust] From b4367a8a46ac0a1be0781fa203deffce18d51f1f Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Sun, 22 Feb 2026 18:09:53 +0800 Subject: [PATCH 07/20] ci(build-target): Add a upstream in building repo - Added a upstream after check out --- .github/workflows/build-target.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build-target.yml b/.github/workflows/build-target.yml index 7e4aac63b7e87..e1426973e4e64 100644 --- a/.github/workflows/build-target.yml +++ b/.github/workflows/build-target.yml @@ -55,6 +55,9 @@ jobs: fetch-depth: 0 submodules: false + - name: Set up upstream + run: git remote add upstream https://github.com/rust-lang/rust.git + - name: Install NASM run: choco install nasm -y From 76549193cd9b71691835d1b00f9d65eb9e8d2967 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Sun, 22 Feb 2026 18:19:10 +0800 Subject: [PATCH 08/20] chore(ci): :fire: Removed unnessary workflows - Removed 3 workflows which is from official repo, they are unuseful --- .github/workflows/ghcr.yml | 75 -------------------------------- .github/workflows/post-merge.yml | 53 ---------------------- 2 files changed, 128 deletions(-) delete mode 100644 .github/workflows/ghcr.yml delete mode 100644 .github/workflows/post-merge.yml diff --git a/.github/workflows/ghcr.yml b/.github/workflows/ghcr.yml deleted file mode 100644 index a89867efe666b..0000000000000 --- a/.github/workflows/ghcr.yml +++ /dev/null @@ -1,75 +0,0 @@ -# Mirror DockerHub images used by the Rust project to ghcr.io. -# Images are available at https://github.com/orgs/rust-lang/packages. -# -# In some CI jobs, we pull images from ghcr.io instead of Docker Hub because -# Docker Hub has a rate limit, while ghcr.io doesn't. -# Those images are pushed to ghcr.io by this job. -# -# While Docker Hub rate limit *shouldn't* be an issue on GitHub Actions, -# it certainly is for AWS codebuild. -# -# Note that authenticating to DockerHub or other registries isn't possible -# for PR jobs, because forks can't access secrets. -# That's why we use ghcr.io: it has no rate limit and it doesn't require authentication. - -name: GHCR image mirroring - -on: - workflow_dispatch: - schedule: - # Run daily at midnight UTC - - cron: '0 0 * * *' - -jobs: - mirror: - name: DockerHub mirror - runs-on: ubuntu-24.04 - if: github.repository == 'rust-lang/rust' - permissions: - # Needed to write to the ghcr.io registry - packages: write - steps: - - uses: actions/checkout@v5 - with: - persist-credentials: false - - - name: Log in to registry - run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin - - # Download crane in the current directory. - # We use crane because it copies the docker image for all the architectures available in - # DockerHub for the image. - # Learn more about crane at - # https://github.com/google/go-containerregistry/blob/main/cmd/crane/README.md - - name: Download crane - run: | - curl -sL "https://github.com/google/go-containerregistry/releases/download/${VERSION}/go-containerregistry_${OS}_${ARCH}.tar.gz" | tar -xzf - - env: - VERSION: v0.20.2 - OS: Linux - ARCH: x86_64 - - - name: Mirror DockerHub - run: | - # List of DockerHub images to mirror to ghcr.io - images=( - # Mirrored because used by the tidy job, which doesn't cache Docker images - "ubuntu:22.04" - # Mirrored because used by all linux CI jobs, including tidy - "moby/buildkit:buildx-stable-1" - # Mirrored because used when CI is running inside a Docker container - "alpine:3.4" - # Mirrored because used by dist-x86_64-linux - "centos:7" - ) - - # Mirror each image from DockerHub to ghcr.io - for img in "${images[@]}"; do - echo "Mirroring ${img}..." - # Remove namespace from the image if any. - # E.g. "moby/buildkit:buildx-stable-1" becomes "buildkit:buildx-stable-1" - dest_image=$(echo "${img}" | cut -d'/' -f2-) - ./crane copy \ - "docker.io/${img}" \ - "ghcr.io/${{ github.repository_owner }}/${dest_image}" - done diff --git a/.github/workflows/post-merge.yml b/.github/workflows/post-merge.yml deleted file mode 100644 index d38cc0e8a17f3..0000000000000 --- a/.github/workflows/post-merge.yml +++ /dev/null @@ -1,53 +0,0 @@ -# Workflow that runs after a merge to the default branch, analyses changes in test executions -# and posts the result to the merged PR. - -name: Post merge analysis - -on: - push: - branches: - - main - -jobs: - analysis: - runs-on: ubuntu-24.04 - if: github.repository == 'rust-lang/rust' - permissions: - pull-requests: write - steps: - - uses: actions/checkout@v5 - with: - # Make sure that we have enough commits to find the parent merge commit. - # Since all merges should be through merge commits, fetching two commits - # should be enough to get the parent bors merge commit. - fetch-depth: 2 - - name: Perform analysis and send PR - env: - GH_TOKEN: ${{ github.token }} - run: | - # Give GitHub some time to propagate the information that the PR was merged - sleep 60 - - # Get closest bors merge commit - PARENT_COMMIT=`git rev-list --author='bors ' -n1 --first-parent HEAD^1` - echo "Parent: ${PARENT_COMMIT}" - - # Find PR for the current commit - HEAD_PR=`gh pr list --search "${{ github.sha }}" --state merged --json number --jq '.[0].number'` - if [ -z "${HEAD_PR}" ]; then - echo "PR for commit SHA ${{ github.sha }} not found, exiting" - exit 1 - fi - echo "HEAD: ${{ github.sha }} (#${HEAD_PR})" - - cd src/ci/citool - - printf "
\nWhat is this?\n" >> output.log - printf "This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.\n" >> output.log - printf "
\n\n" >> output.log - - cargo run --release post-merge-report ${PARENT_COMMIT} ${{ github.sha }} >> output.log - - cat output.log - - gh pr comment ${HEAD_PR} -F output.log From 5db6b1ac97d8c49783853f6acf3a9a4717777af7 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Mon, 23 Feb 2026 05:04:50 +0800 Subject: [PATCH 09/20] fix(build-target): :ambulance: Fixed the issue about "build failed" - Set the `GITHUB_ACTIONS` to none to avoid bootstrap get wrong commit hash - Added `CARGO_TERM_COLOR`, which is `always` --- .github/workflows/build-target.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-target.yml b/.github/workflows/build-target.yml index e1426973e4e64..7c5a60d97bb5e 100644 --- a/.github/workflows/build-target.yml +++ b/.github/workflows/build-target.yml @@ -20,6 +20,9 @@ on: permissions: contents: write +env: + CARGO_TERM_COLOR: always + jobs: build: runs-on: ${{ matrix.os }} @@ -67,8 +70,15 @@ jobs: arch: ${{ matrix.arch }} - name: Build toolchain + env: + # If this env exists, the commit hash is wrong and just return 404. + GITHUB_ACTIONS: run: | - python x.py install --config bootstrap.rust9x.toml + :: Avoid failed to unset + set GITHUB_ACTIONS= + + :: Build & install in dist/rust9x + python x.py install --config bootstrap.rust9x.toml --stage 2 if %errorlevel% neq 0 exit /b 1 - name: Pack toolchain From ac75b6321ed96fabba356f810e1043c7a928ac57 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Mon, 23 Feb 2026 14:27:17 +0800 Subject: [PATCH 10/20] fix(build-target): :green_heart: Fixed the packing issue - Specified the packing dir - Removed the check of `build` directory --- .github/workflows/build-target.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/build-target.yml b/.github/workflows/build-target.yml index 7c5a60d97bb5e..8d41977d57539 100644 --- a/.github/workflows/build-target.yml +++ b/.github/workflows/build-target.yml @@ -86,14 +86,8 @@ jobs: set VERSION=${{ github.ref_name }} set ARCHIVE_NAME=rust9x-toolchain-%VERSION%-${{ matrix.target_short }}.tar.gz - :: Check build folder - if not exist "build" ( - echo Error: build directory not found - exit /b 1 - ) - :: Pack everything inside build - tar -czvf "%ARCHIVE_NAME%" -C dist/rust9x + tar -czvf "%ARCHIVE_NAME%" -C dist/rust9x . - name: Upload to release uses: softprops/action-gh-release@v2 From 141cf5c786b277e1145633f40565507b5a203ff7 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Mon, 23 Feb 2026 15:51:29 +0800 Subject: [PATCH 11/20] chore: :zap: Optimized the bootstrap docs to approve the build-time - Removed the `rustdoc`, because the official one provided. - Use `rustfmt` instead of `rustdoc` - Disable building `llvm-tools`. --- bootstrap.rust9x.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bootstrap.rust9x.toml b/bootstrap.rust9x.toml index e8b52011165d2..698f201ab85f6 100644 --- a/bootstrap.rust9x.toml +++ b/bootstrap.rust9x.toml @@ -17,6 +17,7 @@ target = [ "x86_64-rust9x-windows-msvc", "x86_64-pc-windows-msvc", ] + # The docs is unnessary to build, because it's as same as the official one docs = false @@ -24,8 +25,7 @@ docs = false extended = true tools = [ "cargo", - "rustdoc", - "src", + "rustfmt" ] [install] @@ -37,6 +37,7 @@ sysconfdir = "." # enable rust-lld.exe so we don't need editbin.exe lld = true dist-src = false +llvm-tools = false # you can override this with -i/--incremental # incremental = false From 2e6cde5834a9b02d1c58ae082939b1a880b52e4e Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Mon, 23 Feb 2026 15:57:19 +0800 Subject: [PATCH 12/20] refactor(ci): Changed the workflow filename - Uses `build-toolchain` instead of `build-target` - Changed name to `Build Rust9x Toolchain` --- .github/workflows/{build-target.yml => build-toolchain.yml} | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) rename .github/workflows/{build-target.yml => build-toolchain.yml} (98%) diff --git a/.github/workflows/build-target.yml b/.github/workflows/build-toolchain.yml similarity index 98% rename from .github/workflows/build-target.yml rename to .github/workflows/build-toolchain.yml index 8d41977d57539..0d841fa37d4b0 100644 --- a/.github/workflows/build-target.yml +++ b/.github/workflows/build-toolchain.yml @@ -9,7 +9,9 @@ # # Workflow file by "zhangxuan2011 " -name: Build Target Toolchain +--- + +name: Build Rust9x Toolchain on: push: From 8a7eb052659e6871380bea5fe60e78c3636320da Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Mon, 23 Feb 2026 16:12:25 +0800 Subject: [PATCH 13/20] fix(ci): :bug: Fixed the uploading issue - Added input in `workflow_dispatch` - Added the `GITHUB_TOKEN` env --- .github/workflows/build-toolchain.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 0d841fa37d4b0..3a328550868ec 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -18,6 +18,11 @@ on: tags: - "v*" workflow_dispatch: + inputs: + version: + description: "The version to release, which must start with `v`" + required: true + default: "v1.93.0-rust9x" permissions: contents: write @@ -95,3 +100,5 @@ jobs: uses: softprops/action-gh-release@v2 with: files: rust9x-toolchain-*.tar.gz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 2c90e7ac4af8c348fddae076323271598b1f4ded Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Mon, 23 Feb 2026 21:04:10 +0800 Subject: [PATCH 14/20] chore(readme): :memo: Fixed the display of README.md - Added some links on title `Links` --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 020ba0aa860d0..e3b790d8a4757 100644 --- a/README.md +++ b/README.md @@ -8,23 +8,23 @@ -This is the main source code repository for [Rust9x]. It contains the compiler, +This is the source code repository for [Rust9x]. It contains the compiler, standard library, and documentation. Note that this project can not only used on Windows 10 and 11, but also on Windows 7, XP, even Windows 2000, 98 and 95 -# Links +--- -## Official +# Links +**Cargo**: https://github.com/rust-lang/cargo +**rustfmt**: https://github.com/rust-lang/rustfmt +**Clippy**: https://github.com/rust-lang/rust-clippy +**rust-analyzer**: https://github.com/rust-lang/rust-analyzer +**Rust9x**: https://github.com/rust9x/rust/wiki -[Cargo]: https://github.com/rust-lang/cargo -[rustfmt]: https://github.com/rust-lang/rustfmt -[Clippy]: https://github.com/rust-lang/rust-clippy -[rust-analyzer]: https://github.com/rust-lang/rust-analyzer -## Rust9x -[Wiki]: https://github.com/rust9x/rust/wiki +[Rust9x]: https://github.com/rust9x/rust/wiki # Build @@ -73,7 +73,7 @@ Support targets: - Windows 2000, Windows 9x and older - i586 systems (simply called "16-bit systems") -For more information, please visit [here](https://github.com/rust9x/rust/wiki#installation) +For more information, please visit [the rust9x installation guide](https://github.com/rust9x/rust/wiki#installation) for further information. # Contributing From 63d7f9f29910a72771f29d7c712bf5016d301996 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Mon, 23 Feb 2026 21:46:16 +0800 Subject: [PATCH 15/20] chore(bootstrap): Added the `src` tools to support `rust-analyzer`check - Added `src` into tools's list --- bootstrap.rust9x.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bootstrap.rust9x.toml b/bootstrap.rust9x.toml index 698f201ab85f6..a4a9815e69c78 100644 --- a/bootstrap.rust9x.toml +++ b/bootstrap.rust9x.toml @@ -25,7 +25,8 @@ docs = false extended = true tools = [ "cargo", - "rustfmt" + "rustfmt", + "src" ] [install] From 2dfe01d709bccf2ffda6c48e93539442a9e1ef77 Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Tue, 24 Feb 2026 08:46:27 +0800 Subject: [PATCH 16/20] ci(build-target): :art: Removed unnessary steps to save time - Removed `Set up upstream` and `Install NASM` steps in workflow file - Removed Windows i586 support --- .github/workflows/build-toolchain.yml | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 3a328550868ec..19e98b24bfd66 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -49,12 +49,6 @@ jobs: target: i686-pc-windows-msvc target_short: i686-windows - # Windows, i586 - - os: windows-latest - arch: x86 - target: i586-pc-windows-msvc - target_short: i586-windows - defaults: run: shell: cmd @@ -65,12 +59,6 @@ jobs: fetch-depth: 0 submodules: false - - name: Set up upstream - run: git remote add upstream https://github.com/rust-lang/rust.git - - - name: Install NASM - run: choco install nasm -y - - name: Activate MSVC environment uses: ilammy/msvc-dev-cmd@v1 with: From 1dd868b8b0b5d0a22d09495eabec3e5ae68d54dd Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Tue, 24 Feb 2026 13:26:04 +0800 Subject: [PATCH 17/20] fix(build-target): Fix that the toolchain won't work on i686 --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 19e98b24bfd66..c6f11d9a339d3 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -73,7 +73,7 @@ jobs: set GITHUB_ACTIONS= :: Build & install in dist/rust9x - python x.py install --config bootstrap.rust9x.toml --stage 2 + python x.py install --config bootstrap.rust9x.toml --set build.host=["${{ matrix.target }}"] --stage 2 if %errorlevel% neq 0 exit /b 1 - name: Pack toolchain From e549de4798bcb414bf131ea427c0cff37956301b Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Tue, 24 Feb 2026 13:33:17 +0800 Subject: [PATCH 18/20] fix(build-target): :bug: Fixed the format error --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index c6f11d9a339d3..b4e1b0842a743 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -73,7 +73,7 @@ jobs: set GITHUB_ACTIONS= :: Build & install in dist/rust9x - python x.py install --config bootstrap.rust9x.toml --set build.host=["${{ matrix.target }}"] --stage 2 + python x.py install --config bootstrap.rust9x.toml --set build.host=[\"${{ matrix.target }}\"] --stage 2 if %errorlevel% neq 0 exit /b 1 - name: Pack toolchain From 4d92a9d1f1e6ec61bbdebb3b482822ee79b320d0 Mon Sep 17 00:00:00 2001 From: zhangxuan <114813512+zhangxuan2011@users.noreply.github.com> Date: Tue, 24 Feb 2026 15:40:01 +0800 Subject: [PATCH 19/20] ci: updated build-toolchain.yml --- .github/workflows/build-toolchain.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index b4e1b0842a743..309d378a8350b 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -45,7 +45,7 @@ jobs: # Windows, i686 - os: windows-latest - arch: x86 + arch: x64 target: i686-pc-windows-msvc target_short: i686-windows From dd57e8b0b250d34630fdbdbf28925d4fbe42498a Mon Sep 17 00:00:00 2001 From: zhangxuan2011 Date: Tue, 24 Feb 2026 18:11:53 +0800 Subject: [PATCH 20/20] chore(build-target): :fire: Disabled the i686 compiling temporary - Commented the `windows-i686` matrix --- .github/workflows/build-toolchain.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml index 309d378a8350b..66c6e611d27b7 100644 --- a/.github/workflows/build-toolchain.yml +++ b/.github/workflows/build-toolchain.yml @@ -44,10 +44,10 @@ jobs: target_short: x86_64-windows # Windows, i686 - - os: windows-latest - arch: x64 - target: i686-pc-windows-msvc - target_short: i686-windows + # - os: windows-latest + # arch: x64 + # target: i686-pc-windows-msvc + # target_short: i686-windows defaults: run: