Open Bug 1569204 Opened 6 years ago Updated 5 years ago

no way to properly set MOZBUILD_STATE_PATH from mozconfig?

Categories

(Firefox Build System :: Mach Core, defect, P4)

defect

Tracking

(Not tracked)

People

(Reporter: Gankra, Unassigned)

Details

Attachments

(2 files)

The workaround for Bug 1490802 is to use MOZBUILD_STATE_PATH to untar node in a location with a very short path (for me: C:/a/). However as a side-effect you now need to pass MOZBUILD_STATE_PATH whenever you mach build. Ok, no problem, that's what mozconfig files are for.

Except MOZBUILD_STATE_PATH doesn't seem to work properly when set by your mozconfig:

  • mach bootstrap completely ignores it, so you still need to remember that you have this hack setup whenever you want to update your tools
  • mach build partially ignores it -- if I set it via ac_add_options or export, it will properly find the clang install in that location, but it won't find the node install in that location. If I pass it on the command line like MOZCONFIG= itself, then everything works.

Is this intended? It's a bit frustrating. Is the "right" thing to do just add it to my shell's init scripts (in the same way you add things to PATH)?

Just to be totally clear: this is on windows 10, using a pretty vanilla (as far as I can remember) install of mozillabuild.

This is only an issue on windows since it's the only platform with these long path issues plaguing random libraries.

(In reply to Alexis Beingessner [:Gankro] from comment #0)

  • mach build partially ignores it -- if I set it via ac_add_options or export, it will properly find the clang install in that location, but it won't find the node install in that location. If I pass it on the command line like MOZCONFIG= itself, then everything works.

This is kind of weird. I know that clang is searched for in a number of directories, which already include the MOZBUILD_STATE_PATH.:

https://searchfox.org/mozilla-central/source/build/moz.configure/toolchain.configure#725-760

At first blush, it looks like node isn't:

https://searchfox.org/mozilla-central/source/build/moz.configure/node.configure#12-20

But tracing through find_node_executable:

https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/nodeutil.py#69-90
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/nodeutil.py#103-104
https://searchfox.org/mozilla-central/source/python/mozbuild/mozbuild/nodeutil.py#21-47
https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/util.py#13-50

suggests that we ought to be respecting MOZBUILD_STATE_PATH there as well....? It's also not clear to me why you'd get different results depending on where your environment variable is set?

it looks like it might just be checking MOZBUILD_STATE_PATH too late? It seems like it's finding some other node first (the one I had installed from before I needed to use this hack?)

 0:07.26 checking for nodejs... no
 0:07.26 ERROR: NODEJS must point to node 8.11 or newer; found node location: c:\mozilla-build\node-v8.1.4-win-x64\node.EXE.
 0:07.26     Executing `mach bootstrap --no-system-changes` should
 0:07.26     install a compatible version in ~/.mozbuild on most platforms.
 0:07.26     If you believe this is a bug, <https://mzl.la/2vLbXAv> is a good way
 0:07.26     to file.  More details: <https://bit.ly/2BbyD1E>
 0:07.32 *** Fix above errors and then restart with\
 0:07.32                "./mach build"
 0:07.34 mozmake.EXE: *** [client.mk:115: configure] Error 1

(this specific error is from export MOZBUILD_STATE_PATH=C:/a/)

I could believe that, except I think find_node_paths puts $MOZBUILD_STATE_PATH/node at the beginning of the list of paths to search.

Does $OBJDIR/config.log contain anything interesting? Or maybe dropping some log.info(...)/print calls around nodeutil would turn up something interesting...

Attached file config.log
INFO: checking for nodejs... 
INFO: no
ERROR: NODEJS must point to node 8.11 or newer; found node location: c:\mozilla-build\node-v8.1.4-win-x64\node.EXE.

Thanks a ton, uninformative build system.

doesn't look like there's anything interesting in there

don't have time at the moment to start print debugging the build system (no idea where to even start).

Attached file .mozconfig-test

Just for completeness sake, this is the test mozconfig I got that log with. Nothing really interesting, though.

Good News, I got it to work!

For unrelated reasons, I had to update MozillaBuild. After following exactly the steps listed here: https://wiki.mozilla.org/MozillaBuild

export MOZBUILD_STATE_PATH now works!

I believe bootstrap still never reads mozconfigs, though, correct?

The priority flag is not set for this bug.
:kmoir, could you have a look please?

For more information, please visit auto_nag documentation.

Flags: needinfo?(kmoir)
Flags: needinfo?(kmoir)
Priority: -- → P4
Severity: normal → S4
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: