From c27234888f3d93aee842e8b30912512867071cb9 Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Thu, 6 Oct 2022 23:51:43 -0400 Subject: [PATCH] fix(napi): move napi symbols file (#16179) The current location was causing failures during v1.26.1 publication. --- cli/build.rs | 6 +++--- cli/napi_sym/lib.rs | 3 +-- {tools/napi => cli/napi_sym}/symbol_exports.json | 0 ext/napi/README.md | 0 tools/napi/generate_link_win.js | 4 +++- 5 files changed, 7 insertions(+), 6 deletions(-) rename {tools/napi => cli/napi_sym}/symbol_exports.json (100%) create mode 100644 ext/napi/README.md diff --git a/cli/build.rs b/cli/build.rs index c1bc3305ea..77c95fb17b 100644 --- a/cli/build.rs +++ b/cli/build.rs @@ -351,11 +351,11 @@ fn main() { symbols: Vec, } let symbols_json = - std::fs::read_to_string("../tools/napi/symbol_exports.json").expect( - "Missing tools/napi/symbol_exports.json! This is a bug in napi_sym", + std::fs::read_to_string("./napi_sym/symbol_exports.json").expect( + "Missing ./napi_sym/symbol_exports.json! This is a bug in napi_sym", ); let symbols: Symbols = serde_json::from_str(&symbols_json) - .expect("tools/napi/symbol_exports.json is not valid JSON"); + .expect("./napi_sym/symbol_exports.json is not valid JSON"); // Don't export all symbols into the dynamic symbol table. -rdynamic exports *all* symbols introducing binary bloat. // We only need to export Node API symbols. diff --git a/cli/napi_sym/lib.rs b/cli/napi_sym/lib.rs index 769dddba96..2805c99572 100644 --- a/cli/napi_sym/lib.rs +++ b/cli/napi_sym/lib.rs @@ -4,8 +4,7 @@ use proc_macro::TokenStream; use quote::quote; use serde::Deserialize; -static NAPI_EXPORTS: &str = - include_str!("../../tools/napi/symbol_exports.json"); +static NAPI_EXPORTS: &str = include_str!("./symbol_exports.json"); #[derive(Deserialize)] struct SymbolExports { diff --git a/tools/napi/symbol_exports.json b/cli/napi_sym/symbol_exports.json similarity index 100% rename from tools/napi/symbol_exports.json rename to cli/napi_sym/symbol_exports.json diff --git a/ext/napi/README.md b/ext/napi/README.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tools/napi/generate_link_win.js b/tools/napi/generate_link_win.js index a0bda6a429..7d16f81c3e 100755 --- a/tools/napi/generate_link_win.js +++ b/tools/napi/generate_link_win.js @@ -1,7 +1,9 @@ #!/usr/bin/env -S deno run --unstable --allow-read --allow-write // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -import exports from "./symbol_exports.json" assert { type: "json" }; +import exports from "../../cli/napi_sym/symbol_exports.json" assert { + type: "json", +}; let def = "LIBRARY\nEXPORTS\n"; for (const symbol of exports.symbols) {