Bug 1454613 - Build binsource when building SpiderMonkey draft
authorDavid Teller <dteller@mozilla.com>
Tue, 24 Apr 2018 11:58:40 +0200
changeset 787119 cd24e34a2806497c60bfb71c5a19b71da1aeea4f
parent 779015 b7cc8286e9cf1c31ba352cfbaf78f3b940b5b211
push id107651
push userdteller@mozilla.com
push dateTue, 24 Apr 2018 09:59:23 +0000
bugs1454613
milestone61.0a1
Bug 1454613 - Build binsource when building SpiderMonkey MozReview-Commit-ID: CBy5fIgY6Ty
js/src/Cargo.toml
js/src/moz.build
--- a/js/src/Cargo.toml
+++ b/js/src/Cargo.toml
@@ -14,8 +14,12 @@ name = "mozjs_sys"
 path = "lib.rs"
 
 [build-dependencies]
 num_cpus = "1.1.0"
 
 [dependencies]
 libc = "0.2"
 libz-sys = "1.0.16"
+
+[[bin]]
+name = "binsource"
+path = "frontend/binsource"
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -705,16 +705,21 @@ if CONFIG['JS_BUILD_BINAST']:
     # specification.
     SOURCES += ['frontend/BinTokenReaderTester.cpp']
     # These parts of BinAST should eventually move to release.
     SOURCES += [
         'frontend/BinSource-auto.cpp',
         'frontend/BinSource.cpp',
         'frontend/BinToken.cpp'
     ]
+    # The following is a sanity check to ensure that we do not break builds of
+    # the parser generator, even if we don't use it at build-time yet.
+    RUST_PROGRAMS += [
+        'binsource'
+    ]
 
     # Instrument BinAST files for fuzzing as we have a fuzzing target for BinAST.
     if CONFIG['FUZZING_INTERFACES'] and CONFIG['LIBFUZZER']:
         SOURCES['frontend/BinSource.cpp'].flags += libfuzzer_flags_cmp
         SOURCES['frontend/BinToken.cpp'].flags += libfuzzer_flags_cmp
         SOURCES['frontend/BinTokenReaderTester.cpp'].flags += libfuzzer_flags_cmp
 
 # Wasm code should use WASM_HUGE_MEMORY instead of JS_CODEGEN_X64