Bug 259377 - www/node: Fails to package with BUNDLED_SSL=ON: pkg-static: Unable to access file ... node/openssl/rand_drbg.h:No such file or directory
Summary: www/node: Fails to package with BUNDLED_SSL=ON: pkg-static: Unable to access ...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Bradley T. Hughes
URL:
Keywords: needs-qa, patch
: 259423 259489 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-10-23 13:07 UTC by Ivan Rozhuk
Modified: 2021-11-10 22:25 UTC (History)
9 users (show)

See Also:
bhughes: maintainer-feedback+
koobs: merge-quarterly?


Attachments
www/node: fix pkg-plist issues with BUNDLED_SSL=on (243.08 KB, patch)
2021-10-24 21:56 UTC, Philipp Ost
no flags Details | Diff
www/node: fix pkg-plist issues with BUNDLED_SSL=on (242.74 KB, patch)
2021-10-25 13:39 UTC, Philipp Ost
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rozhuk 2021-10-23 13:07:30 UTC
pkg-static: Unable to access file /tmp/ports/usr/ports/www/node/work/stage/usr/local/include/node/openssl/rand_drbg.h:No such file or directory
Comment 1 Tomoaki AOKI 2021-10-23 23:53:24 UTC
Looks to be a simple pkg-plist issue.
The problematic file rand_drbg.h doesn't exist anywhere inside /usr/ports/www/node/work/. So it should be simply deleted.

Looking into [1] listed in commit message, bundled OpenSSL is updated to 3 from 1.1.1 and maybe causing this problem.

Possibly (not shure, though), some new files (mostly related to QUIC or FIPS support?) could be needed addition within %%BUNDLED_SSL%%include/node/openssl/ lines in pkg-plist. Only v8-related headers are handled with the commit git ports f7594b482c9b.

[1] https://nodejs.org/en/blog/release/v17.0.0/
Comment 2 Tomoaki AOKI 2021-10-24 09:15:41 UTC
Setting BUNDLED_SSL=OFF allows to build/install fine.
But this should be fixed unless this option is dropped (force OFF for everyone).

IIRC, I've never changed this option, so the default would've been reversed at some revision.
(Not enough sure as this was installed as a dependency.)
Comment 3 Ivan Rozhuk 2021-10-24 12:20:49 UTC
I use libressl so I have other way to build node.
Comment 4 Tomoaki AOKI 2021-10-24 21:56:45 UTC
(In reply to Ivan Rozhuk from comment #3)
libressl is registered as BROKEN_SSL on www/node/Makefile, so Mk/Uses/ssl.mk would disallow to build www/node with it.

You're forced to set option BUNDLED_SSL to OFF,right?
Just a bandaid (and not tested), but would be worth trying commenting out

  %%BUNDLED_SSL%%include/node/openssl/rand_drbg.h

line (430) on www/node/pkg-plist and see if it works fine or not.
Comment 5 Philipp Ost 2021-10-24 21:56:59 UTC
Created attachment 229005 [details]
www/node: fix pkg-plist issues with BUNDLED_SSL=on

The attached patch fixes this issue.
Comment 6 Kubilay Kocak freebsd_committer freebsd_triage 2021-10-25 00:28:24 UTC
*** Bug 259423 has been marked as a duplicate of this bug. ***
Comment 7 Jimmy Olgeni freebsd_committer 2021-10-25 00:30:39 UTC
(In reply to Philipp Ost from comment #5)

Watch out for the double "%%BUNDLED_SSL%%%%BUNDLED_SSL%%" :)
Comment 8 Ivan Rozhuk 2021-10-25 00:36:35 UTC
(In reply to Philipp Ost from comment #5)

work for me, thanks!
Comment 9 Ivan Rozhuk 2021-10-25 00:37:59 UTC
(In reply to Tomoaki AOKI from comment #4)

No, I use with BUNDLED_SSL=ON because only this work then libressl is used.
Comment 10 Philipp Ost 2021-10-25 13:39:20 UTC
Created attachment 229022 [details]
www/node: fix pkg-plist issues with BUNDLED_SSL=on

(In reply to Jimmy Olgeni from comment #7)

Good catch, thanks! The attached takes care of said duplicates, nothing else is changed.
Comment 11 Ivan Rozhuk 2021-10-25 21:37:41 UTC
Does files from %%BUNDLED_SSL%%include/node/openssl/ required to install?
Comment 12 Charlie Li freebsd_committer 2021-10-26 14:21:39 UTC
These additional files are installed with BUNDLED_SSL enabled and caught in check-plist, so yes.
Comment 13 Ivan Rozhuk 2021-10-27 03:45:04 UTC
(In reply to Charlie Li from comment #12)

"installed" is not a same as "used".
I many times clean some crap from stage dir while making ports.

Is these openssl files used by node after installation?
Comment 14 John Kennedy 2021-10-28 00:25:21 UTC
The 2021/10/25 patch worked for me.

I have a DEFAULT_VERSIONS += ssl=libressl, thus a OPTIONS_FILE_SET += BUNDLED_SSL for www/node.
Comment 15 Bradley T. Hughes freebsd_committer 2021-10-28 21:15:58 UTC
*** Bug 259489 has been marked as a duplicate of this bug. ***
Comment 16 Bradley T. Hughes freebsd_committer 2021-10-28 21:17:15 UTC
I am incorporating this patch along with the upgrade to 17.0.1, which I hope to push shortly. Thanks for the report! :)
Comment 17 commit-hook freebsd_committer 2021-10-29 13:42:15 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=8de43db2771a9534f9a9d67c48c46152f2843128

commit 8de43db2771a9534f9a9d67c48c46152f2843128
Author:     Bradley T. Hughes <bhughes@FreeBSD.org>
AuthorDate: 2021-10-24 18:09:51 +0000
Commit:     Bradley T. Hughes <bhughes@FreeBSD.org>
CommitDate: 2021-10-29 13:40:45 +0000

    www/node: Update 17.0.0_1 -> 17.0.1

    https://nodejs.org/en/blog/release/v17.0.1/

    While here, update pkg-plist to allow building with the BUNDLED_SSL
    option enabled, and add the patch from PR 259454 to fix the build on
    i386.

    PR:             259454, 259377
    MFH:            2021Q4
    Sponsored by:   Miles AS

 www/node/Makefile                                  |    3 +-
 www/node/distinfo                                  |    6 +-
 ...openssl_openssl_crypto_threads__pthread.c (new) |   29 +
 www/node/pkg-plist                                 | 2446 +++++++++++++++++++-
 4 files changed, 2461 insertions(+), 23 deletions(-)