Sunday, August 14, 2011

The "Fail Better" quotation

Here's the quotation I was paraphrasing last week:
"All of old. Nothing else ever. Ever tried. Ever failed. No matter. Try again. Fail again. Fail better."
http://www.goodreads.com/author/quotes/1433597.Samuel_Beckett

Friday, August 12, 2011

Pushing POSSE: Revising the lemonade stand


------------
Pushing POSSE: Revising the lemonade stand
------------
A day in the life of an Open Source developer participant, or...

    How I set up and pushed clone changes to a public git repository I own
    so that a committer can 'git pull' them.

The transcript below shows using two clones, a local and a remote, to
add a feature to an open source project whose repository tool is git.

-- ben steele, bks@cs.rit.edu 
http://benk11.blogspot.com/ (this blog may be replaced in the future...)
------------

Having created a clone repository on both my local machine and gitorious.org,
I developed on my local machine (from where these commands executed) and then
pushed them up to the publicly available gitorious.org clone.
From there, I requested that Nate (the 'owner' of the master) merge in
my changes; gitorious.org has a button you click and then fill out the request. 

## the original git referenced from 
[~/foss] % git clone git://gitorious.org/lemonade-stand-olpc/lemonade-stand.git

    % ... edits to add and test the feature
[~/foss/lemonade-stand] % git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

[~/foss/lemonade-stand] % git remote add \
    myrepo git@gitorious.org:~benk/lemonade-stand-olpc/benks-lemonade-stand.git

[~/foss/lemonade-stand] % git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master

[~/foss/lemonade-stand] % git push myrepo
To git@gitorious.org:~benk/lemonade-stand-olpc/benks-lemonade-stand.git
 ! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'git@gitorious.org:~benk/lemonade-stand-olpc/benks-lemonade-stand.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes before pushing again.  See the 'Note about
fast-forwards' section of 'git push --help' for details.

[~/foss/lemonade-stand] % git pull myrepo master
remote: Counting objects: 4, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 3 (delta 1), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.
From gitorious.org:~benk/lemonade-stand-olpc/benks-lemonade-stand
 * branch            master     -> FETCH_HEAD
Merge made by recursive.

[~/foss/lemonade-stand] % ls *.sh
gitLemonadeStand.sh    ## <<--- this is the myrepo change I had to pull;
            ## that was from the first commit request I made.

[~/foss/lemonade-stand] % git push myrepo
Counting objects: 13, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 2.47 KiB, done.
Total 9 (delta 5), reused 0 (delta 0)
=> Syncing Gitorious... [OK]
To git@gitorious.org:~benk/lemonade-stand-olpc/benks-lemonade-stand.git
   4877035..5320fae  master -> master

[~/foss/lemonade-stand] % date
Fri Aug 12 16:46:54 EDT 2011
## a merge request was sent to the committer (nate) through gitorious.org.

The Open Source Way and Teaching CS

The open source way, the infrastructures and community culture of developing software, most closely aligns with the topic of "development process" in the teaching of computer science (CS). Unfortunately, the CS curriculum does not place a great emphasis on this topic.
On the other hand, students learn that finding, developing and following a process is valuable, and open source development could be an excellent place to show them a distributed process.

My wiki page at [[http://teachingopensource.org/index.php/User:BenSteele teachingopensource.org]] has a piece on my ideas for integrating open source into the CS curriculum at the seminar level.

I very much enjoyed the course, its instructors and the activities.

Thursday, August 11, 2011

funny, absurd patent

http://www.delphion.com/details?&pn=US06125480__

Wednesday, August 10, 2011

what finally built firefox on Mac OS X 10.5.8




# what finally worked to make firefox after updating xcode to 3.1.4.
  % vi ~/.mozconfig   # remove the CC, CX settings
  % make -f client.mk distclean  # clear out the distribution
  % make -f client.mk realclean  # clean
# I'm not sure which is the correct order: distclean first or realclean;
# I did both a couple times.
  % make -f client.mk build



Tuesday, August 9, 2011

Build round 2

last round for today.

# fail better better better better.
# make fails with compiler errors:

  % make -f client.mk  build
  ...

In the directory  /Users/bks/foss/mozilla/obj-ff-dbg/js/src
The following command failed to execute properly:
g++ -arch i386 -o jsbool.o -c -I./../../dist/system_wrappers_js -include /Users/bks/foss/mozilla/js/src/config/gcc_hidden.h -DOSTYPE="Darwin9.8.0" -DOSARCH=Darwin -DEXPORT_JS_API -DIMPL_MFBT -DJS_HAS_CTYPES -DDLL_PREFIX="lib" -DDLL_SUFFIX=".dylib" -Ictypes/libffi/include -I. -I/Users/bks/foss/mozilla/js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub -I/Users/bks/foss/mozilla/obj-ff-dbg/dist/include/nspr -I/Users/bks/foss/mozilla/js/src -I/Users/bks/foss/mozilla/js/src/assembler -I/Users/bks/foss/mozilla/js/src/yarr -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -fno-strict-aliasing -fpascal-strings -fno-common -pthread -pipe -DDEBUG -D_DEBUG -DTRACING -g -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jsbool.pp /Users/bks/foss/mozilla/js/src/jsbool.cpp
make[5]: *** [jsbool.o] Error 1
/Users/bks/foss/mozilla/js/src/mfbt/InlineMap.h: In member function ‘js::InlineMap::Entry js::InlineMap::Range::front() [with K = JSAtom*, V = js::DefnOrHeader, long unsigned int InlineElems = 24ul]’:
/Users/bks/foss/mozilla/js/src/frontend/ParseMaps.h:403:   instantiated from here
/Users/bks/foss/mozilla/js/src/mfbt/InlineMap.h:127: error: ‘js::InlineMap::Entry::Entry(const K&, const V&) [with K = JSAtom*, V = js::DefnOrHeader, long unsigned int InlineElems = 24ul]’ is private
/Users/bks/foss/mozilla/js/src/mfbt/InlineMap.h:390: error: within this context
/Users/bks/foss/mozilla/js/src/frontend/ParseMaps.h:403:   instantiated from here
/Users/bks/foss/mozilla/js/src/mfbt/InlineMap.h:127: error: ‘js::InlineMap::Entry::Entry(const K&, const V&) [with K = JSAtom*, V = js::DefnOrHeader, long unsigned int InlineElems = 24ul]’ is private
/Users/bks/foss/mozilla/js/src/mfbt/InlineMap.h:391: error: within this context

In the directory  /Users/bks/foss/mozilla/obj-ff-dbg/js/src
The following command failed to execute properly:
g++ -arch i386 -o jsapi.o -c -I./../../dist/system_wrappers_js -include /Users/bks/foss/mozilla/js/src/config/gcc_hidden.h -DOSTYPE="Darwin9.8.0" -DOSARCH=Darwin -DEXPORT_JS_API -DIMPL_MFBT -DJS_HAS_CTYPES -DDLL_PREFIX="lib" -DDLL_SUFFIX=".dylib" -Ictypes/libffi/include -I. -I/Users/bks/foss/mozilla/js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub -I/Users/bks/foss/mozilla/obj-ff-dbg/dist/include/nspr -I/Users/bks/foss/mozilla/js/src -I/Users/bks/foss/mozilla/js/src/assembler -I/Users/bks/foss/mozilla/js/src/yarr -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -fno-strict-aliasing -fpascal-strings -fno-common -pthread -pipe -DDEBUG -D_DEBUG -DTRACING -g -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jsapi.pp /Users/bks/foss/mozilla/js/src/jsapi.cpp
make[5]: *** [jsapi.o] Error 1
make[4]: *** [libs_tier_js] Error 2
make[3]: *** [tier_js] Error 2
make[2]: *** [default] Error 2
make[1]: *** [realbuild] Error 2
make: *** [build] Error 2

# it turns out that fink did not install g++ with gcc. :-<

Mac Build Firefox

Info on zigs and zags trying to build firefox on an older mac.


# now build mozilla (firefox)
  % make -f client.mk  build
make -f /Users/bks/foss/mozilla/client.mk realbuild
Adding client.mk options from /Users/bks/.mozconfig:
    MOZ_OBJDIR=$(TOPSRCDIR)/obj-ff-dbg
    MOZ_MAKE_FLAGS=-s -j4
Generating /Users/bks/foss/mozilla/configure using autoconf
cd /Users/bks/foss/mozilla; /opt/local/bin/autoconf213
Generating /Users/bks/foss/mozilla/js/src/configure using autoconf
cd /Users/bks/foss/mozilla/js/src; /opt/local/bin/autoconf213
cd /Users/bks/foss/mozilla/obj-ff-dbg
/Users/bks/foss/mozilla/configure
Adding configure options from /Users/bks/.mozconfig:
  --enable-application=browser
  --enable-debug
  --disable-optimize
creating cache ./config.cache
checking host system type... i386-apple-darwin9.8.0
checking target system type... i386-apple-darwin9.8.0
checking build system type... i386-apple-darwin9.8.0
checking for mawk... no
checking for gawk... gawk
checking for perl5... /opt/local/bin/perl5
checking for gcc... gcc-4.2
checking whether the C compiler (gcc-4.2  ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables.
*** Fix above errors and then restart with               "make -f client.mk build"
make[2]: *** [configure] Error 1
make[1]: *** [/Users/bks/foss/mozilla/obj-ff-dbg/Makefile] Error 2
make: *** [build] Error 2
  %
# My mac has gcc 4.0.1 not gcc 4.2
# ...Time to get gcc42 from fink commander gui (or macports).
#
  % rehash
  % which gcc-4
/sw/bin/gcc-4
  % gcc-4 --version
gcc-4 (GCC) 4.2.2
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

  % make -f client.mk  build

# failed again. could not find/run gcc.
#
# edit .mozconfig to add these lines at the end (these are indented):
#
#    CC="gcc -arch i386"
#    CXX="g++ -arch i386"

  % make -f client.mk  build

# got past the earlier failure only to get this after spewing many checks:
checking if app-specific confvars.sh exists... /Users/bks/foss/mozilla/browser/confvars.sh
checking __attribute__ ((aligned ())) support... trying 64
64
configure: error: yasm is a required build tool for this architecture when webm is enabled. You may either install yasm or --disable-webm (which disables the WebM video format). See https://developer.mozilla.org/en/YASM for more details.
*** Fix above errors and then restart with               "make -f client.mk build"
make[2]: *** [configure] Error 1
make[1]: *** [/Users/bks/foss/mozilla/obj-ff-dbg/Makefile] Error 2
make: *** [build] Error 2

# failed again. this time it failed better;->
# it seems that yasm is missing (yup. I skipped that setup step...)
# 

  % make -f client.mk  build

# failed again, even better. libidl2 missing.

checking for libIDL - version >= 0.6.3... no
*** The libIDL-config script installed by libIDL could not be found
*** If libIDL was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the LIBIDL_CONFIG environment variable to the
*** full path to libIDL-config.
checking for libIDL-2.0 >= 0.8.0... Package libIDL-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libIDL-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libIDL-2.0' found
configure: error: Library requirements (libIDL-2.0 >= 0.8.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
*** Fix above errors and then restart with               "make -f client.mk build"
make[2]: *** [configure] Error 1
checking for libIDL - version >= 0.6.3... no
*** The libIDL-config script installed by libIDL could not be found
*** If libIDL was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the LIBIDL_CONFIG environment variable to the
*** full path to libIDL-config.
checking for libIDL-2.0 >= 0.8.0... Package libIDL-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `libIDL-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'libIDL-2.0' found
configure: error: Library requirements (libIDL-2.0 >= 0.8.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.
*** Fix above errors and then restart with               "make -f client.mk build"
make[2]: *** [configure] Error 1

# failed better and better. must get libidl now...

  % sudo port install libidl

--->  Extracting zlib
Error: On Mac OS X 10.5, zlib 1.2.5 requires Xcode 3.1 or later but you have Xcode 3.0.
Error: See http://guide.macports.org/chunked/installing.xcode.html for download links.
Error: Target org.macports.extract returned: incompatible Xcode version
Error: Failed to install zlib
Log for zlib is at: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_ports_archivers_zlib/zlib/main.log
Error: The following dependencies were not installed: glib2 zlib pkgconfig
Error: Status 1 encountered during processing.
To report a bug, see 

# failed to get libidl; Xcode is out of date! need Xcode 3.1 or later...
# we are definitely productively lost...

# go to apple developer site (i have an account already; phew) to download...
# Xcode 4 is out, but I want version 3.1 or later; 3.2.6 is (last?) version 3.
# Xcode 3.2.6 is bundled with iOS SDK 4.3; bundle is 4GB and takes about
# 8 minutes to download and 2 minutes to install on a 4GHz, 4GB RAM machine...
##
# oops. xcode 3.2.6 is for Mac OS 10.6; that may be an issue...
##
# sigh. there is no download for xcode 3.1 anywhere on the apple site.
# that means I cannot build firefox on this old machine.
##
# @#*$!
# I just spent 40 minutes poring through the apple developer site looking ...
##
##
# While I found this site for an xcode 3.1 download, how can I trust it???
# http://www.freemacware.com/apple-xcode-313
#
## yeah! mceachen to the rescue. 
# http://meandmark.com/blog/2009/10/downloading-older-versions-of-xcode/
# site shows tells how and where to find the download.
# this download only took 3 minutes...
# 6 other folks had the same trouble I had. thank goodness for web search!
##
# now hopefully, I will be able to make firefox.
# stay tuned for a later posting...