0

I've got Atom from git (from https://github.com/atom/atom), and checked out version 1.5.0-beta0 some time ago, when I built a 32-bit deb out of it; I'm on Ubuntu 14.04.

Now, I would like to build the exact same version, as a 64-bit deb. I thought it would be straightforward, so I just issued in the git source folder:

script/build
script/grunt mkdeb

That built me a /tmp/atom-build/atom-1.5.0-beta0-amd64.deb, but when I installed it, it told me:

/usr/share/atom/atom: error while loading shared libraries: libnotify.so.4: cannot open shared object file: No such file or directory

... which was weird, because on my 64-bit system:

$ locate libnotify.so.4
/usr/lib/x86_64-linux-gnu/libnotify.so.4
/usr/lib/x86_64-linux-gnu/libnotify.so.4.0.0

I thought, it cannot possibly be, that the build system of atom cannot distinguish between 32 and 64-bit builds? But it turned to be exactly that, because I tried LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu atom and it gave me some error (EDIT: most likely it was: "/usr/share/atom/atom: error while loading shared libraries: libnotify.so.4: wrong ELF class: ELFCLASS64") that pointed to me that it probably did have a problem with this...

Great. Ok, now I tried cleaning first:

script/clean
script/build

Now, while I was doing the build here over wireless network, npm (or apm) would have COMPLETELY clogged my internet connection, eventually producing messages like:

....
Installing build modules...
npm ERR! fetch failed https://registry.npmjs.org/minimatch/-/minimatch-0.3.0.tgz
npm ERR! fetch failed https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.5.0.tgz
....

At this point, if I tried to load a page in say Firefox, then it would have just kept spinning, and never loaded the page.

So, I changed from wireless to wired, and finally got to this:

atom_git$ script/clean
atom_git$ script/build
Node: v4.0.0
npm: v2.14.2
Installing build modules...
=> Took 94239ms.

Installing apm...
=> Took 67760ms.

Deleting old packages...
=> Took 418ms.

Installing modules ✓
Installing atom-dark-syntax@0.27.0 ✓
Installing atom-dark-ui@0.51.0 ✓
Installing atom-light-syntax@0.28.0 ✓
Installing atom-light-ui@0.43.0 ✓
Installing base16-tomorrow-dark-theme@1.1.0 ✓
Installing base16-tomorrow-light-theme@1.1.1 ✓
Installing one-dark-ui@1.1.9 ✓
Installing one-light-ui@1.1.9 ✓
Installing one-dark-syntax@1.1.2 ✓
Installing one-light-syntax@1.1.2 ✓
Installing solarized-dark-syntax@0.39.0 ✓
Installing solarized-light-syntax@0.23.0 ✓
Installing about@1.3.0 ✓
Installing archive-view@0.61.0 ✓
Installing autocomplete-atom-api@0.9.2 ✓
Installing autocomplete-css@0.11.0 ✓
Installing autocomplete-html@0.7.2 ✓
Installing autocomplete-plus@2.25.0 ✓
Installing autocomplete-snippets@1.9.0 ✓
Installing autoflow@0.26.0 ✓
Installing autosave@0.23.0 ✓
Installing background-tips@0.26.0 ✓
Installing bookmarks@0.38.0 ✓
Installing bracket-matcher@0.79.0 ✓
Installing command-palette@0.38.0 ✓
Installing deprecation-cop@0.54.0 ✓
Installing dev-live-reload@0.47.0 ✓
Installing encoding-selector@0.21.0 ✓
Installing exception-reporting@0.37.0 ✓
Installing find-and-replace@0.195.0 ✓
Installing fuzzy-finder@0.94.0 ✓
Installing git-diff@0.57.0 ✓
Installing go-to-line@0.30.0 ✓
Installing grammar-selector@0.48.0 ✓
Installing image-view@0.56.0 ✓
Installing incompatible-packages@0.25.0 ✓
Installing keybinding-resolver@0.33.0 ✓
Installing line-ending-selector@0.3.0 ✓
Installing link@0.31.0 ✓
Installing markdown-preview@0.157.1 ✓
Installing metrics@0.53.1 ✓
Installing notifications@0.62.1 ✓
Installing open-on-github@0.40.0 ✓
Installing package-generator@0.41.0 ✓
Installing settings-view@0.232.3 ✓
Installing snippets@1.0.1 ✓
Installing spell-check@0.65.0 ✓
Installing status-bar@0.80.0 ✓
Installing styleguide@0.45.0 ✓
Installing symbols-view@0.110.1 ✓
Installing tabs@0.88.0 ✗
Package version: 0.88.0 not found

... and now the build process here stops. I thought damn it - how can I build from source, now that they rely on packages from internet that keep being removed? But then I browser a bit, and found https://github.com/atom/tabs/releases/tag/v0.88.0 - great; so I tried this:

cd /tmp
wget https://github.com/atom/tabs/archive/v0.88.0.zip
unzip v0.88.0.zip

cd /path/to/atom_git
mv /tmp/tabs-0.88.0 ./node_modules/

... and tried the build again:

atom_git$ script/build
Node: v4.0.0
npm: v2.13.3
Installing build modules...
=> Took 3473ms.

Installing apm...
=> Took 1122ms.

Deleting old packages...
Removing tabs-0.88.0 ✓
=> Took 1290ms.

Installing modules ✓
Installing tabs@0.88.0 ✗
Package version: 0.88.0 not found

Damn it - it found tabs@0.88.0, AND it removed it!! How can I persuade the build process now, to NOT look for tabs@0.88.0 online, but instead to use the one that I'm supplying to it, so the build script can continue building?

sdbbs
  • 4,270
  • 5
  • 32
  • 87

1 Answers1

1

Ok, I think I got somewhere;

First problem is that when I unpack v0.88.0.zip, as the snippet above shows, I get a directory called tabs-0.88.0, which I directly move to atom_git/node_modules/. However, ./script/bootstrap tells us that "Deleting old packages..." is due to apm clean, and if we call the help:

atom_git$ ./apm/node_modules/atom-package-manager/bin/apm clean --help
Usage: apm clean
Deletes all packages in the node_modules folder that are not referenced
as a dependency in the package.json file.

Ah - and the package.json for my atom source contains:

atom_git$ grep tabs package.json 
    "tabs": "0.88.0",

Thus, it would expect the folder to be named tabs - and NOT tabs-0.88.0; so the right thing to do would be:

cd /tmp
wget https://github.com/atom/tabs/archive/v0.88.0.zip
unzip v0.88.0.zip

cd /path/to/atom_git
mv /tmp/tabs-0.88.0 ./node_modules/tabs

Then I got the same problem with tree-view; so I did

cd /tmp
wget https://github.com/atom/tree-view/archive/v0.198.1.zip
unzip v0.198.1.zip

cd /path/to/atom_git
mv /tmp/tree-view-0.198.1 ./node_modules/tree-view

This makes the build continue until:

Running "compile-packages-slug" task
>> tabs: No README data
Warning: Task "compile-packages-slug" failed. Use --force to continue.

Solution for this was in: NPM - How to fix "No readme data" -- turns out, now package.json of the addons MUST contain a readme key, so I added something like this to atom_git/node_modules/tabs/package.json:

...
  "dependencies": {
    "temp": "~0.8.1",
    "underscore-plus": "1.x"
  },
  "readme": "# Tabs package",
  "readmeFilename": "README.md",
  "devDependencies": {
...

... and the same for the tree-view one - and finally build completed, also script/grunt mkdeb worked, created a 64-bit deb; this deb was installable - and atom is finally running for me (it still spit out an error at first startup, which I didn't record (EDIT: it is probably "Uncaught TypeError: Cannot read property 'length' of undefined") - but the second time start did not cause any errors, so I guess it is OK now)...

EDIT: No it isn't ok, it gives me Uncaught TypeError: Cannot read property 'length' of undefined everytime I type a key...

What a waste of time this is...

Community
  • 1
  • 1
sdbbs
  • 4,270
  • 5
  • 32
  • 87