Skip to content
This repository has been archived by the owner on Feb 28, 2023. It is now read-only.

Check that Substrate/Polkadot fully compiles using distributed compilation #52

Closed
Xanewok opened this issue Apr 27, 2021 · 1 comment · Fixed by #77
Closed

Check that Substrate/Polkadot fully compiles using distributed compilation #52

Xanewok opened this issue Apr 27, 2021 · 1 comment · Fixed by #77

Comments

@Xanewok
Copy link
Contributor

Xanewok commented Apr 27, 2021

The whole point of this PoC/fork is to speed up the Substrate/Polkadot builds, so we need to ensure that those project builds using sccache first.

Substrate compilation is blocked on #51 and on the following patch to the libp2p-wasm-ext crate:

diff --git a/transports/wasm-ext/src/lib.rs b/transports/wasm-ext/src/lib.rs
index 8c0e5012..f5be31f4 100644
--- a/transports/wasm-ext/src/lib.rs
+++ b/transports/wasm-ext/src/lib.rs
@@ -136,6 +136,11 @@ pub mod ffi {
     }
 }
 
+// Include the file in the dep-info, so that build accelerators such as sccache
+// can correctly prepare the required input files in order to compile the crate.
+#[cfg(feature = "websocket")]
+const _: &'static str = include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/src/websockets.js"));
+
 /// Implementation of `Transport` whose implementation is handled by some FFI.
 pub struct ExtTransport {
     inner: SendWrapper<ffi::Transport>,

In general, we need a mechanism to track required files in the dep-info directly (rust-lang/rust#84029) but the diff above works around that by using an include_str hack.

@drahnr
Copy link
Contributor

drahnr commented May 25, 2021

🎉

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