0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

build: fix RLS-invoked 'cargo check' build

This commit is contained in:
Bert Belder 2018-12-19 04:09:34 +01:00
parent aa66ef98ea
commit 22874d44a6
No known key found for this signature in database
GPG key ID: 7A77887B2E2ED461
3 changed files with 12 additions and 0 deletions

View file

@ -63,6 +63,10 @@ fn main() {
"deno_deps"
};
if check_only {
println!("cargo:rustc-cfg=feature=\"check-only\"");
}
let status = Command::new("python")
.env("DENO_BUILD_PATH", &gn_out_dir)
.env("DENO_BUILD_MODE", &mode)

View file

@ -277,6 +277,9 @@ fn parse_map_string(
getter: &SourceMapGetter,
) -> Option<SourceMap> {
match script_name {
// The bundle does not get built for 'cargo check', so we don't embed the
// bundle source map.
#[cfg(not(feature = "check-only"))]
"gen/bundle/main.js" => {
let s =
include_str!(concat!(env!("GN_OUT_DIR"), "/gen/bundle/main.js.map"));

View file

@ -2,8 +2,13 @@
use libdeno::deno_buf;
pub fn deno_snapshot() -> deno_buf {
#[cfg(not(feature = "check-only"))]
let data =
include_bytes!(concat!(env!("GN_OUT_DIR"), "/gen/snapshot_deno.bin"));
// The snapshot blob is not available when the Rust Language Server runs
// 'cargo check'.
#[cfg(feature = "check-only")]
let data = vec![];
unsafe { deno_buf::from_raw_parts(data.as_ptr(), data.len()) }
}