?

Log in

No account? Create an account
 
 
13 June 2008 @ 11:00 am
How I installed Facebook "Open Platform"  
  1. Download from http://developers.facebook.com/fbopen/
  2. Wait for the download to complete.
  3. Wait some more.
  4. Extract the archive. Note the implicit dependency of a unixish system.
  5. Find some PHP code, and SQL dump, and the frighteningly huge (29M) "libfbml.tar.gz"
  6. Read the README
  7. Set up a webserver with PHP, and try running some of the provided code.
  8. Set up a web server with PHP 5
  9. Set up a MySQL instance. No, this code will not work with another database.
  10. Try loading the data.
  11. Edit the data dump to be backwards compatible.
  12. Grep through the provided PHP for any instances of "FBOPEN:SETUP". Follow the instructions at each step, including hard-coding the database IP address and authentication parameters.
  13. Debug authentication issues. Store the password for the fbopen-specific account using OLD_PASSWORD instead of PASSWORD.
  14. At this point, PHP code can run, connect to the database, and fail because functions are missing - presumably these functions are provided by the mysterious libFBML
  15. Extract libfbml.tar.gz. Find another README.
  16. "The libfbml package depends on firefox-2.0.0.4, which itself requires that several open source packages be installed. firefox-2.0.0.4-source.tar.bz2 is included with this release and resides in the dependencies subdirectory. Please note that firefox-2.0.0.4 relies on the below products".
  17. This explains the large download. Take a shot.
  18. Download the dependencies (in each case, get the EXACT version stated in the README):
    • glib-2.14.6
    • pkg-config-0.20
    • atk-1.9.1
    • freetype-2.3.4
    • fontconfig-2.3.97
    • libpng-1.2.25
    • cairo-1.2.6
    • tiff-3.7.4
    • pango-1.18.4
    • gtk+-2.10.13
    • libIDL-0.8.8
    • libXft-2.1.12
    • xproto-7.0.7
    • xrender-0.8.3
  19. build-all.py claims to be a script that will build and install everything. Read the script to see what it will do, because it WILL hork my machine (Advice to anybody reproducing my pain = do this on a readily disposable and replaceable OS install, right?).
  20. Note that each part of the script that requires escalated privileges is wrapped in sudo. Make sure it doesn't do anything malicious or stupid.
  21. With all of the dependency tarballs downloaded into the dependencies folder, launch build-all.py. Each time it fails, take a shot.
  22. Fiddle with PATH and LD_LIBRARY_PATH until the first build works.
  23. Firewall blocks ftp by returning an HTML error page, half the packages were be broken, starting with atk. Redownload from http URLs. Take a shot.
  24. fontconfig uses macros that are not recognized by some versions of gcc. After researching the meaning and intent of these macros, delete them. Since build-all.py has no concept of "continue", comment all successfully installed packages out of the "packages" list.
  25. The build for cairo was unable to find some of the system packages. Manually set the PKG_CONFIG_PATH environment variable.
  26. Start the build again. Watch for 15 minutes. Go home.
  27. The build for xrender cannot find "render" in package-config. Find a "render" development package for your linux system that includes the file render.pc
  28. Now that build-all.py has finished with the dependencies of the big-stupid dependency of libfbml, it will compile Firefox. This will take a while, but eventually fails with references to "XFreePixmap", "Xfree", "XCreatePixmap", etc.
  29. Hack the Firefox Makefiles to correctly load Xrender. Of course, the sed snippet was broken by the MLM, but the intent is decipherable.
  30. Get lunch.
  31. Compilation error in libFBML - the bastards are using goto - and using it wrong!
  32. Refactor the Facebook code to not use goto
  33. Comment out everything in build-all.py that would rebuild firefox or dependencies. Try again.
  34. WTF? "namespace-scope anonymous aggregates must be static". What does that mean? Is that even english?
  35. Make fbjs.h the first include from fbml.cpp. Cross fingers, take a shot, and try again.
  36. "phpize" is missing. Install php-devel for PHP5.
  37. Can't locate object method "path" via package "Autom4te::Request" at /usr/bin/autom4te line 81.
  38. rm -rf ext/autom4te.cache. These geniuses left garbage in the build directory.
  39. Yay! build-all.py finally worked!
  40. restart apache
  41. Crap. Needs still more PHP modules.
  42. Install Apache headers and development tools.
  43. Rebuild PHP5 from source, with all modules.
  44. Rebuild PHP5 from source, with all modules except sqlite.
  45. Recompile libfbml with the new rebuilt PHP
  46. Sacrifice a small animal to the Ogdru Jahad and their 369 incomprehensibly foul children.
  47. Restart apache.
  48. It worked! Have a beer.
 
 
 
Auto-defenestration has never been this funm00t on June 13th, 2008 11:38 pm (UTC)
/wrists
St. Sean the Amusedseanb on June 13th, 2008 11:40 pm (UTC)
Yes, that would have been much faster and less painful. Where's Rippy the Razor when you need him?
Ryansynx on June 13th, 2008 11:42 pm (UTC)
I'm not surprised. most places have these kinds of problems - needs exactly point version of FOO and no other will do. So, at what point did you ever run their test/acceptance suite?

St. Sean the Amusedseanb on June 13th, 2008 11:54 pm (UTC)
Test suite? There's a manual "look at this page to make sure stuff is running", and a "make test" target that is only useful after their PHP extension is built, but no sort of acceptance suite.
St. Sean the Amusedseanb on June 14th, 2008 12:01 am (UTC)
I'm OK with finicky version dependencies. I'm more annoyed about:

1. Including the full firefox source, when they are just using the rendering library. I'm not seeing a strong reason to use more than just Gecko, which would have eliminated most of the second-tier dependencies.
2. Failing to document the dependency requirements correctly.
3. Fragile code that requires a specific compiler version (understandable, but still a reasonably correctable annoyance).

Of course, my frustration was magnified by the tax of additional corporate steps that I'm not posting publicly.
Ryansynx on June 14th, 2008 12:10 am (UTC)
so, why are you running the fb open platform?!

I'm not sure about the long term of facebook from a business, technical and open web point of view. I think the 'closed' nature of Facebook is just like AOL and is a model that needs to go away and die.
(Anonymous) on August 5th, 2008 02:14 pm (UTC)
My Experiences
HI Guys.

Yeah, what a mission. I've documented my process here... http://sicross.blogspot.com/2008/08/installing-facebook-open-platform.html
(Anonymous) on August 10th, 2008 01:50 am (UTC)
Just wanted to say
Tahnks for posting
(Anonymous) on September 25th, 2008 08:21 am (UTC)
thanks much
omg.. good work, guy
(Anonymous) on September 28th, 2008 07:40 pm (UTC)
thanks much
thank you, dude
(Anonymous) on October 9th, 2008 08:30 am (UTC)
well done
thanks much, guy
Nathan Hammondnolongerunknown on February 10th, 2009 06:39 pm (UTC)
Compiling on Mac OS X 10.5.6
Sean, your little rant here has given me hope as I've come across problem after problem trying to compile FBOP on my Mac for a dev environment.

I've finished getting all the deps compiled and installed and am at about step 30 by your count--too far to turn back. As it is though, I've hit a wall where I don't know enough to proceed and was wondering if you had any hints: http://forum.developers.facebook.com/viewtopic.php?id=28209

Best regards.
St. Sean the Amusedseanb on February 10th, 2009 06:46 pm (UTC)
Re: Compiling on Mac OS X 10.5.6
I'll poke at it on my Mac tonight (don't have one at the office). I suspect you are right on the static linking issue. Have you already tried poking with Libtool and ranlib?

http://unix.compufutura.com/mac/ch05_05.htm
http://developer.apple.com/documentation/Darwin/Reference/Manpages/man1/ranlib.1.html
Nathan Hammondnolongerunknown on February 10th, 2009 07:22 pm (UTC)
Re: Compiling on Mac OS X 10.5.6
Compilation of the dependencies on my Mac was a bit more of a chore, so don't kill yourself on it. Some of them need to be installed from macports, others I went ahead and compiled so I had the correct version that Firefox wants, but to do so I had to modify some code to force things down certain compilation branches... and with the smattering of approaches I've tried to take my steps are not reproducible.

If you happen to have a machine compatible with my Aluminum Unibody MacBook, I've posted the files produced from the FF compile at http://facebook.nathanhammond.com/lib.tar.gz

At the very least, thanks for the reassurance that I'm heading in the right direction. :)
St. Sean the Amusedseanb on February 11th, 2009 03:20 am (UTC)
Re: Compiling on Mac OS X 10.5.6
I made a little more progress by cleaning up the "-L" entries in the generated command line.

Here's the diff for test/Makefile:
26c26
< PROJECT_ROOT = ../
---
> PROJECT_ROOT =..
35c35
< -L ../src/lib \
---
> -L../src/lib \

And here's the diff for rules.mk:
210,211c210,211
< -L $(LIB_DIR) \
< -L /usr/local/lib \
---
> -L$(LIB_DIR) \
> -L/usr/local/lib \

Nathan Hammondnolongerunknown on February 11th, 2009 03:26 am (UTC)
Re: Compiling on Mac OS X 10.5.6
I got that, but I didn't know how to proceed from there. I updated the thread at http://forum.developers.facebook.com/viewtopic.php?pid=125126 since we last typed to show where I am (which you're probably at the exact same spot).
Nathan Hammondnolongerunknown on February 11th, 2009 03:35 am (UTC)
Re: Compiling on Mac OS X 10.5.6
PS: Sorry for not keeping you in the loop about updates to this.
Nathan Hammondnolongerunknown on February 11th, 2009 06:41 am (UTC)
Re: Compiling on Mac OS X 10.5.6
I just got it to compile. Thank you for your help!