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 [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✓
Installing [email protected] ✗
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 [email protected] ✗
Package version: 0.88.0 not found

Damn it - it found [email protected], AND it removed it!! How can I persuade the build process now, to NOT look for [email protected] 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