diff --git a/.github/workflows/build-toolchain.yml b/.github/workflows/build-toolchain.yml new file mode 100644 index 0000000000000..66c6e611d27b7 --- /dev/null +++ b/.github/workflows/build-toolchain.yml @@ -0,0 +1,92 @@ +# 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 Rust9x Toolchain + +on: + push: + 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 + +env: + CARGO_TERM_COLOR: always + +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: x64 + # target: i686-pc-windows-msvc + # target_short: i686-windows + + defaults: + run: + shell: cmd + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: false + + - name: Activate MSVC environment + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: ${{ matrix.arch }} + + - name: Build toolchain + env: + # If this env exists, the commit hash is wrong and just return 404. + GITHUB_ACTIONS: + run: | + :: Avoid failed to unset + set GITHUB_ACTIONS= + + :: Build & install in dist/rust9x + 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 + run: | + set VERSION=${{ github.ref_name }} + set ARCHIVE_NAME=rust9x-toolchain-%VERSION%-${{ matrix.target_short }}.tar.gz + + :: 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 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 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 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..e3b790d8a4757 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 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 +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 +**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 + + +[Rust9x]: 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 -## Why Rust? +If you think build this source is so sucks, perhaps you can follow this: -- **Performance:** Fast and memory-efficient, suitable for critical services, embedded devices, and easily integrated with other languages. +1. Download the latest release -- **Reliability:** Our rich type system and ownership model ensure memory and thread safety, reducing bugs at compile-time. +View [here](https://github.com/zhangxuan/rust9x/releases/latest) and choose the best platform for you. -- **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]). +If you don't know how to choose, you can click [here](#choose-the-platform) -[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 +## Choose the platform -## Quick Start +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` -Read ["Installation"] from [The Book]. +For each assets has its own platform, you can choose the one that fits the target system. -["Installation"]: https://doc.rust-lang.org/book/ch01-01-installation.html -[The Book]: https://doc.rust-lang.org/book/index.html +### x86_64 Windows -## Installing from Source +File name: `rust9x-toolchain--x86_64-windows.tar.gz` -If you really want to install from source (though this is not recommended), see -[INSTALL.md](INSTALL.md). +Support targets: +- Windows 10 and 11 +- x86_64 systems (simply called "64-bit systems") -## Getting Help +### i686 Windows -See https://www.rust-lang.org/community for a list of chat platforms and forums. +File name: `rust9x-toolchain--i686-windows.tar.gz` -## Contributing +Support targets: +- Windows 7 and XP +- i686 systems (simply called "32-bit systems") -See [CONTRIBUTING.md](CONTRIBUTING.md). +### i586 Windows -## License +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 [the rust9x installation guide](https://github.com/rust9x/rust/wiki#installation) for further information. + +# 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 diff --git a/bootstrap.rust9x.toml b/bootstrap.rust9x.toml index c57817af878a3..a4a9815e69c78 100644 --- a/bootstrap.rust9x.toml +++ b/bootstrap.rust9x.toml @@ -18,35 +18,31 @@ target = [ "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", + "rustfmt", + "src" +] [install] # for creating a downloadable package: python x.py install, then create and archive this -prefix = "../dist/rust9x" +prefix = "dist/rust9x" sysconfdir = "." [rust] # 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 -# incremental = true +incremental = true [dist] src-tarball = false 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 = ""