mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2025-01-05 19:53:55 +03:00
Attempt to fix compilation issues on CI
Can't reproduce the errors on Azure locally, but hopefully tweaking generated code can get things to work.
This commit is contained in:
parent
c3e0edd956
commit
535aa3193c
@ -1,4 +1,3 @@
|
|||||||
use js_sys::Object;
|
|
||||||
use wasm_bindgen::Clamped;
|
use wasm_bindgen::Clamped;
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use js_sys::Object;
|
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/array_buffer.rs"));
|
include!(concat!(env!("OUT_DIR"), "/array_buffer.rs"));
|
||||||
|
@ -19,6 +19,15 @@ fn main() {
|
|||||||
println!("processing {:?}", path);
|
println!("processing {:?}", path);
|
||||||
let mut generated_rust = wasm_bindgen_webidl::compile(&idl, None).unwrap();
|
let mut generated_rust = wasm_bindgen_webidl::compile(&idl, None).unwrap();
|
||||||
|
|
||||||
|
generated_rust.insert_str(
|
||||||
|
0,
|
||||||
|
"
|
||||||
|
mod generated_code {
|
||||||
|
#[allow(unused_imports)]
|
||||||
|
use js_sys::Object;
|
||||||
|
",
|
||||||
|
);
|
||||||
|
|
||||||
let out_file = out_dir.join(path.file_name().unwrap()).with_extension("rs");
|
let out_file = out_dir.join(path.file_name().unwrap()).with_extension("rs");
|
||||||
|
|
||||||
generated_rust.push_str(&format!(
|
generated_rust.push_str(&format!(
|
||||||
@ -44,6 +53,8 @@ fn main() {
|
|||||||
i
|
i
|
||||||
));
|
));
|
||||||
|
|
||||||
|
generated_rust.push_str("}\nuse self::generated_code::*;");
|
||||||
|
|
||||||
fs::write(&out_file, generated_rust).unwrap();
|
fs::write(&out_file, generated_rust).unwrap();
|
||||||
|
|
||||||
// Attempt to run rustfmt, but don't worry if it fails or if it isn't
|
// Attempt to run rustfmt, but don't worry if it fails or if it isn't
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
use js_sys::{Function, Object};
|
use js_sys::Function;
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/callbacks.rs"));
|
include!(concat!(env!("OUT_DIR"), "/callbacks.rs"));
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use js_sys::Object;
|
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/consts.rs"));
|
include!(concat!(env!("OUT_DIR"), "/consts.rs"));
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use js_sys::Object;
|
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/enums.rs"));
|
include!(concat!(env!("OUT_DIR"), "/enums.rs"));
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use js_sys::Object;
|
|
||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use js_sys::Object;
|
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/no_interface.rs"));
|
include!(concat!(env!("OUT_DIR"), "/no_interface.rs"));
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
use js_sys::Object;
|
|
||||||
use wasm_bindgen_test::*;
|
use wasm_bindgen_test::*;
|
||||||
|
|
||||||
include!(concat!(env!("OUT_DIR"), "/throws.rs"));
|
include!(concat!(env!("OUT_DIR"), "/throws.rs"));
|
||||||
|
Loading…
Reference in New Issue
Block a user