rust-lang / rust-lang/cc-rs

Support executing .bat script as a compiler on Windows

Open
#369 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
2.2k
Forks
617
Avg merge
22h 32m
Merged PRs (30d)
41

Description

rustc has code to execute a .bat script as a linker on Windows because it's difficult to otherwise use a script as a linker there:
https://github.com/rust-lang/rust/blob/d2048b6db375299b681d4f4728b8e7cad9f74d5f/src/librustc_codegen_llvm/back/link.rs#L59

In the Firefox build we don't currently pass compiler paths to cargo for build scripts to use because msys' path translation makes a mess of them (mostly because we're using sccache and having a space in the path breaks things):
https://searchfox.org/mozilla-central/rev/c07aaf12f13037c1f5a343d31f8291549e57373f/config/rules.mk#917

If this crate supported executing a .bat script as a compiler on Windows we could instead put everything we needed in there and simply pass the path to the .bat which ought to work.

Contributor guide

No contributing guide indexed for this repository

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

Start by comparing rustc's Windows .bat linker handling in src/librustc_codegen_llvm/back/link.rs and reviewing the Firefox config/rules.mk context linked in the issue. Done means cc-rs can execute a .bat path as a compiler on Windows for build scripts; no specific cc-rs test is named.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.