Can’t build Atom from source on Sierra


#1

Going strictly by the instuctions provided on Atom’s Github page I meet with an error message when running script/build I don’t know how to interpret.

Currently using:
node v4.4.5
npm v3.9.5
macOS Sierra 10.12.1 Beta

Thoughts?


#2

Did you run script/bootstrap first? If not, you may want to try running it first and then try running script/build again.


#3

I have, to no success. Also, saw that my npm version was outdated, updated to most recent version (4.0.2), but still didn’t work.


#4

To where did you clone the source? If you cloned it somewhere other than ~/github/atom you may have to set the ATOM_DEV_RESOURCE_PATH environment variable to point to the source directory.


#5

Cloning to ~/github works, thank you!


#6

Hello,

Chiming in as I’m having the same issue as @audunolsen.

Unfortunately cloning to the directory ~/github doesn’t seem to resolve the issue.

Perhaps I’m misunderstanding the nature of the ~/github directory. Is there some parent /github repository that needs to be cloned before cloning atom? Or @leedohm do you mean I just need to create an empty directory ~/github and then clone atom there?


#7

Not at all. The fact that GitHub is so ubiquitous that some people (myself included), collect all of our local repos in folders entitled github. You should have somewhere like that; it’s useful to keep code repositories nicely sorted.


#8

Understood, but this is distinct from the ~usr/local/git directory that is created on a git install correct?

What I don’t understand is, in the above thread, @leedohm suggests cloning the atom repo into a /github directory, which will solve the DEV_RESOURCE_PATH issue. I’m not sure why/how if it’s an empty parent directory for the atom repo.

To summarize, here’s what I’ve done:
1.) Create a directory ~/github

2.) Follow the steps listed here exactly: https://github.com/atom/atom/blob/master/docs/build-instructions/macOS.md

3.) Receive this error:

DeepThoht42sMBP:~ deepthought42$ cd Desktop/github/
DeepThoht42sMBP:github deepthought42$ ls
DeepThoht42sMBP:github deepthought42$ git clone https://github.com/atom/atom.git
Cloning into ‘atom’…
remote: Counting objects: 181173, done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 181173 (delta 36), reused 34 (delta 18), pack-reused 181112
Receiving objects: 100% (181173/181173), 289.04 MiB | 4.30 MiB/s, done.
Resolving deltas: 100% (129026/129026), done.
DeepThoht42sMBP:github deepthought42$ cd atom
DeepThoht42sMBP:atom deepthought42$ script/build
Node: v6.11.0
Npm: v5.5.1
Installing script dependencies
prebuild-install info begin Prebuild-install version 2.3.0
prebuild-install info looking for local prebuild @ prebuilds/leveldown-v1.9.0-node-v48-darwin-x64.tar.gz
prebuild-install info looking for cached prebuild @ /Users/deepthought42/.npm/_prebuilds/https-github.com-level-leveldown-releases-download-v1.9.0-leveldown-v1.9.0-node-v48-darwin-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ /Users/deepthought42/.npm/prebuilds/https-github.com-level-leveldown-releases-download-v1.9.0-leveldown-v1.9.0-node-v48-darwin-x64.tar.gz
prebuild-install info unpack resolved to /Users/deepthought42/Desktop/github/atom/script/node_modules/leveldown/build/Release/leveldown.node
prebuild-install info unpack required /Users/deepthought42/Desktop/github/atom/script/node_modules/leveldown/build/Release/leveldown.node successfully
prebuild-install info install Successfully installed prebuilt binary!
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
Installing apm
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
…/src/onig-string.cc:30:40: warning: comparison of integers of different signs: ‘int’ and ‘size_t’ (aka ‘unsigned long’) [-Wsign-compare]
hasMultiByteChars = (value->Length() != utf8_length
);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
1 warning generated.
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
Traceback (most recent call last):
File “./gyp-mac-tool”, line 611, in
sys.exit(main(sys.argv[1:]))
File “./gyp-mac-tool”, line 28, in main
exit_code = executor.Dispatch(args)
File “./gyp-mac-tool”, line 43, in Dispatch
return getattr(self, method)(*args[1:])
File “./gyp-mac-tool”, line 246, in ExecFilterLibtool
if not libtool_re.match(line) and not libtool_re5.match(line):
TypeError: cannot use a string pattern on a bytes-like object
make: *** [Release/git2.a] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/deepthought42/Desktop/github/atom/script/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command “/usr/local/bin/node” “/Users/deepthought42/Desktop/github/atom/script/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild"
gyp ERR! cwd /Users/deepthought42/Desktop/github/atom/apm/node_modules/atom-package-manager/node_modules/git-utils
gyp ERR! node -v v6.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! git-utils@4.1.4 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the git-utils@4.1.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/deepthought42/.npm/_logs/2017-11-02T11_03_29_391Z-debug.log
child_process.js:504
throw err;
^

Error: Command failed: /Users/deepthought42/Desktop/github/atom/script/node_modules/.bin/npm --global-style --loglevel=error install
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
…/src/onig-string.cc:30:40: warning: comparison of integers of different signs: ‘int’ and ‘size_t’ (aka ‘unsigned long’) [-Wsign-compare]
hasMultiByteChars = (value->Length() != utf8_length_);
~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~
1 warning generated.
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
Traceback (most recent call last):
File “./gyp-mac-tool”, line 611, in
sys.exit(main(sys.argv[1:]))
File “./gyp-mac-tool”, line 28, in main
exit_code = executor.Dispatch(args)
File “./gyp-mac-tool”, line 43, in Dispatch
return getattr(self, method)(*args[1:])
File “./gyp-mac-tool”, line 246, in ExecFilterLibtool
if not libtool_re.match(line) and not libtool_re5.match(line):
TypeError: cannot use a string pattern on a bytes-like object
make: *** [Release/git2.a] Error 1
gyp ERR! build error
gyp ERR! stack Error: make failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/deepthought42/Desktop/github/atom/script/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack at emitTwo (events.js:106:13)
gyp ERR! stack at ChildProcess.emit (events.js:191:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command “/usr/local/bin/node” “/Users/deepthought42/Desktop/github/atom/script/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js” "rebuild"
gyp ERR! cwd /Users/deepthought42/Desktop/github/atom/apm/node_modules/atom-package-manager/node_modules/git-utils
gyp ERR! node -v v6.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! git-utils@4.1.4 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the git-utils@4.1.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/deepthought42/.npm/_logs/2017-11-02T11_03_29_391Z-debug.log

at checkExecSyncError (child_process.js:481:13)
at Object.execFileSync (child_process.js:501:13)
at module.exports (/Users/deepthought42/Desktop/github/atom/script/lib/install-apm.js:9:16)
at Object.<anonymous> (/Users/deepthought42/Desktop/github/atom/script/bootstrap:29:1)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)

#9

Yes.

What I don’t understand is, in the above thread, @leedohm suggests cloning the atom repo into a /github directory, which will solve the DEV_RESOURCE_PATH issue. I’m not sure why/how if it’s an empty parent directory for the atom repo.

As @leedohm says, the choices are between having the repo within ~/github/atom or changing the ATOM_DEV_RESOURCE_PATH environment variable. There’s something in Atom’s build process that looks for files in a specific directory.

What I don’t understand is why you’re focusing on that one post when your error doesn’t resemble anything like it: TypeError: cannot use a string pattern on a bytes-like object. I don’t know what that means, but it’s not that Atom’s having difficulty finding the files it needs to build.

clang also complains about your standard C++ library being deprecated. You could try updating your build tools.

What is your goal in building Atom from source?


#10

My goal in building Atom from source was initially to enable Atom Editor transparency, as in this tutorial:

However I’m getting identical errors both with and without the prescribed edits to the source code.

Now though, it’s become something of a White Whale in its own right…

Regarding the clang, I’ve googled this same error and read that it wasn’t a critical error per se (other people having the same issue and still building successfully). I was hesitant to try to update the C++ library as I don’t know exactly where it lives in my system files.


#11

The actual problem is way too deep in the native code weeds for me to figure out what’s up with it. You should ask on the GitHub repo.