Opened 3 years ago

Closed 2 years ago

#64130 closed defect (fixed)

nodejs16 @16.13.1: build fails on older OSs: error: unknown type name 'CCCryptorStatus' - appears fixed in upstream OpenSSL 1.1.1

Reported by: sambthompson (Sam Thompson) Owned by: ci42
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: mascguy (Christopher Nielsen), fhgwright (Fred Wright), ci42, cjones051073 (Chris Jones), chrstphrchvz (Christopher Chavez)
Port: openssl nodejs16

Description (last modified by sambthompson (Sam Thompson))

Attempting upgrade from @16.13.0_2. Build of deps/openssl fails in crypto/rand/rand_unix.c:

:info:build In file included from ../deps/openssl/openssl/crypto/rand/rand_unix.c:38:
:info:build /usr/include/CommonCrypto/CommonRandom.h:35:9: error: unknown type name 'CCCryptorStatus'
:info:build typedef CCCryptorStatus CCRNGStatus;
:info:build         ^
:info:build ../deps/openssl/openssl/crypto/rand/rand_unix.c:385:47: error: use of undeclared identifier 'kCCSuccess'
:info:build     if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
:info:build                                               ^
:info:build 2 errors generated.

No obvious changes in the nodejs16 branch for openssl since @16.13.0_2: https://github.com/nodejs/node/tree/v16.x/deps/openssl

openssl related installed ports are:

sam@host:~ % port installed | grep ssl
  openssl @3_1+universal (active)
  openssl3 @3.0.0_6+legacy+universal (active)
  openssl11 @1.1.1l_5+universal (active)

There's a closed ticket for openssl@1.1.1l build on older OS versions (#63404), but related to CommonRandom.h not existing in OS openssl API; CommonRandom.h does exist on 10.11.6, and has the typedef, so not clear what's up although looks like dependency hell of some kind.

Looks like the buildbot for all OSs pre High-sierra failed for 16.13.1. A check of Yosemite, El Capitan and High Sierra logs show the same errors as seen locally; see https://build.macports.org/builders/ports-10.11_x86_64-builder/builds/162879/steps/install-port/logs/stdio

For Mavericks, the error is around missing CommonRandom.h:

../deps/openssl/openssl/crypto/rand/rand_unix.c:38:11: fatal error: 'CommonCrypto/CommonRandom.h' file not found
# include <CommonCrypto/CommonRandom.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Although this was closed upstream in https://github.com/openssl/openssl/issues/16407

Given the fix applied for 1.1.1l, can't explain why this happening now.

Change History (15)

comment:1 Changed 3 years ago by sambthompson (Sam Thompson)

Description: modified (diff)

comment:2 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: mascguy added

comment:3 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: cjones051073 added
Keywords: openssl added

Adding @cjones, since this relates to OpenSSL.

comment:4 Changed 3 years ago by mascguy (Christopher Nielsen)

I'm wondering if it would make sense to revert this update for now, until it can be fixed?

Last edited 3 years ago by mascguy (Christopher Nielsen) (previous) (diff)

comment:5 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: fhgwright added

comment:6 Changed 3 years ago by mascguy (Christopher Nielsen)

It looks like this may have been fixed in OpenSSL, and is included in release tag OpenSSL_1_1_1-stable. Unfortunately it hasn't yet been included in an alphabetical 1.1.1 tag, which our OpenSSL 1.1 port is currently based off of.

Two of the OpenSSL upstream commits - with the caveat that this may not be a complete list - are:

https://github.com/openssl/openssl/commit/96ac8f13f4d0ee96baf5724d9f96c44c34b8606c

https://github.com/openssl/openssl/commit/2f3b120401533db82e99ed28de5fc8aab1b76b33

So we might want to consider fixing this by patching our OpenSSL 1.1 port for now, until those changes are officially available.

Thoughts?

comment:7 Changed 3 years ago by mascguy (Christopher Nielsen)

Cc: ci42 added; cjones051073 removed
Keywords: openssl removed
Owner: changed from ci42 to cjones051073
Port: openssl added
Summary: nodejs16 @16.13.1: build fails on older OSs: error: unknown type name 'CCCryptorStatus'nodejs16 @16.13.1: build fails on older OSs: error: unknown type name 'CCCryptorStatus' - appears fixed in upstream OpenSSL 1.1.1

comment:8 in reply to:  6 Changed 3 years ago by sambthompson (Sam Thompson)

Replying to mascguy:

So we might want to consider fixing this by patching our OpenSSL 1.1 port for now, until those changes are officially available.

That patch already exists for OpenSSL 1.1.1l in #63404 - I assume Renee's patch in this commit c755ef6 could be adapted for the embedded OpenSSL dependency that's shipped in nodejs16; I think that is still the port this ticket relates to.

However, if that's not doable, maybe this version of nodejs16 can be locked out for older OSs as you suggested earlier?

Last edited 3 years ago by sambthompson (Sam Thompson) (previous) (diff)

comment:9 Changed 3 years ago by cjones051073 (Chris Jones)

Owner: changed from cjones051073 to ci42

I don’t see this issue having anything to do with macports openssl ports, as nodejs16 is using its own internal openssl build. As such i will leave addressing this to the ports maintainer. The best solution, if practical, would be to avoid using private deps and switch to using macports openssl builds instead.

comment:10 Changed 3 years ago by cjones051073 (Chris Jones)

Cc: cjones051073 added

comment:11 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

Cc: chrstphrchvz added

comment:12 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

For those encountering this issue while installing qt5-qtwebengine or dependents on 10.13: until https://github.com/macports/macports-ports/pull/13332 is merged, you should be able to install nodejs14 instead, and have the qt5-qtwebengine build proceed.

comment:13 Changed 3 years ago by chrstphrchvz (Christopher Chavez)

In 1f90d2108d465a4ac7327ddfa62bd530b1e4bb89/macports-ports (master):

qt5-qtwebengine: requires 10.13 or later

[skip ci]

Requires Xcode 10 or later
See: #61921

nodejs16 (latest LTS) currently does not build on macOS 10.13
Fallback to installing nodejs14 (previous LTS) if needed
Use path:bin/node:… instead of bin:node:… dependency
See: #64130

comment:14 Changed 3 years ago by sambthompson (Sam Thompson)

Maybe resolved in v16.14; just got a clean upgrade to this new version, but as a pkg install, not built from source.

ETA: Yes, 16.14 gets OpenSSL v1.1.1m as bundled dependency, which includes the required fix. Port health back to Yosemite now OK.

Last edited 3 years ago by sambthompson (Sam Thompson) (previous) (diff)

comment:15 Changed 2 years ago by raimue (Rainer Müller)

Resolution: fixed
Status: assignedclosed

Closing as last comment reported this to be resolved.

Note: See TracTickets for help on using tickets.