atom-community/atom

Latest Git version does not build

DAC324 opened this issue · 5 comments

Hello all,

looks like there has been an error introduced in one of the package.json files in the latest version available on the Git repo:

$ script/bootstrap
Node:	v16.15.1
Python:	v3.10.5
Installing script runner dependencies
Installing script dependencies
Installing apm
npm ERR! code EJSONPARSE
npm ERR! file /tmp/npm-41917-ae889fff/unpack-46b20215/node_modules/agent-base/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gerd/.npm/_logs/2022-06-23T14_33_58_898Z-debug.log
Error: Command failed: /opt/.cache/yay/atom/test/atom/script/script-runner/node_modules/.bin/npm --global-style --loglevel=error install
npm ERR! code EJSONPARSE
npm ERR! file /tmp/npm-41917-ae889fff/unpack-46b20215/node_modules/agent-base/package.json
npm ERR! JSON.parse Failed to parse json
npm ERR! JSON.parse Unexpected end of JSON input while parsing near ''
npm ERR! JSON.parse Failed to parse package.json data.
npm ERR! JSON.parse package.json must be actual JSON, not just JavaScript.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/gerd/.npm/_logs/2022-06-23T14_33_58_898Z-debug.log

    at checkExecSyncError (node:child_process:828:11)
    at Object.execFileSync (node:child_process:863:15)
    at installApm (/opt/.cache/yay/atom/test/atom/script/lib/install-apm.js:14:16)
    at /opt/.cache/yay/atom/test/atom/script/script-runner/node_modules/threads/dist/worker/index.js:109:26
    at Generator.next (<anonymous>)
    at /opt/.cache/yay/atom/test/atom/script/script-runner/node_modules/threads/dist/worker/index.js:8:71
    at new Promise (<anonymous>)
    at __awaiter (/opt/.cache/yay/atom/test/atom/script/script-runner/node_modules/threads/dist/worker/index.js:4:12)
    at runFunction (/opt/.cache/yay/atom/test/atom/script/script-runner/node_modules/threads/dist/worker/index.js:106:12)

This is likely do to the tree-sitter updates we're waiting to be fix. Mauricio has a version of this in his visual-tests branch on Atom-rebirth/atom that may work to build since it should have these updates. He's working on getting a PR merged in from that, that SHOULD fix this in the future. That and the changes to apm-papm(under this atom-community org) to hopefully replace apm in a way that should work period without as many hiccups.

I am not able to reproduce this issue on Ubuntu 20.04 or current Manjaro Linux.

Can you try rm -rf apm/package.json && git restore apm/package.json, and then do script/bootstrap again?

Actually, looking at this package.json specifically: /tmp/npm-41917-ae889fff/unpack-46b20215/node_modules/agent-base/package.json

That (agent-base package) is an indirect dependency of apm. Maybe try rm -rf apm/node_modules and then script/bootstrap.

I am not able to reproduce this issue on Ubuntu 20.04 or current Manjaro Linux.

Indeed, it looks like a very weird way the build system uses to indicate your /tmp is full :-)
While trying to compile some other program, I got the more descriptive no space left on device for /tmp.
And indeed, if /tmp is cleaned up, the error is gone.

Manjaro Linux

That's what I am using as well. Unfortunately, Manjaro sets the /tmp size to 25% of the installed RAM only which results in /tmp being only of 2 GB in size on a system equipped with 8 GB of RAM.
That, of course, does not seem to be enough if you are compiling something, and have a browser open in parallel.

Solution:
Increasing the size for /tmp in /etc/fstab and restarting helps avoiding this error.