Closed Bug 1470332 Opened 6 years ago Closed 1 year ago

teach `mach bootstrap` to check and try to update Node to version 8.latest on Ubuntu and Mac

Categories

(Firefox Build System :: Bootstrap Configuration, enhancement)

All
Unspecified
enhancement

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: dmosedale, Unassigned)

Details

User Story

As a Firefox developer on Mac or Ubuntu Linux (one Linux distro widely used by Firefox developers), running "mach bootstrap" should install or update Node to version 8.latest.

As a Firefox developer on an OS where "mach bootstrap" does not yet detect install Node 8.latest, it should be straightforward to patch it to do so, so that I can make it things Just Work for other users of that OS who need a current version of Node.

Acceptance criteria:

* base.py class has version detection and handling similar to that of Python, with explicit next steps for filing a bug, working around, and implementing emitted on not-yet-supported systems
* debian.py has support for installing a suitable version on Ubuntu from NodeSource or erroring out with a clear description of next steps
* osx.py has support for installing a suitable version from Homebrew (and ideally MacPorts)

Attachments

(1 file)

When we introduce the requirement for NodeJS 8 into the build system, "mach bootstrap" should attempt to install or upgrade to NodeJS 8.latest.  The details and strategy are in the User Story field.
User Story: (updated)
Iteration: 63.1 - July 9 → 63.2 - July 23
Comment on attachment 8990884 [details]
Bug 1470332 - teach 'mach bootstrap' to install Node on Debian/Ubuntu,

https://reviewboard.mozilla.org/r/255888/#review262728

This looks mostly good. I found a few issues blocking landing, however.

::: python/mozboot/mozboot/base.py:592
(Diff revision 1)
> +        for test in ['nodejs', 'node']:
> +            node = self.which(test)
> +            if node:
> +                break
> +
> +        assert node

This seems out of place.

::: python/mozboot/mozboot/debian.py:201
(Diff revision 1)
> +        node_setup_url = "https://deb.nodesource.com/setup_8.x"
> +
> +        # hash created by hand against current version of script by sha256sum
> +        setup_hash = "84d4d2b394eb3a16dcbcf89c8f7c223eec5eb96bc2f88dee617085566986966d"

I'm guessing this URL can change out from under us. Is there a pinned URL we can use so the content is immutable and our hash will always work?
Attachment #8990884 - Flags: review?(gps) → review-
Comment on attachment 8990884 [details]
Bug 1470332 - teach 'mach bootstrap' to install Node on Debian/Ubuntu,

https://reviewboard.mozilla.org/r/255888/#review262728

> This seems out of place.

This was just following the identical pattern from is_python_modern().  I'm happy to drop it, though, if you wish.

> I'm guessing this URL can change out from under us. Is there a pinned URL we can use so the content is immutable and our hash will always work?

I'm assuming that the URL itself won't change, but that the content itself might, and as you point out, that's a bit fragile.  I've filed https://github.com/nodesource/distributions/issues/694 and perhaps that will shed some light on it...
Iteration: 63.2 - July 23 → 63.3 - Aug 6
There is currently not a plan to drive this code into the tree, as we've switched strategies to using toolchain archives for the platforms that Mozilla itself ships on.  Resolving as 

That said, I think if someone on a not-directly-supported distribution wishes to use this as way to teach mach bootstrap to use a package manager to install node on their OS, I suspect we _would_ accept patches along these lines, potentially even just an evolution of this patch.  :gps, can you confirm this?
Assignee: dmose → nobody
No longer blocks: as-build-meta, 1464123
Iteration: 63.3 - Aug 6 → ---
Flags: needinfo?(gps)
Priority: P1 → --
The toolchain archive work is being tracked over in bug 1481693.
Yes, we would accept bootstrap patches for non-tier 1 platforms to install Node using the system package manager.
Flags: needinfo?(gps)
Severity: normal → S3

Bootstrap now installs node locally, and updates as appropriate, so I believe this is WFM now.

Status: NEW → RESOLVED
Closed: 1 year ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: