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

doc build problem in withoutintl builds #41077

Closed
richardlau opened this issue Dec 3, 2021 · 14 comments · Fixed by #41091
Closed

doc build problem in withoutintl builds #41077

richardlau opened this issue Dec 3, 2021 · 14 comments · Fixed by #41091
Labels
doc Issues and PRs related to the documentations.

Comments

@richardlau
Copy link
Member

Version

v18.0.0-pre

Platform

No response

Subsystem

build

What steps will reproduce the bug?

Run CI. https://ci.nodejs.org/job/node-test-commit-linux-containered/nodes=ubuntu1804_sharedlibs_withoutintl_x64/ builds have been consistently failing starting today. These are run with python3 ./configure --verbose --without-intl.

e.g. From today's daily build:
https://ci.nodejs.org/job/node-test-commit-linux-containered/29799/nodes=ubuntu1804_sharedlibs_withoutintl_x64/console

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

Seems consistent for builds today.

What is the expected behavior?

Build completes.

What do you see instead?

08:05:45 /home/iojs/build/workspace/node-test-commit-linux-containered/tools/doc/node_modules/highlight.js/lib/languages/python.js:10
08:05:45   const IDENT_RE = /[\p{XID_Start}_]\p{XID_Continue}*/u;
08:05:45                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
08:05:45 
08:05:45 SyntaxError: Invalid regular expression: /[\p{XID_Start}_]\p{XID_Continue}*/: Invalid property name in character class
08:05:45     at Object.compileFunction (node:vm:352:18)
08:05:45     at wrapSafe (node:internal/modules/cjs/loader:1026:15)
08:05:45     at Module._compile (node:internal/modules/cjs/loader:1061:27)
08:05:45     at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10)
08:05:45     at Module.load (node:internal/modules/cjs/loader:975:32)
08:05:45     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
08:05:45     at Module.require (node:internal/modules/cjs/loader:999:19)
08:05:45     at require (node:internal/modules/cjs/helpers:102:18)
08:05:45     at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-linux-containered/tools/doc/node_modules/highlight.js/lib/index.js:144:33)
08:05:45     at Module._compile (node:internal/modules/cjs/loader:1097:14)
08:05:45 

Additional information

No response

@richardlau
Copy link
Member Author

The error was thrown from highlight.js, which was updated in #41036 (and deemed to not require a full CI 😞).

@richardlau
Copy link
Member Author

richardlau commented Dec 3, 2021

@targos
Copy link
Member

targos commented Dec 4, 2021

I suppose that this regular expression requires ICU data to work.

@Mesteery Mesteery added the doc Issues and PRs related to the documentations. label Dec 4, 2021
nodejs-github-bot pushed a commit that referenced this issue Dec 4, 2021
Recent upgrade of highlight.js has broken the docs build on the
withoutintl builds.

PR-URL: #41078
Refs: #41077
Refs: #41036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@Trott
Copy link
Member

Trott commented Dec 4, 2021

Does the regexp literal stop throwing an error in no-icu builds if we change XID to ID?

/[\p{ID_Start}_]\p{ID_Continue}*/u;

EDIT: Based on the table in https://nodejs.org/dist/latest-v17.x/docs/api/intl.html#options-for-building-nodejs, I'd expect that it still wouldn't work, but I'm building a non-icu node right now to confirm.

EDIT: I also don't see any elegant way to do feature detection for regexp property class names other than try / catch. Correction welcome.

@nodejs/i18n-api

@Trott
Copy link
Member

Trott commented Dec 4, 2021

EDIT: Based on the table in https://nodejs.org/dist/latest-v17.x/docs/api/intl.html#options-for-building-nodejs, I'd expect that it still wouldn't work, but I'm building a non-icu node right now to confirm.

On the other hand, the spec seems to say that ID_START is required but XID_START is not, so maybe V8 handles it even without Node.js compiling ICU?

@richardlau
Copy link
Member Author

Fwiw the highlight.js change that introduced the regexp is highlightjs/highlight.js#3280. Do we highlight Python anywhere in our docs? Maybe we could minimally load highlight.js and only register the languages we expect to highlight in our docs?

@Trott
Copy link
Member

Trott commented Dec 4, 2021

If all else fails, another possibility might be to skip building (or at least syntax highlighting) docs on without-intl builds.

@Trott
Copy link
Member

Trott commented Dec 4, 2021

Does the regexp literal stop throwing an error in no-icu builds if we change XID to ID?

Confirmed that it throws an error still with that change.

@Trott
Copy link
Member

Trott commented Dec 4, 2021

Do we highlight Python anywhere in our docs?

Based on grep -rl '```py' doc/, it seems that we do not.

Maybe we could minimally load highlight.js and only register the languages we expect to highlight in our docs?

That seems like a feature highlight.js supports, based on https://www.npmjs.com/package/highlight.js.

@Trott
Copy link
Member

Trott commented Dec 4, 2021

That seems like a feature highlight.js supports, based on https://www.npmjs.com/package/highlight.js.

LOL! This is the way we're actually doing it already, but we're still importing everything at the outset. The fix here is a single line change to html.mjs. PR coming in a few minutes.

Trott added a commit to Trott/io.js that referenced this issue Dec 4, 2021
Importing everything from highlight.js won't work in without-intl
builds. Import only core, as the code is already written to load
individual languages as needed.

Fixes: nodejs#41077
@Trott
Copy link
Member

Trott commented Dec 4, 2021

Also, I'm kind of wondering if we want to require at least a minimal intl. I'm not sure what the use case is for --without-intl though so maybe that's short-sighted. (Maybe it's for a small build size for constrained environments like IoT?)

@aduh95
Copy link
Contributor

aduh95 commented Dec 4, 2021

Also, I'm kind of wondering if we want to require at least a minimal intl. I'm not sure what the use case is for --without-intl though so maybe that's short-sighted. (Maybe it's for a small build size for constrained environments like IoT?)

Related: #35942

@Trott
Copy link
Member

Trott commented Dec 4, 2021

Oof... make lint-js fails on --without-intl builds for similar reasons.

Trott added a commit to Trott/io.js that referenced this issue Dec 4, 2021
Importing everything from highlight.js won't work in without-intl
builds. Import only core, as the code is already written to load
individual languages as needed.

Fixes: nodejs#41077
@aduh95
Copy link
Contributor

aduh95 commented Dec 4, 2021

Oof... make lint-js fails on --without-intl builds for similar reasons.

It's been a while I think.. I noticed it when working on deprecating punycode, but since no one complained I assumed it was a known limitation. Commenting out the faulty regex locally works btw, maybe replacing it with a new RegExp call would too.

Trott added a commit to Trott/io.js that referenced this issue Dec 4, 2021
Importing everything from highlight.js won't work in without-intl
builds. Import only core and register only the languages we need.

Fixes: nodejs#41077
Trott added a commit to Trott/io.js that referenced this issue Dec 5, 2021
Trott added a commit to Trott/io.js that referenced this issue Dec 5, 2021
Trott added a commit to Trott/io.js that referenced this issue Dec 5, 2021
@richardlau richardlau mentioned this issue Dec 6, 2021
Trott added a commit to Trott/io.js that referenced this issue Dec 7, 2021
PR-URL: nodejs#41091
Fixes: nodejs#41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
@Trott Trott closed this as completed in ce66633 Dec 7, 2021
danielleadams pushed a commit that referenced this issue Dec 13, 2021
Recent upgrade of highlight.js has broken the docs build on the
withoutintl builds.

PR-URL: #41078
Refs: #41077
Refs: #41036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit that referenced this issue Dec 13, 2021
Closes: #41077

PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Dec 13, 2021
PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Dec 14, 2021
Recent upgrade of highlight.js has broken the docs build on the
withoutintl builds.

PR-URL: #41078
Refs: #41077
Refs: #41036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit that referenced this issue Dec 14, 2021
Closes: #41077

PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Dec 14, 2021
PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Jan 31, 2022
Recent upgrade of highlight.js has broken the docs build on the
withoutintl builds.

PR-URL: #41078
Refs: #41077
Refs: #41036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit that referenced this issue Jan 31, 2022
Closes: #41077

PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Jan 31, 2022
PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Jan 31, 2022
Recent upgrade of highlight.js has broken the docs build on the
withoutintl builds.

PR-URL: #41078
Refs: #41077
Refs: #41036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit that referenced this issue Jan 31, 2022
Closes: #41077

PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Jan 31, 2022
PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Jan 31, 2022
Recent upgrade of highlight.js has broken the docs build on the
withoutintl builds.

PR-URL: nodejs#41078
Refs: nodejs#41077
Refs: nodejs#41036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Jan 31, 2022
Closes: nodejs#41077

PR-URL: nodejs#41091
Fixes: nodejs#41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Linkgoron pushed a commit to Linkgoron/node that referenced this issue Jan 31, 2022
PR-URL: nodejs#41091
Fixes: nodejs#41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Feb 1, 2022
Recent upgrade of highlight.js has broken the docs build on the
withoutintl builds.

PR-URL: #41078
Refs: #41077
Refs: #41036
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
danielleadams pushed a commit that referenced this issue Feb 1, 2022
Closes: #41077

PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
danielleadams pushed a commit that referenced this issue Feb 1, 2022
PR-URL: #41091
Fixes: #41077
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
5 participants