Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Use [email protected] with Node v4 and npm v3 \o/ - #11897

Merged
nathansobo merged 46 commits into
masterfrom
mkt-use-apm-with-npm3-and-node-4
Jul 25, 2016
Merged

nathansobo merged 46 commits into
masterfrom
mkt-use-apm-with-npm3-and-node-4

Conversation

@BinaryMuse

@BinaryMuse BinaryMuse commented Jun 4, 2016 •

Copy link
Copy Markdown
Contributor
                  __              __ __
                 /\ \            /\ \\ \
  ___     ___    \_\ \     __    \ \ \\ \
/' _ `\  / __`\  /'_` \  /'__`\   \ \ \\ \_
/\ \/\ \/\ \L\ \/\ \L\ \/\  __/    \ \__ ,__\
\ \_\ \_\ \____/\ \___,_\ \____\    \/_/\_\_/
 \/_/\/_/\/___/  \/__,_ /\/____/       \/_/


                                    __
                                  /'__`\
     ___   _____     ___ ___     /\_\L\ \
   /' _ `\/\ '__`\ /' __` __`\   \/_/_\_<_
   /\ \/\ \ \ \L\ \/\ \/\ \/\ \    /\ \L\ \
   \ \_\ \_\ \ ,__/\ \_\ \_\ \_\   \ \____/
    \/_/\/_/\ \ \/  \/_/\/_/\/_/    \/___/
             \ \_\
              \/_/

This bumps apm to 1.11.1, which includes atom/apm#562 and atom/apm#563. Since npm 3 flattens packages by default, the build had to change relatively significantly, and I'm sure there are more edge cases to track down. This also bumps Atom's own npm to 3.9.5.

Of particular note, I removed the apm clean command that runs as part of the build. It didn't seem to be working in the first place, and seems to have trouble with npm 3's package flattening; maybe we can delegate to npm prune here. Since published builds get built from scratch, I think this is probably not a huge deal.

@atom/core, @atom/feedback, @damieng, I would love for you to pull down this branch and try to build Atom and make sure it runs correctly and that package-related operations work. It's extremely likely you will have to run script/clean first; sorry, things are just too different.

Fixes #5109
Makes #7822 (more) possible
Probably a bunch of others too

@BinaryMuse

Copy link
Copy Markdown
Contributor Author

As a side note, this is the first time this build is being run on GitHub's internal CI server, which has given us issues with this type of upgrade in the past — so I will probably spend a significant amount of energy (and possibly time) getting that working.

@winstliu

winstliu commented Jun 4, 2016 •

Copy link
Copy Markdown
Contributor

[apm clean] didn't seem to be working in the first place

In my experience it's worked, as it properly removed release-notes when that got cut from Atom. npm prune looks like it'll have problems with everything listed in packageDependencies (so, all of Atom's packages) as those are already marked as extraneous when running npm ls. If that can be fixed though...:+1: for using prune instead.

@Ben3eeE

Ben3eeE commented Jun 4, 2016

Copy link
Copy Markdown
Contributor

I get a build error when trying to build this branch on Windows 10. I can build master without error.
cmd log.txt
npm-debug.txt

@thomasjo

thomasjo commented Jun 4, 2016

Copy link
Copy Markdown
Contributor

@Ben3eeE Did you run script/clean prior to script/build?

@thomasjo

thomasjo commented Jun 4, 2016

Copy link
Copy Markdown
Contributor

Been running this for a few hours on OS X 10.11, and haven't noticed any regressions yet.

@winstliu

winstliu commented Jun 4, 2016

Copy link
Copy Markdown
Contributor

Ok, I get the same errors as @Ben3eeE while attempting to build on a brand-new laptop (so no Atom previously installed).

@winstliu

winstliu commented Jun 4, 2016 •

Copy link
Copy Markdown
Contributor

Perhaps this line should be set maybe_node_gyp_path=%~dp0\..\node_modules\.bin\node-gyp.cmd instead?

(Also it would be great if the set and if lines weren't outputted to the console. Not sure why they are even with @echo off.)

edit: apm.cmd needs to be changed as well. Blindly changing it to node-gyp.cmd doesn't seem to work though and it gets interpreted as a JavaScript file...

@Ben3eeE

Ben3eeE commented Jun 4, 2016

Copy link
Copy Markdown
Contributor

Yes I did script/clean before. Full list of commands I ran are in cmd log i uploaded. Included all from switching branch to error.

@winstliu

winstliu commented Jun 4, 2016

Copy link
Copy Markdown
Contributor

Solved it:

  1. Change apm.cmd to
@echo off
setlocal

if exist "%~dp0\node.exe" (
  "%~dp0\node.exe" "%~dp0/../lib/cli.js" %*
) else (
  node.exe "%~dp0/../lib/cli.js" %*
)
  1. cd into apm\node_modules\atom-package-manager\node_modules\npm\node-gyp-bin and change the path node-gyp.cmd looks for to %~dp0\..\..\..\node-gyp\bin\node-gyp.js.

Obviously this is a hacky solution, but setting npm_config_node_gyp doesn't work as described above. I'll continue investigating until I find something that works properly.

@winstliu

winstliu commented Jun 5, 2016

Copy link
Copy Markdown
Contributor

So after fixing the node-gyp issues and finishing the build process I ended up facing #10819 😦.

I also tried building on an Ubuntu 16.04 64-bit VM but got the same error as in https://travis-ci.org/atom/atom/jobs/135187713 which seems to be related to x64 compatibility.

@gjtorikian

Copy link
Copy Markdown
Contributor

So after fixing the node-gyp issues and finishing the build process I ended up facing #10819

I'm hitting the same issue in the ARM builds issue (#7822). I finally tracked the problem down to nodegit/nodegit#1026. In short, [email protected] is broken and 0.13.1 has the fix. The submodule checker is broken in 0.13.0.

NodeGit needs to publish their newest release: nodegit/nodegit#1044 (comment)

@winstliu

winstliu commented Jun 6, 2016 •

Copy link
Copy Markdown
Contributor

Ok, managed to fix the node-gyp issue with atom/apm#571. Now it's failing when trying to install Nodegit 0.13.1. Apparently it can't find node-pre-gyp.cmd, but I checked and the file exists...:confused:.

Retrying seems to have fixed it, but I'm not sure if it just skipped pre-gyp because it assumed that Nodegit installed properly, if it was a one-time thing, or if something else went wrong. I'll try again tomorrow.

Unfortunately now I'm stuck at a Error: Cannot find module '../build/Release/pathwatcher.node' error when starting Atom. Not sure if that's related to Nodegit.

edit: Now I'm getting 403 errors trying to download Nodegit...
double-edit: Looks like v0.13.1 for Windows isn't available on AWS yet. Will try again tomorrow.

@damieng

damieng commented Jun 8, 2016

Copy link
Copy Markdown
Contributor

The build servers are showing this error;

gyp: name 'openssl_fips' is not defined while evaluating condition 'openssl_fips != ""' in binding.gyp while trying to load binding.gyp

@BinaryMuse
BinaryMuse force-pushed the mkt-use-apm-with-npm3-and-node-4 branch 2 times, most recently from d7f7912 to bae3409 Compare June 13, 2016 18:32
@nonnymoose

nonnymoose commented Jun 14, 2016 •

Copy link
Copy Markdown

This fixed build error #10742 for me, though I have not finished building it yet. I ran out of RAM. :(
EDIT: It failed again, with a similar error.
See #10742.

@BinaryMuse
BinaryMuse force-pushed the mkt-use-apm-with-npm3-and-node-4 branch from bae3409 to e67ebf3 Compare June 14, 2016 20:18
@as-cii as-cii changed the title Use [email protected] with Node v4 and npm v3 \o/ Use [email protected] with Node v4 and npm v3 \o/ Jul 20, 2016
@as-cii

as-cii commented Jul 21, 2016 •

Copy link
Copy Markdown
Contributor

Aside from Travis timing out (which we're going to solve by switching to CircleCI, #12207), I think this is ready to 🚢. atom-win is failing, but based on @damieng's work, we should be able to use AppVeyor as a drop-in replacement: in the meantime, we're actively working to fix atom-win too on Janky.

@nathansobo @BinaryMuse: what do you think? 👀 💭

@thomasjo thomasjo changed the title Use [email protected] with Node v4 and npm v3 \o/ Use [email protected] with Node v4 and npm v3 \o/ Jul 21, 2016
@nathansobo
nathansobo merged commit cd3b2f5 into master Jul 25, 2016
@nathansobo
nathansobo deleted the mkt-use-apm-with-npm3-and-node-4 branch July 25, 2016 16:32
@nathansobo
nathansobo restored the mkt-use-apm-with-npm3-and-node-4 branch July 25, 2016 22:21
@nathansobo

Copy link
Copy Markdown
Contributor

Unfortunately, we've found a problem where apm is unable to require files out of Atom's ASAR bundle. This wasn't an issue for building Atom since apm uses an unpacked resource path in that case, but it is an issue for installing packages with a built version of Atom. Going to roll this back, fix the issue, and try again. 😢

@elprans

elprans commented Jul 26, 2016 •

Copy link
Copy Markdown

@nathansobo You may want to take a look at this PR: electron/asar-require#2 May be related.

@maxbrunsfeld

Copy link
Copy Markdown
Contributor

❤️ Thanks for the heads up @elprans.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.