{"id":19358649,"url":"https://github.com/paritytech/rustc-codesize-min","last_synced_at":"2026-05-12T21:40:05.674Z","repository":{"id":37176681,"uuid":"417789054","full_name":"paritytech/rustc-codesize-min","owner":"paritytech","description":"Testbed for code size minimization strategies in the rust compiler","archived":false,"fork":false,"pushed_at":"2023-04-03T20:19:05.000Z","size":653499,"stargazers_count":2,"open_issues_count":8,"forks_count":1,"subscribers_count":3,"default_branch":"codesize","last_synced_at":"2025-01-06T18:37:15.561Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/paritytech.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2021-10-16T10:06:51.000Z","updated_at":"2023-09-04T09:38:52.000Z","dependencies_parsed_at":"2024-11-10T07:22:52.961Z","dependency_job_id":null,"html_url":"https://github.com/paritytech/rustc-codesize-min","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Frustc-codesize-min","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Frustc-codesize-min/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Frustc-codesize-min/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paritytech%2Frustc-codesize-min/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paritytech","download_url":"https://codeload.github.com/paritytech/rustc-codesize-min/tar.gz/refs/heads/codesize","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240474166,"owners_count":19807280,"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","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":[],"created_at":"2024-11-10T07:12:33.813Z","updated_at":"2026-05-12T21:40:00.648Z","avatar_url":"https://github.com/paritytech.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Rust Programming Language\n\nThis is the main source code repository for [Rust]. It contains the compiler,\nstandard library, and documentation.\n\n[Rust]: https://www.rust-lang.org\n\n**Note: this README is for _users_ rather than _contributors_.\nIf you wish to _contribute_ to the compiler, you should read the\n[Getting Started][gettingstarted] section of the rustc-dev-guide instead.**\n\n## Quick Start\n\nRead [\"Installation\"] from [The Book].\n\n[\"Installation\"]: https://doc.rust-lang.org/book/ch01-01-installation.html\n[The Book]: https://doc.rust-lang.org/book/index.html\n\n## Installing from Source\n\nThe Rust build system uses a Python script called `x.py` to build the compiler,\nwhich manages the bootstrapping process. It lives in the root of the project.\n\nThe `x.py` command can be run directly on most systems in the following format:\n\n```sh\n./x.py \u003csubcommand\u003e [flags]\n```\n\nThis is how the documentation and examples assume you are running `x.py`.\n\nSystems such as Ubuntu 20.04 LTS do not create the necessary `python` command by default when Python is installed that allows `x.py` to be run directly. In that case you can either create a symlink for `python` (Ubuntu provides the `python-is-python3` package for this), or run `x.py` using Python itself:\n\n```sh\n# Python 3\npython3 x.py \u003csubcommand\u003e [flags]\n\n# Python 2.7\npython2.7 x.py \u003csubcommand\u003e [flags]\n```\n\nMore information about `x.py` can be found\nby running it with the `--help` flag or reading the [rustc dev guide][rustcguidebuild].\n\n[gettingstarted]: https://rustc-dev-guide.rust-lang.org/getting-started.html\n[rustcguidebuild]: https://rustc-dev-guide.rust-lang.org/building/how-to-build-and-run.html\n\n### Building on a Unix-like system\n1. Make sure you have installed the dependencies:\n\n   * `g++` 5.1 or later or `clang++` 3.5 or later\n   * `python` 3 or 2.7\n   * GNU `make` 3.81 or later\n   * `cmake` 3.13.4 or later\n   * `ninja`\n   * `curl`\n   * `git`\n   * `ssl` which comes in `libssl-dev` or `openssl-devel`\n   * `pkg-config` if you are compiling on Linux and targeting Linux\n\n2. Clone the [source] with `git`:\n\n   ```sh\n   git clone https://github.com/rust-lang/rust.git\n   cd rust\n   ```\n\n[source]: https://github.com/rust-lang/rust\n\n3. Configure the build settings:\n\n    The Rust build system uses a file named `config.toml` in the root of the\n    source tree to determine various configuration settings for the build.\n    Copy the default `config.toml.example` to `config.toml` to get started.\n\n    ```sh\n    cp config.toml.example config.toml\n    ```\n\n    If you plan to use `x.py install` to create an installation, it is recommended\n    that you set the `prefix` value in the `[install]` section to a directory.\n\n    Create install directory if you are not installing in default directory\n\n4. Build and install:\n\n    ```sh\n    ./x.py build \u0026\u0026 ./x.py install\n    ```\n\n    When complete, `./x.py install` will place several programs into\n    `$PREFIX/bin`: `rustc`, the Rust compiler, and `rustdoc`, the\n    API-documentation tool. This install does not include [Cargo],\n    Rust's package manager. To build and install Cargo, you may\n    run `./x.py install cargo` or set the `build.extended` key in\n    `config.toml` to `true` to build and install all tools.\n\n[Cargo]: https://github.com/rust-lang/cargo\n\n### Building on Windows\n\nThere are two prominent ABIs in use on Windows: the native (MSVC) ABI used by\nVisual Studio, and the GNU ABI used by the GCC toolchain. Which version of Rust\nyou need depends largely on what C/C++ libraries you want to interoperate with:\nfor interop with software produced by Visual Studio use the MSVC build of Rust;\nfor interop with GNU software built using the MinGW/MSYS2 toolchain use the GNU\nbuild.\n\n#### MinGW\n\n[MSYS2][msys2] can be used to easily build Rust on Windows:\n\n[msys2]: https://www.msys2.org/\n\n1. Grab the latest [MSYS2 installer][msys2] and go through the installer.\n\n2. Run `mingw32_shell.bat` or `mingw64_shell.bat` from wherever you installed\n   MSYS2 (i.e. `C:\\msys64`), depending on whether you want 32-bit or 64-bit\n   Rust. (As of the latest version of MSYS2 you have to run `msys2_shell.cmd\n   -mingw32` or `msys2_shell.cmd -mingw64` from the command line instead)\n\n3. From this terminal, install the required tools:\n\n   ```sh\n   # Update package mirrors (may be needed if you have a fresh install of MSYS2)\n   pacman -Sy pacman-mirrors\n\n   # Install build tools needed for Rust. If you're building a 32-bit compiler,\n   # then replace \"x86_64\" below with \"i686\". If you've already got git, python,\n   # or CMake installed and in PATH you can remove them from this list. Note\n   # that it is important that you do **not** use the 'python2', 'cmake' and 'ninja'\n   # packages from the 'msys2' subsystem. The build has historically been known\n   # to fail with these packages.\n   pacman -S git \\\n               make \\\n               diffutils \\\n               tar \\\n               mingw-w64-x86_64-python \\\n               mingw-w64-x86_64-cmake \\\n               mingw-w64-x86_64-gcc \\\n               mingw-w64-x86_64-ninja\n   ```\n\n4. Navigate to Rust's source code (or clone it), then build it:\n\n   ```sh\n   ./x.py build \u0026\u0026 ./x.py install\n   ```\n\n#### MSVC\n\nMSVC builds of Rust additionally require an installation of Visual Studio 2017\n(or later) so `rustc` can use its linker.  The simplest way is to get the\n[Visual Studio], check the “C++ build tools” and “Windows 10 SDK” workload.\n\n[Visual Studio]: https://visualstudio.microsoft.com/downloads/\n\n(If you're installing cmake yourself, be careful that “C++ CMake tools for\nWindows” doesn't get included under “Individual components”.)\n\nWith these dependencies installed, you can build the compiler in a `cmd.exe`\nshell with:\n\n```sh\npython x.py build\n```\n\nCurrently, building Rust only works with some known versions of Visual Studio. If\nyou have a more recent version installed and the build system doesn't understand,\nyou may need to force rustbuild to use an older version. This can be done\nby manually calling the appropriate vcvars file before running the bootstrap.\n\n```batch\nCALL \"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\"\npython x.py build\n```\n\n#### Specifying an ABI\n\nEach specific ABI can also be used from either environment (for example, using\nthe GNU ABI in PowerShell) by using an explicit build triple. The available\nWindows build triples are:\n- GNU ABI (using GCC)\n    - `i686-pc-windows-gnu`\n    - `x86_64-pc-windows-gnu`\n- The MSVC ABI\n    - `i686-pc-windows-msvc`\n    - `x86_64-pc-windows-msvc`\n\nThe build triple can be specified by either specifying `--build=\u003ctriple\u003e` when\ninvoking `x.py` commands, or by copying the `config.toml` file (as described\nin [Installing From Source](#installing-from-source)), and modifying the\n`build` option under the `[build]` section.\n\n### Configure and Make\n\nWhile it's not the recommended build system, this project also provides a\nconfigure script and makefile (the latter of which just invokes `x.py`).\n\n```sh\n./configure\nmake \u0026\u0026 sudo make install\n```\n\nWhen using the configure script, the generated `config.mk` file may override the\n`config.toml` file. To go back to the `config.toml` file, delete the generated\n`config.mk` file.\n\n## Building Documentation\n\nIf you’d like to build the documentation, it’s almost the same:\n\n```sh\n./x.py doc\n```\n\nThe generated documentation will appear under `doc` in the `build` directory for\nthe ABI used. I.e., if the ABI was `x86_64-pc-windows-msvc`, the directory will be\n`build\\x86_64-pc-windows-msvc\\doc`.\n\n## Notes\n\nSince the Rust compiler is written in Rust, it must be built by a\nprecompiled \"snapshot\" version of itself (made in an earlier stage of\ndevelopment). As such, source builds require a connection to the Internet, to\nfetch snapshots, and an OS that can execute the available snapshot binaries.\n\nSnapshot binaries are currently built and tested on several platforms:\n\n| Platform / Architecture                     | x86 | x86_64 |\n|---------------------------------------------|-----|--------|\n| Windows (7, 8, 10, ...)                     | ✓   | ✓      |\n| Linux (kernel 2.6.32, glibc 2.11 or later)  | ✓   | ✓      |\n| macOS (10.7 Lion or later)                  | (\\*) | ✓      |\n\n(\\*): Apple dropped support for running 32-bit binaries starting from macOS 10.15 and iOS 11.\nDue to this decision from Apple, the targets are no longer useful to our users.\nPlease read [our blog post][macx32] for more info.\n\n[macx32]: https://blog.rust-lang.org/2020/01/03/reducing-support-for-32-bit-apple-targets.html\n\nYou may find that other platforms work, but these are our officially\nsupported build environments that are most likely to work.\n\n## Getting Help\n\nThe Rust community congregates in a few places:\n\n* [Stack Overflow] - Direct questions about using the language.\n* [users.rust-lang.org] - General discussion and broader questions.\n* [/r/rust] - News and general discussion.\n\n[Stack Overflow]: https://stackoverflow.com/questions/tagged/rust\n[/r/rust]: https://reddit.com/r/rust\n[users.rust-lang.org]: https://users.rust-lang.org/\n\n## Contributing\n\nIf you are interested in contributing to the Rust project, please take a look\nat the [Getting Started][gettingstarted] guide in the [rustc-dev-guide].\n\n[rustc-dev-guide]: https://rustc-dev-guide.rust-lang.org\n\n## License\n\nRust is primarily distributed under the terms of both the MIT license\nand the Apache License (Version 2.0), with portions covered by various\nBSD-like licenses.\n\nSee [LICENSE-APACHE](LICENSE-APACHE), [LICENSE-MIT](LICENSE-MIT), and\n[COPYRIGHT](COPYRIGHT) for details.\n\n## Trademark\n\n[The Rust Foundation][rust-foundation] owns and protects the Rust and Cargo\ntrademarks and logos (the “Rust Trademarks”).\n\nIf you want to use these names or brands, please read the [media guide][media-guide].\n\nThird-party logos may be subject to third-party copyrights and trademarks. See\n[Licenses][policies-licenses] for details.\n\n[rust-foundation]: https://foundation.rust-lang.org/\n[media-guide]: https://www.rust-lang.org/policies/media-guide\n[policies-licenses]: https://www.rust-lang.org/policies/licenses\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Frustc-codesize-min","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparitytech%2Frustc-codesize-min","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparitytech%2Frustc-codesize-min/lists"}