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

(v6.x backport) tools: require function declarations #13774

Closed
wants to merge 54 commits into from

Conversation

Trott
Copy link
Member

@Trott Trott commented Jun 19, 2017

Backport of #12711

danbev and others added 30 commits June 17, 2017 19:42
When upgrading OpenSSL, Step 6 in upgrading guide explains the steps
that need to be taken if asm files need updating. This might not
always be the case and something that needs to be checked from
release to release.

This commit adds an example of using github to manually compare two tags
to see if any changes were made to asm files.

PR-URL: nodejs#13234
Backport-PR-URL: nodejs#13695
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
This replaces all sources of openssl-1.0.2l.tar.gz into
deps/openssl/openssl

Fixes: nodejs#13161
PR-URL: nodejs#13233
Backport-PR-URL: nodejs#13695
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
All symlink files in deps/openssl/openssl/include/openssl/ are removed
and replaced with real header files to avoid issues on Windows. Two
files of opensslconf.h in crypto and include dir are replaced to refer
config/opensslconf.h.

Fixes: nodejs#13161
PR-URL: nodejs#13233
Backport-PR-URL: nodejs#13695
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
`x86masm.pl` was mistakenly using .486 instruction set, why `cpuid` (and
perhaps others) are requiring .686 .

Fixes: nodejs#589
PR-URL: nodejs#1389
Backport-PR-URL: nodejs#13695
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Shigeki Ohtsu <ohtsu@iij.ad.jp>
See
https://mta.openssl.org/pipermail/openssl-dev/2015-February/000651.html

iojs needs to stop using masm and move to nasm or yasm on Win32.

Fixes: nodejs#589
PR-URL: nodejs#1389
Backport-PR-URL: nodejs#13695
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reapply b910613 .

Fixes: nodejs#589
PR-URL: nodejs#1389
Backport-PR-URL: nodejs#13695
Reviewed-By: Fedor Indutny <fedor@indutny.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
In openssl s_client on Windows, RAND_screen() is invoked to initialize
random state but it takes several seconds in each connection.
This added -no_rand_screen to openssl s_client on Windows to skip
RAND_screen() and gets a better performance in the unit test of
test-tls-server-verify.
Do not enable this except to use in the unit test.

Fixes: nodejs#1461
PR-URL: nodejs#1836
Backport-PR-URL: nodejs#13695
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Regenerate config files for supported platforms with Makefile.

Fixes: nodejs#13161
PR-URL: nodejs#13233
Backport-PR-URL: nodejs#13695
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Regenerate asm files with Makefile and CC=gcc and ASM=nasm where gcc
version was 5.4.0 and nasm version was 2.11.08.

Also asm files in asm_obsolete dir to support old compiler and
assembler are regenerated without CC and ASM envs.

Fixes: nodejs#13161
PR-URL: nodejs#13233
Backport-PR-URL: nodejs#13695
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Added the missing make command in steps 6.3 when building
asm_obsolete.

Also updated the commit message to include the version nasm in
addition to the gcc version.

Fixes: nodejs#13161
PR-URL: nodejs#13233
Backport-PR-URL: nodejs#13695
Reviewed-By: Shigeki Ohtsu <ohtsu@ohtsu.org>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
PR-URL: nodejs#11167
Backport-PR-URL: nodejs#13054
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#11167
Backport-PR-URL: nodejs#13054
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#11658
Backport-PR-URL: nodejs#13054
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
- fix a number of uppercase types
- lowercase 'integer'
- consistent formatting in crypto

PR-URL: nodejs#11697
Backport-PR-URL: nodejs#13054
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Refactor test for situations where it was expected to fail.
Move from disabled directory to parallel.

PR-URL: nodejs#12403
Backport-PR-URL: nodejs#13060
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Ref: nodejs#12442
PR-URL: nodejs#12489
Backport-PR-URL: nodejs#13103
Reviewed-By: Matthew Loring <mattloring@google.com>
Reviewed-By: Julien Gilli <jgilli@nodejs.org>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Add documentation for `common.crashOnUnhandledRejection()`.

Ref: https://github.com/nodejs/node/pull/12489/files/a9c2078a60bc3012dc6156df19772697a56a2517#r113737423
PR-URL: nodejs#12699
Backport-PR-URL: nodejs#13103
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Santiago Gimeno <santiago.gimeno@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This is a partial backport of semver-patch bits of
9e4660b.

This commit fixes the Node process crashing when constructors of classes
of the zlib module are given invalid options.

* Throw an Error when the zlib library rejects the value of windowBits,
  instead of crashing with an assertion.

* Treat windowBits and memLevel options consistently with other ones and
  don't crash when non-numeric values are given.

PR-URL: nodejs#13098
Backport-PR-URL: nodejs#13201
Fixes: nodejs#13082
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Functions that call `ECDH::BufferToPoint` were not clearing the
error stack on failure, so an invalid key could leave leftover
error state and cause subsequent (unrelated) signing operations
to fail.

PR-URL: nodejs#13275
Backport-PR-URL: nodejs#13397
Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This is a local patch because upstream fixed it differently by moving
large chunks of code out of objects.h.  We cannot easily back-port
those changes due to their size and invasiveness.

Fixes: nodejs#10388
PR-URL: nodejs#12392
Backport-PR-URL: nodejs#13574
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
The test uses common.PORT, and has already been deleted on master.

PR-URL: nodejs#13580
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
They tend to hang if they happen to run in parallel with another test
that uses common.PORT.

PR-URL: nodejs#13592
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
PR-URL: nodejs#10944
Backport-PR-URL: nodejs#13751
Reviewed-By: Josh Gavant <joshgavant@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
PR-URL: nodejs#12102
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
PR-URL: nodejs#12109
Reviewed-By: James M Snell <jasnell@gmail.com>
Ref: nodejs#9399
PR-URL: nodejs#11681
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1. necessarily reliably => necessarily reliable
2. projects root directory => project's root directory
3. remove `console` highlighting, as `test` alone is highlighted
4. fix broken link for Android NDK
5. highlight the directory location `/usr/local/ssl/fips-2.0`
6. update expected output to an example for `process.versions.openssl` as the
   version displayed is not mentioned in the document

PR-URL: nodejs#11963

Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
This commit adds C++ tests for `base64_encode()` and `base64_decode()`
functions defined in `base64.h`.  The functionality is already being
tested indirectly in JavaScript tests for Buffer, but it won't hurt to
test the low-level functions too, especially given that they aren't only
used in the internal Buffer implementation, Chrome inspector protocol
support relies upon them too.

PR-URL: nodejs#12238
Refs: nodejs#12146 (comment)
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Use no-restricted-syntax to implement the requirement that `Error`
objects must be thrown with the `new` keyword.

PR-URL: nodejs#12249
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Teddy Katz <teddy.katz@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Remove tls_server.js that has been disabled for about 6 years. It
appears to have worked in concert with some other file which has since
been removed. It seems to create a server and set up a bunch of
listeners, but it does not appear to have code that connects to the
server and triggers any of those listeners.

PR-URL: nodejs#12275
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
vsemozhetbyt and others added 8 commits June 18, 2017 23:11
* Improve UX in 2 code examples (add spaces between output and input
  for better readability).

* Replace indexOf() by startsWith().

PR-URL: nodejs#12634
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Removed common.PORT from test-regress-nodejsGH-5051 and
test-regress-nodejsGH-5727 in order to eliminate the possibility
of port collision.

Refs: nodejs#12376
PR-URL: nodejs#12639
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Start the transition to Array.prototype.includes() and
String.prototype.includes().  This commit refactors most of the
comparisons of Array.prototype.indexOf() and String.prototype.indexOf()
return values with -1 to the former methods in tests.

PR-URL: nodejs#12604
Refs: nodejs#12586
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
`node_trace.*.log` files are generated by `NodeTraceWriter`.

Refs: nodejs#9304
PR-URL: nodejs#12754
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Delete invalid parameter.

Fixes: nodejs#8153
PR-URL: nodejs#12767
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: David Cai <davidcai1993@yahoo.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Passes --enable-static to ./configure.

PR-URL: nodejs#12764
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Replace function expressions with function declarations in preparation
for a lint rule requiring function declarations.

PR-URL: nodejs#12711
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Except for arrow functions, require function declarations instead of
function expressions via linting. This is the predominant style in our
code base (77 instances of expressions to 2344 instances of
declarations).

PR-URL: nodejs#12711
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@nodejs-github-bot nodejs-github-bot added crypto Issues and PRs related to the crypto subsystem. http Issues or PRs related to the http subsystem. tls Issues and PRs related to the tls subsystem. tools Issues and PRs related to the tools directory. v6.x labels Jun 19, 2017
@Trott Trott mentioned this pull request Jun 19, 2017
2 tasks
@gibfahn
Copy link
Member

gibfahn commented Jun 19, 2017

@gibfahn
Copy link
Member

gibfahn commented Jun 20, 2017

@Trott couple of CI failures here, can you take a look?

@Trott
Copy link
Member Author

Trott commented Jun 20, 2017

Test failures seem to be unrelated, but I'd feel better about it if there weren't so many of them (three hosts failed)...

@Trott
Copy link
Member Author

Trott commented Jun 20, 2017

Two arm failures seem like flaky tests but ¯\(ツ)

https://ci.nodejs.org/job/node-test-commit-arm/10439/nodes=centos7-arm64/console:

not ok 1347 parallel/test-child-process-stdio-big-write-end
  ---
  duration_ms: 120.43
  severity: fail
  stack: |-
    timeout
  ...

https://ci.nodejs.org/job/node-test-commit-arm/10439/nodes=ubuntu1604-arm64/console:

not ok 1236 known_issues/test-stdout-buffer-flush-on-exit
  ---
  duration_ms: 11.436
  severity: fail
  stack: |-

Test failure on smartos seems like something got stuck and is preventing tests from using common.PORT:

https://ci.nodejs.org/job/node-test-commit-smartos/9728/nodes=smartos14-64/console:

not ok 1287 sequential/test-debug-signal-cluster
  ---
  duration_ms: 60.157
  severity: fail
  stack: |-
    timeout
  ...
[...]
not ok 1289 sequential/test-debugger-repeat-last
  ---
  duration_ms: 60.143
  severity: fail
  stack: |-
    timeout
  ...
not ok 1290 sequential/test-debugger-util-regression
  ---
  duration_ms: 60.147
  severity: fail
  stack: |-
    timeout
...
[...]
not ok 1296 sequential/test-http-regr-gh-2928
  ---
  duration_ms: 0.277
  severity: fail
  stack: |-
    events.js:160
          throw er; // Unhandled 'error' event
          ^
    
    Error: listen EADDRINUSE :::12346
        at Object.exports._errnoException (util.js:1018:11)
        at exports._exceptionWithHostPort (util.js:1041:20)
        at Server._listen2 (net.js:1258:14)
        at listen (net.js:1294:10)
        at Server.listen (net.js:1390:5)
        at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/sequential/test-http-regr-gh-2928.js:59:4)
        at Module._compile (module.js:570:32)
        at Object.Module._extensions..js (module.js:579:10)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)
...
[...]
not ok 1304 sequential/test-pipe
  ---
  duration_ms: 0.418
  severity: fail
  stack: |-
    events.js:160
          throw er; // Unhandled 'error' event
          ^
    
    Error: listen EADDRINUSE :::12346
        at Object.exports._errnoException (util.js:1018:11)
        at exports._exceptionWithHostPort (util.js:1041:20)
        at Server._listen2 (net.js:1258:14)
        at listen (net.js:1294:10)
        at Server.listen (net.js:1390:5)
        at Object.<anonymous> (/home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/sequential/test-pipe.js:46:5)
        at Module._compile (module.js:570:32)
        at Object.Module._extensions..js (module.js:579:10)
        at Module.load (module.js:487:32)
        at tryModuleLoad (module.js:446:12)
...
[...]
not ok 1310 sequential/test-regress-GH-784
  ---
  duration_ms: 0.274
  severity: fail
  stack: |-
    Error making ping req: Error: Parse Error
    Error making ping req: Error: Parse Error
    making req
    making req
    afterPing. responses.length = 1
    afterPing. responses.length = 2
    process.on('exit')
    [ 'Parse Error', 'Parse Error' ]
    
    assert.js:81
      throw new assert.AssertionError({
      ^
    AssertionError: false == true
        at afterPing (/home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/sequential/test-regress-GH-784.js:54:14)
        at ClientRequest.<anonymous> (/home/iojs/build/workspace/node-test-commit-smartos/nodes/smartos14-64/test/sequential/test-regress-GH-784.js:115:5)
        at emitOne (events.js:96:13)
        at ClientRequest.emit (events.js:188:7)
        at Socket.socketOnData (_http_client.js:367:9)
        at emitOne (events.js:96:13)
        at Socket.emit (events.js:188:7)
        at readableAddChunk (_stream_readable.js:176:18)
        at Socket.Readable.push (_stream_readable.js:134:10)
        at TCP.onread (net.js:547:20)

@gibfahn
Copy link
Member

gibfahn commented Jun 20, 2017

CI reloaded: https://ci.nodejs.org/job/node-test-commit/10682/

EDIT: Green

@gibfahn gibfahn force-pushed the v6.x-staging branch 2 times, most recently from 6ef8c5b to 4c2fa3d Compare June 20, 2017 19:04
gibfahn pushed a commit that referenced this pull request Jun 20, 2017
Replace function expressions with function declarations in preparation
for a lint rule requiring function declarations.

PR-URL: #12711
Backport-PR-URL: #13774
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
gibfahn pushed a commit that referenced this pull request Jun 20, 2017
Except for arrow functions, require function declarations instead of
function expressions via linting. This is the predominant style in our
code base (77 instances of expressions to 2344 instances of
declarations).

PR-URL: #12711
Backport-PR-URL: #13774
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@gibfahn
Copy link
Member

gibfahn commented Jun 20, 2017

Landed in 95731fe b58972a

@gibfahn gibfahn closed this Jun 20, 2017
MylesBorins pushed a commit that referenced this pull request Jul 11, 2017
Replace function expressions with function declarations in preparation
for a lint rule requiring function declarations.

PR-URL: #12711
Backport-PR-URL: #13774
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
MylesBorins pushed a commit that referenced this pull request Jul 11, 2017
Except for arrow functions, require function declarations instead of
function expressions via linting. This is the predominant style in our
code base (77 instances of expressions to 2344 instances of
declarations).

PR-URL: #12711
Backport-PR-URL: #13774
Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
@Trott Trott deleted the backport-12711 branch January 13, 2022 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
crypto Issues and PRs related to the crypto subsystem. http Issues or PRs related to the http subsystem. tls Issues and PRs related to the tls subsystem. tools Issues and PRs related to the tools directory.
Projects
None yet
Development

Successfully merging this pull request may close these issues.