diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f0fd5c63052..8e313ab08b5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ Once you've completed the setup process outlined in the README, you can proceed - Matrix: Join our [Matrix channel](https://matrix.to/#/#rustc_codegen_gcc:matrix.org) - IRC: Join us on [IRC](https://web.libera.chat/#rustc_codegen_gcc) -- GitHub Issues: For bug reports and feature discussions +- [GitHub Issues](https://github.com/rust-lang/rustc_codegen_gcc/issues): For bug reports and feature discussions We encourage new contributors to join our communication channels and introduce themselves. Feel free to ask questions about where to start or discuss potential contributions. @@ -28,12 +28,15 @@ We encourage new contributors to join our communication channels and introduce t ### Common Development Tasks #### Running Specific Tests + To run specific tests, use appropriate flags such as: + - `./y.sh test --test-libcore` - `./y.sh test --std-tests` - `cargo test -- ` Additionally, you can run the tests of `libgccjit`: + ```bash # libgccjit tests cd gcc-build/gcc @@ -43,8 +46,10 @@ make check-jit RUNTESTFLAGS="-v -v -v jit.exp=jit.dg/test-asm.cc" ``` #### Debugging Tools + The project provides several environment variables for debugging: -- `CG_GCCJIT_DUMP_GIMPLE`: Dump the GIMPLE IR + +- `CG_GCCJIT_DUMP_GIMPLE`: Dumps the GIMPLE IR - `CG_RUSTFLAGS`: Additional Rust flags - `CG_GCCJIT_DUMP_MODULE`: Dumps a specific module - `CG_GCCJIT_DUMP_TO_FILE`: Creates C-like representation @@ -54,11 +59,13 @@ Full list of debugging options can be found in the [README](Readme.md#env-vars). ## Making Contributions ### Finding Issues to Work On + 1. Look for issues labeled with [`good first issue`](https://github.com/rust-lang/rustc_codegen_gcc/issues?q=is%3Aissue%20state%3Aopen%20label%3A"good%20first%20issue") or [`help wanted`](https://github.com/rust-lang/rustc_codegen_gcc/issues?q=is%3Aissue%20state%3Aopen%20label%3A"help%20wanted") 2. Check the [progress report](https://blog.antoyo.xyz/rustc_codegen_gcc-progress-report-34#state_of_rustc_codegen_gcc) for larger initiatives 3. Consider improving documentation or investigating [failing tests](https://github.com/rust-lang/rustc_codegen_gcc/tree/master/tests) (except `failing-ui-tests12.txt`) ### Pull Request Process + 1. Fork the repository and create a new branch 2. Make your changes with clear commit messages 3. Add tests for new functionality @@ -66,6 +73,7 @@ Full list of debugging options can be found in the [README](Readme.md#env-vars). 5. Submit a PR with a description of your changes ### Code Style Guidelines + - Follow Rust standard coding conventions - Ensure your code passes `rustfmt` and `clippy` - Add comments explaining complex logic, especially in GCC interface code diff --git a/Readme.md b/Readme.md index bacad151c96..859bb1568f4 100644 --- a/Readme.md +++ b/Readme.md @@ -19,11 +19,13 @@ You need to use my [fork of gcc](https://github.com/rust-lang/gcc) which already The default configuration (see below in the [Quick start](#quick-start) section) will download a `libgccjit` built in the CI that already contains these patches, so you don't need to build this fork yourself if you use the default configuration. ### Dependencies - - rustup: follow instructions on the [official website](https://rustup.rs) - - consider to install DejaGnu which is necessary for running the libgccjit test suite. [website](https://www.gnu.org/software/dejagnu/#downloading) - - additional packages: `flex`, `libmpfr-dev`, `libgmp-dev`, `libmpc3`, `libmpc-dev` + +- rustup: follow instructions on the [official website](https://rustup.rs) +- consider to install DejaGnu which is necessary for running the libgccjit test suite. [website](https://www.gnu.org/software/dejagnu/#downloading) +- additional packages: `flex`, `libmpfr-dev`, `libgmp-dev`, `libmpc3`, `libmpc-dev` ### Quick start + 1. Clone and configure the repository: ```bash git clone https://github.com/rust-lang/rustc_codegen_gcc @@ -157,7 +159,7 @@ You can do the same manually (although we don't recommend it): $ LIBRARY_PATH="[gcc-path value]" LD_LIBRARY_PATH="[gcc-path value]" rustc +$(cat $CG_GCCJIT_DIR/rust-toolchain | grep 'channel' | cut -d '=' -f 2 | sed 's/"//g' | sed 's/ //g') -Cpanic=abort -Zcodegen-backend=$CG_GCCJIT_DIR/target/release/librustc_codegen_gcc.so --sysroot $CG_GCCJIT_DIR/build_sysroot/sysroot my_crate.rs ``` -## Env vars +## Environment variables * _**CG_GCCJIT_DUMP_ALL_MODULES**_: Enables dumping of all compilation modules. When set to "1", a dump is created for each module during compilation and stored in `/tmp/reproducers/`. * _**CG_GCCJIT_DUMP_MODULE**_: Enables dumping of a specific module. When set with the module name, e.g., `CG_GCCJIT_DUMP_MODULE=module_name`, a dump of that specific module is created in `/tmp/reproducers/`.