Open Bug 1831371 Opened 1 year ago Updated 10 months ago

When installing firefox via mach build if the NODE_OPTIONS env variable is set to something in my case `--openssl-legacy-provider` it would break the build and not recognize node binary

Categories

(Firefox Build System :: General, defect, P3)

Firefox 114
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: nikunjgoyal31, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36

Steps to reproduce:

Try

$ curl https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py -O
$ python3 bootstrap.py

for linux. Then set the env variable NODE_OPTIONS=--openssl-legacy-provider.
Now running ./mach build will break.

A solution would be unsetting NODE_OPTIONS variable in the script before it is run: https://searchfox.org/mozilla-central/rev/5c922d8b93b43c18bf65539bfc72a30f84989003/build/moz.configure/node.configure#35

Actual results:

Build will break and you will receive this error

ERROR: could not find Node.js executable later than 12.22.12; ensurenodeornodejsis in PATH or set NODEJS in environment to point to an executable.

Expected results:

Build should have successfully completed

Component: Untriaged → General
Product: Firefox → Firefox Build System

What if someone has good reasons to set NODE_OPTIONS to a value that doesn't break anything?

Yeah, agreed. I think it'd be better to just fall back to the next node in the path if we can't. The reported had a node 18 which was working, it's just that mach didn't find it because it found the mozbuild one first but that didn't work.

Severity: -- → S3
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.