rust-lang / rust-lang/rustc_codegen_gcc

Building is difficult

Open
#269 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Rust
Stars
1.2k
Forks
105
Avg merge
8h 20m
Merged PRs (30d)
14

Description

I managed to build this repo, but I found the build process quite difficult, primarily due to the various shell scripts

  1. prepare.sh pulls hyperfine, rand, regex and simple-raytracer, none of which are required to build rustc_codegen_gcc or rust sysroot. These benchmark programs should be moved into a separate scripts
  2. prepare.sh calls cargo build, which shouldn't be done in the preparation stage. Additionally this is bound to fail as it doesn't know where to find libgccjit.so
  3. The CIs run prepare_build.sh instead, which has the right behaviour and is just prepare.sh if the above two steps are removed. Perhaps update README to replace mentions of prepare.sh with prepare_build.sh?
  4. README calls for LIBRARY_PATH AND LD_LIBRARY_PATH to be set while calling ./build.sh, but this is redundant as the script sets them https://github.com/rust-lang/rustc_codegen_gcc/blob/0cbf2b97157e0c3e2d1f809453a527bed4689247/build.sh#L44-L45
  5. build.sh, config.sh, and test.sh overwrites the whole LIBRARY_PATH and LD_LIBRARY_PATH, but the user environment may be non-empty (e.g. when under an environment managed by SPACK) . They should be appended instead.

These are all very easy to clean up, though you may have some other considerations so I thought I'd open an issue instead of a PR.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read prepare.sh and compare it with prepare_build.sh, then inspect build.sh, config.sh, test.sh, and the README. Check the CI usage and current environment-variable handling first. Done means preparation avoids unnecessary builds and benchmarks, README instructions match the scripts, and existing LIBRARY_PATH and LD_LIBRARY_PATH values are preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, shell
Domain
build-system, documentation
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.