-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
add wasm md4 implementation #14584
add wasm md4 implementation #14584
Conversation
For maintainers only:
|
expose createHash is loader context
Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon. |
Passing note: I think this will need to be shared with / updated in loader-utils 2.x that used md4 in |
} | ||
|
||
function body(size: u32): void { | ||
let _A = A; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just interesting what is a reason of this variables? (you can use A,B,C,D
) same for a,b,c,d
using in current block reduce module size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A
is a global and _A
a local var. I tried to avoid accessing globals too often
digest(type) { | ||
const { exports, buffered, mem, digestSize } = this; | ||
exports.final(buffered); | ||
this.instancesPool.push(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe instancesPool
does not make much sense.. 64kb ram is a lot =)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If they are not pooled this would call new WebAssembly.Instance
very often. I assumed that might be expensive, but I can try to benchmark if that's true.
@@ -539,7 +539,9 @@ class NormalModule extends Module { | |||
? getContextifyInContext()(request) | |||
: getContextify()(context, request); | |||
}, | |||
createHash | |||
createHash: type => { | |||
return createHash(type || compilation.outputOptions.hashFunction); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
When using latest node, webpack produces an error, Error: error:0308010C:digital envelope routines::unsupported webpack/webpack#14532 This is due to the webpack version being 5.53.0 when running npm install. The error is fixed in 5.61.0 by the following merged pull request, webpack/webpack#14584 https://github.com/webpack/webpack/releases/tag/v5.61.0 When I set 5.61.0 as the minimum I now get 5.72.0 version which is latest. Build completes without error.
webpack reports an error with OpenSSL 3 [1] as webpack uses md4, which is available only from the legacy provider. Newer webpack adds a wasm implementation of md4 [2], while buildbot uses very old webpack [3]. [1] webpack/webpack#14532 [2] webpack/webpack#14584 [3] https://github.com/buildbot/buildbot/blob/v3.6.1/www/build_common/package.json#L35 git-svn-id: file:///srv/repos/svn-community/svn@1342283 9fca08f4-af9d-4005-b8df-a31f2cc04f65
webpack reports an error with OpenSSL 3 [1] as webpack uses md4, which is available only from the legacy provider. Newer webpack adds a wasm implementation of md4 [2], while buildbot uses very old webpack [3]. [1] webpack/webpack#14532 [2] webpack/webpack#14584 [3] https://github.com/buildbot/buildbot/blob/v3.6.1/www/build_common/package.json#L35 git-svn-id: file:///srv/repos/svn-community/svn@1342283 9fca08f4-af9d-4005-b8df-a31f2cc04f65
When using latest node, webpack produces an error, Error: error:0308010C:digital envelope routines::unsupported webpack/webpack#14532 This is due to the webpack version being 5.53.0 when running npm install. The error is fixed in 5.61.0 by the following merged pull request, webpack/webpack#14584 https://github.com/webpack/webpack/releases/tag/v5.61.0 When I set 5.61.0 as the minimum I now get 5.72.0 version which is latest. Build completes without error.
When using latest node, webpack produces an error, Error: error:0308010C:digital envelope routines::unsupported webpack/webpack#14532 This is due to the webpack version being 5.53.0 when running npm install. The error is fixed in 5.61.0 by the following merged pull request, webpack/webpack#14584 https://github.com/webpack/webpack/releases/tag/v5.61.0 When I set 5.61.0 as the minimum I now get 5.72.0 version which is latest. Build completes without error.
When using latest node, webpack produces an error, Error: error:0308010C:digital envelope routines::unsupported webpack/webpack#14532 This is due to the webpack version being 5.53.0 when running npm install. The error is fixed in 5.61.0 by the following merged pull request, webpack/webpack#14584 https://github.com/webpack/webpack/releases/tag/v5.61.0 When I set 5.61.0 as the minimum I now get 5.72.0 version which is latest. Build completes without error.
node 17 switched to openssl 3, which has some incompatibilities with older versions, see https://nodejs.org/en/blog/release/v17.0.0#openssl-3-0 webpack 4 relies on the older openssl version, only webpack 5 and newer uses openssl 3, see webpack/webpack#14532 (comment) webpack/webpack#14584 That's why we use the --openssl-legacy-provider node option when running webpack.
node 17 switched to openssl 3, which has some incompatibilities with older versions, see https://nodejs.org/en/blog/release/v17.0.0#openssl-3-0 webpack 4 relies on the older openssl version, only webpack 5 and newer uses openssl 3, see webpack/webpack#14532 (comment) webpack/webpack#14584 That's why we use the --openssl-legacy-provider node option when running webpack.
Node v17.0.0 changed to use OpenSSL 3.0 which no longer allows certain hashing algorithms by default. This breaks the version of webpack and, as a consequence, storybook we are currently using as it uses one of the now disallowed algorithms (MD4). This is fixed in later versions of webpack where support was added to generate MD4 hashs directly rather than via OpenSSL. To resolve this in webpack I have updated to the earliest version that contains their fix, v4.47.0. This version was chosen rather than a more recent version so we don't have to update all of our dependencies at this time. I have used a different approach for storybook as it would require considerable time and effort to update to a version that uses a fixed version of webpack. We just allow OpenSSL to use "legacy" algorithms using the NODE_OPTIONS=--openssl-legacy-provider environment variable. See for discussion: - https://stackoverflow.com/a/73027407 - webpack/webpack#14532 - https://nodejs.org/en/blog/release/v17.0.0#openssl-30 See for fix in webpack: - webpack/webpack#14584 - https://github.com/webpack/webpack/releases/tag/v4.47.0
* Resolve "error:0308010C:digital envelope routines::unsupported" Node v17.0.0 changed to use OpenSSL 3.0 which no longer allows certain hashing algorithms by default. This breaks the version of webpack and, as a consequence, storybook we are currently using as it uses one of the now-disallowed algorithms (MD4). This is fixed in later versions of webpack where support was added to generate MD4 hashs directly rather than via OpenSSL. To resolve this in webpack I have updated to the earliest version that contains their fix, v4.47.0. This version was chosen rather than a more recent version so we don't have to update all of our dependencies at this time. I have used a different approach for storybook as it would require considerable time and effort to update to a version that uses a fixed version of webpack. We just allow OpenSSL to use "legacy" algorithms using the NODE_OPTIONS=--openssl-legacy-provider environment variable. See for discussion: - https://stackoverflow.com/a/73027407 - webpack/webpack#14532 - https://nodejs.org/en/blog/release/v17.0.0#openssl-30 See for fix in webpack: - webpack/webpack#14584 - https://github.com/webpack/webpack/releases/tag/v4.47.0
When using latest node, webpack produces an error, Error: error:0308010C:digital envelope routines::unsupported webpack/webpack#14532 This is due to the webpack version being 5.53.0 when running npm install. The error is fixed in 5.61.0 by the following merged pull request, webpack/webpack#14584 https://github.com/webpack/webpack/releases/tag/v5.61.0 When I set 5.61.0 as the minimum I now get 5.72.0 version which is latest. Build completes without error.
expose createHash is loader context
fixes #14532
What kind of change does this PR introduce?
bugfix
Did you add tests for your changes?
yes
Does this PR introduce a breaking change?
no
What needs to be documented once your changes are merged?
nothing