Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Failure to build with sccache on Windows #554

Closed
Redfire75369 opened this issue Dec 11, 2021 · 1 comment
Closed

Failure to build with sccache on Windows #554

Redfire75369 opened this issue Dec 11, 2021 · 1 comment

Comments

@Redfire75369
Copy link
Contributor

Redfire75369 commented Dec 11, 2021

rust-mozjs (specifically jsglue.cpp) fails to build on Windows with sccache.
I have tested, and it has successfully built on Linux (WSL Debian).

Setup

  1. Install sccache (v0.2.15)
  2. Run set RUSTC_WRAPPER=sccache, and sccache --start-server
  3. Run cargo clean --release
  4. Run cargo build --release -vv > build.log

Actual Output: https://paste.gg/p/redfire/2c9d5dd64f724e8b806a8175653d75e5
(Expected Output is like 65K lines...)

I think I have narrowed it down to the build command for building jsglue.cpp.
Expected jsglue.cpp build command flags (No sccache):

[mozjs 0.14.1] running: "clang-cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-m64" "-I" "C:\\Users\\Redfire\\software\\github\\rust-mozjs\\target\\release\\build\\mozjs_sys-389741e052a7c073\\out\\build\\dist\\include" "-W4" "-DSTATIC_JS_API" "-FIC:\\Users\\Redfire\\software\\github\\rust-mozjs\\target\\release\\build\\mozjs_sys-389741e052a7c073\\out\\build\\js\\src\\js-confdefs.h" "-Zi" "-GR-" "-std:c++17" "-Wno-c++0x-extensions" "-Wno-return-type-c-linkage" "-Wno-invalid-offsetof" "-Wno-unused-parameter" "-DWIN32=" "-FoC:\\Users\\Redfire\\software\\github\\rust-mozjs\\target\\release\\build\\mozjs-20879d0ed8d587aa\\out\\src/jsglue.o" "-c" "src/jsglue.cpp"

Actual jsglue.cpp build command flags (w/ sccache):

[mozjs_sys 0.68.2] running: "sccache" "clang-cl.exe" "-nologo" "-MD" "-O2" "-Brepro" "-m64" "-I" "C:\\Users\\Redfire\\software\\github\\rust-mozjs\\target\\release\\build\\mozjs_sys-389741e052a7c073\\out\\build\\dist/include" "-I" "C:\\Users\\Redfire\\software\\github\\rust-mozjs\\target\\release\\build\\mozjs_sys-389741e052a7c073\\out\\build\\js/src" "-W4" "-FI" "C:\\Users\\Redfire\\software\\github\\rust-mozjs\\target\\release\\build\\mozjs_sys-389741e052a7c073\\out\\build/js/src/js-confdefs.h" "-FoC:\\Users\\Redfire\\software\\github\\rust-mozjs\\target\\release\\build\\mozjs_sys-389741e052a7c073\\out\\build\\glue\\src/jsglue.o" "-c" "src/jsglue.cpp"

Edit:
After looking around a bit, it seems that build.rs is being completely skipped, look at the flags that are missing. https://github.com/servo/rust-mozjs/blob/master/build.rs

@jdm
Copy link
Member

jdm commented Dec 11, 2021

This sounds like an issue that should be filed against sccache instead.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants