Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Re-configure causes test-doc target to fail #37886

Closed
danbev opened this issue Mar 24, 2021 · 1 comment
Closed

Re-configure causes test-doc target to fail #37886

danbev opened this issue Mar 24, 2021 · 1 comment
Labels
build Issues and PRs related to build files or the CI.

Comments

@danbev
Copy link
Contributor

danbev commented Mar 24, 2021

  • Version: v16.0.0-pre
  • Platform: Linux localhost.localdomain 5.6.13-200.fc31.x86_64 deps: update openssl to 1.0.1j #1 SMP Thu May 14 23:26:14 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: build

What steps will reproduce the bug?

Using the main branch, run configure with an option and then run the target test-doc which will fail.

How often does it reproduce? Is there a required condition?

Seems to be every time.

What is the expected behavior?

This target should pass.

What do you see instead?

$ ./configure --debug
Node.js configure: Found Python 3.8.6...
INFO: configure completed successfully
$ make test-doc
mkdir -p out/doc/api
cp -r doc/api out/doc
mkdir -p out/doc/api
cp -r doc/api out/doc
if [ -x /home/danielbevenius/work/nodejs/node/./node ] && [ -e /home/danielbevenius/work/nodejs/node/./node ]; then /home/danielbevenius/work/nodejs/node/./node  tools/doc/allhtml.js; elif [ -x `command -v node` ] && [ -e `command -v node` ] && [ `command -v node` ]; then `command -v node`  tools/doc/allhtml.js; else echo "No available node, cannot run \"node  tools/doc/allhtml.js\""; exit 1; fi;
if [ -x /home/danielbevenius/work/nodejs/node/./node ] && [ -e /home/danielbevenius/work/nodejs/node/./node ]; then /home/danielbevenius/work/nodejs/node/./node  tools/doc/alljson.js; elif [ -x `command -v node` ] && [ -e `command -v node` ] && [ `command -v node` ]; then `command -v node`  tools/doc/alljson.js; else echo "No available node, cannot run \"node  tools/doc/alljson.js\""; exit 1; fi;
undefined:29
          "desc": "<table><thead><tr><th>API</th><th>Stability</th></tr></thead><tbody><tr><td class=\"module_stability\"><a href=\"assert.html\">assert</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"async_hooks.html\">async_hooks</a></td><td class=\"api_stability api_stability_1\">(1) Experimental</td></tr><tr><td class=\"module_stability\"><a href=\"buffer.html\">buffer</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"child_process.html\">child_process</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"cluster.html\">cluster</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"console.html\">console</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"crypto.html\">crypto</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"dgram.html\">dgram</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"diagnostics_channel.html\">diagnostics_channel</a></td><td class=\"api_stability api_stability_1\">(1) Experimental</td></tr><tr><td class=\"module_stability\"><a href=\"dns.html\">dns</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"domain.html\">domain</a></td><td class=\"api_stability api_stability_0\">(0) Deprecated</td></tr><tr><td class=\"module_stability\"><a href=\"fs.html\">fs</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"http.html\">http</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"http2.html\">http/2</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"https.html\">https</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"inspector.html\">inspector</a></td><td class=\"api_stability api_stability_1\">(1) Experimental</td></tr><tr><td class=\"module_stability\"><a href=\"modules.html\">module</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td class=\"module_stability\"><a href=\"os.html\">os</a></td><td class=\"api_stability api_stability_2\">(2) Stable</td></tr><tr><td "doc/api/documentation.md",
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            

SyntaxError: Unexpected token d in JSON at position 5352
    at JSON.parse (<anonymous>)
    at Object.<anonymous> (/home/danielbevenius/work/nodejs/node/tools/doc/alljson.js:39:21)
    at Module._compile (node:internal/modules/cjs/loader:1108:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
    at Module.load (node:internal/modules/cjs/loader:988:32)
    at Function.Module._load (node:internal/modules/cjs/loader:828:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
    at node:internal/main/run_main_module:17:47
make[1]: *** [Makefile:755: out/doc/api/all.json] Error 1
make: *** [Makefile:701: doc-only] Error 2

Additional information

Deleting out/doc will allow the target to pass.

@PoojaDurgad PoojaDurgad added the build Issues and PRs related to build files or the CI. label Mar 29, 2021
@richardlau
Copy link
Member

richardlau commented Apr 2, 2021

This is occurring because the stability table tool added in #36223 does this:

// Find the position of the `mark`.
const index = content.indexOf(mark);

The mark is overwritten the first time the tool runs. Subsequent runs no longer find the mark, e.g. index == -1, and the subsequent code corrupts the file as it hasn't guarded against the mark not being present.

I've opened #38048 to fix.

@danbev danbev closed this as completed in cbe3b27 Apr 6, 2021
targos pushed a commit that referenced this issue May 1, 2021
Keep markers for the stability table so that it can be updated on
subsequent runs of the doc tooling. Only overwrite the files if
they have been changed.

PR-URL: #38048
Fixes: #37886
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Juan José Arboleda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Issues and PRs related to build files or the CI.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants