fix(napi): move napi symbols file (#16179)

The current location was causing failures during v1.26.1 publication.

<!--
Before submitting a PR, please read http://deno.land/manual/contributing

1. Give the PR a descriptive title.

  Examples of good title:
    - fix(std/http): Fix race condition in server
    - docs(console): Update docstrings
    - feat(doc): Handle nested reexports

  Examples of bad title:
    - fix #7123
    - update docs
    - fix bugs

2. Ensure there is a related issue and it is referenced in the PR text.
3. Ensure there are tests that cover the changes.
4. Ensure `cargo test` passes.
5. Ensure `./tools/format.js` passes without changing files.
6. Ensure `./tools/lint.js` passes.
-->
This commit is contained in:
Colin Ihrig 2022-10-06 23:51:43 -04:00 committed by GitHub
parent 5a1ea586b4
commit c27234888f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 6 deletions

View File

@ -351,11 +351,11 @@ fn main() {
symbols: Vec<String>,
}
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.

View File

@ -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 {

0
ext/napi/README.md Normal file
View File

View File

@ -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) {