mirror of
https://github.com/denoland/deno.git
synced 2025-03-03 17:34:47 -05:00
build: fix RLS-invoked 'cargo check' build
This commit is contained in:
parent
aa66ef98ea
commit
22874d44a6
3 changed files with 12 additions and 0 deletions
4
build.rs
4
build.rs
|
@ -63,6 +63,10 @@ fn main() {
|
||||||
"deno_deps"
|
"deno_deps"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if check_only {
|
||||||
|
println!("cargo:rustc-cfg=feature=\"check-only\"");
|
||||||
|
}
|
||||||
|
|
||||||
let status = Command::new("python")
|
let status = Command::new("python")
|
||||||
.env("DENO_BUILD_PATH", &gn_out_dir)
|
.env("DENO_BUILD_PATH", &gn_out_dir)
|
||||||
.env("DENO_BUILD_MODE", &mode)
|
.env("DENO_BUILD_MODE", &mode)
|
||||||
|
|
|
@ -277,6 +277,9 @@ fn parse_map_string(
|
||||||
getter: &SourceMapGetter,
|
getter: &SourceMapGetter,
|
||||||
) -> Option<SourceMap> {
|
) -> Option<SourceMap> {
|
||||||
match script_name {
|
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" => {
|
"gen/bundle/main.js" => {
|
||||||
let s =
|
let s =
|
||||||
include_str!(concat!(env!("GN_OUT_DIR"), "/gen/bundle/main.js.map"));
|
include_str!(concat!(env!("GN_OUT_DIR"), "/gen/bundle/main.js.map"));
|
||||||
|
|
|
@ -2,8 +2,13 @@
|
||||||
use libdeno::deno_buf;
|
use libdeno::deno_buf;
|
||||||
|
|
||||||
pub fn deno_snapshot() -> deno_buf {
|
pub fn deno_snapshot() -> deno_buf {
|
||||||
|
#[cfg(not(feature = "check-only"))]
|
||||||
let data =
|
let data =
|
||||||
include_bytes!(concat!(env!("GN_OUT_DIR"), "/gen/snapshot_deno.bin"));
|
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()) }
|
unsafe { deno_buf::from_raw_parts(data.as_ptr(), data.len()) }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue