Open Bug 1490802 Opened 1 year ago Updated 1 year ago

mach bootstrap fails on windows with too long path for node module

Categories

(Firefox Build System :: Bootstrap Configuration, defect)

defect
Not set

Tracking

(Not tracked)

People

(Reporter: Gankra, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

Attachments

(1 file)

Edit: See [this comment for instructions on how to workaround this issue](https://bugzilla.mozilla.org/show_bug.cgi?id=1490802#c5).

Was trying to run into to make sure I had node properly set up, but got this:

WindowsError: [Error 206] The filename or extension is too long: '.\\node\\node_modules\\npm\\node_modules\\npm-profile\\node_modules\\make-fetch-happen\\node_modules\\https-proxy-agent\\node_modules\\agent-base\\node_modules\\es6-promisify\\node_modules\\es6-promise\\lib\\es6-promise\\promise'

Windows 10, running mozillabuild in C:/gecko

It got me far enough to get past configure, but I'm still running a clean build now to see if my build system is even coherent.
Attached file bootstrap-log.txt
full log attached
In theory, npm the version of that we're shipping is supposed to have fixed this, so I'm not sure why we're hitting it:

https://stackoverflow.com/questions/26155135/node-npm-windows-file-paths-are-too-long-to-install-packages

I'm also not sure why more people haven't encountered this bug.

I suspect we're going to end up using yarn rather than npm, so we may be able to workaround whatever the problem is just by removing npm from our repacks.
(In reply to Dan Mosedale (:dmose, :dmosedale) from comment #2)
> I'm also not sure why more people haven't encountered this bug.

I just ran into this issue, that I solved by moving the MOZBUILD_STATE_PATH folder to a different location.
Thanks for the workaround, Paolo!  Having looked at one of the archives for the newest version of node 8, I suspect the version when we upgrade our version of node to 8.12.0, the version of npm included there will have much shorter paths.

Just writing this out so I can just copy-paste this anytime I run into it:

  • make a dir with a very short path (I picked: C:/a/)
  • MOZBUILD_STATE_PATH=C:/a/ ./mach bootstrap now works!
  • Add export MOZBUILD_STATE_PATH=C:/a/ to your mozconfig(s)
  • ./mach build now works! (if you skipped the previous step, you can always manually pass MOZBUILD_STATE_PATH to mach build)

Note: if you get errors with putting MOZBUILD_STATE_PATH in your mozconfig (some deps will randomly fail to be found), you may need to update MozillaBuild (follow the instructions exactly!) https://wiki.mozilla.org/MozillaBuild

Note: you still need to pass MOZBUILD_STATE_PATH to mach boostrap, as it doesn't read mozconfigs (aiui)


Can we get this bug added to mach busted, so its easier to find/lookup?

I haven't been able to find any docs on how to nominate a bug for adding to mach busted, but I bet :nalexander knows...

Flags: needinfo?(nalexander)

(In reply to Dan Mosedale (:dmose, :dmosedale) from comment #6)

I haven't been able to find any docs on how to nominate a bug for adding to mach busted, but I bet :nalexander knows...

Yep: you just add it to the dependency tree of https://bugzilla.mozilla.org/show_bug.cgi?id=mach-busted, which I have done.

Blocks: mach-busted
Flags: needinfo?(nalexander)

My current suspicion is that once bug 1547823 gets fixed, that will also resolved this bug. Marking that bug as a dependency (though technically this bug could be fixed separately from that).

Depends on: 1547823
Duplicate of this bug: 1569801

There's no reason we can't update the node version bootstrap installs without touching the base version we use to build on automation. We can even update the version used on automation, as long as we keep the base-toolchain jobs using the oldest version we support.

That's certainly true. I was just describing my suspicion of what situation was likely to get someone signing up to do the work soonest, based on my current knowledge of the players involved, which is unlikely to be comprehensive.

You need to log in before you can comment on or make changes to this bug.