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

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...

MacOS X 10.5.8 Firefox setup and download

These notes describe actual work done while setting up things for a Firefox build on a MacBook Pro MacOS X 10.5.8 with Xcode 3.0 installed. Refer to developer.mozilla.org Mac Prerequisites for the basic steps.


# a massaged transcript of my travails to get set up and build Firefox.
# Thanks to Chris Tyler for the help on the macports mercurial diagnosis.
# --bksteele
# command line prompt is % (she sells c shells by the C shore...)
#
# update macports
  % sudo port selfupdate 
  % sudo port sync
# I skipped the command: sudo port install libidl autoconf213 yasm
# because it looked like I had libidl autoconf and yasm.
# I used spotlight to check for libidl autoconf and yasm.
#
# update get mercurial (hg) from macports
  % sudo port install mercurial
  % hg version
  % rehash
  % which hg
# get mercurial (hg) from macports appeared to succeed, but failed. no hg.
# investigation to find error note in log from installing mercurial (hg).
  % cd /opt/local/var/macports/logs/
  % cd *mercurial*
  % cd mercurial/
  % less main.log
# a macports note said to upgrade macports, but commands below failed.
  % port upgrade outdated
  % sudo port upgrade outdated
  % sudo port upgrade
  % cd /opt/local
  % cd var/macports
  % sudo port upgrade outdated
  % sudo port upgrade
# workaround: install binary version of mercurial (hg) from 
# http://mercurial.selenic.com/ which provides a zip of an installable package.
  % rehash
  % hg version
# it works. now on to the mozilla setup.
  % cd
  % vi .mozconfig
  % hg clone http://hg.mozilla.org/mozilla-central/ mozilla
  % cd mozilla/
  % make -n -f client.mk build
  % grep autoconf *mk
# oops! it turns out the system does NOT have autoconf213 after all.
# back to macports to fetch the old autoconf213.
# which command from client.mk for autoconf is this:
  % which autoconf-2.13 autoconf2.13 autoconf213
  % sudo port install autoconf213
  % rehash
  % which autoconf-2.13 autoconf2.13 autoconf213
# now the dry run with make -n (the -n is for no execute)
  % cd mozilla/
  % make -n -f client.mk build
# looks good. time for letting the real thing build overnight. I'm hungry.

Eclipse CommArch

See the http://teachingopensource.org/index.php/Eclipse_Project_Architecture Eclipse material that Dorin Patru and I have put together so far.

Teaching Open Source Notes

My Notes on "Teaching the Practice of Open Source" Topic
  1. Communication:
    instructor should be a 'good connector'. ideally, instructor is active in the community so that they can best help student to find the resources (docs/people) as needed.
  2. Project Selection:
    students get a list of projects to choose from within a community. instructor must
    go to OS communities first; don't let students pick a project. ask the community for things they would need/want. community must be big enough to accept/handle the student population. for example, 2-3 students work on fedora-QA, 3 students work on fedora-Packaging, 4 on fedora-Bugs, etc.
    a "bug" is the project; to add a feature, issue a bug and then work on it.
    Project Description Example:
    Title: Add X
    Description: Feature X would be really great addition to the program.
    Skills: C++, OpenGL
    Links: yadaLink...
  3. Learning How to Build
  4. Tools and Methodologies
  5. Meeting the Community:
    as the students study and review the project list, they will meet the community.
    they must learn and adapt to the accepted modes of communication used by the community as they study to learn what project to choose.
  6. Releases:
    student does 3 releases (20% each) and uses blogs in addition to the bug.
    For example, 0.1 to 0.3 would be the release number of the development work on the bug.
    if student hit the wall (blocked) for any reason, they must document why and what they did about it.
  7. Contribution to Other Projects:
    measure the student on their contribution to other aspects of the community; examples include a shared library improvement, test fixtures, or documentation.

Monday, August 8, 2011

The Posse Planet

There's even more infrastructure to negotiate than I expected...

IRC hangups and Lost confirmation mails

My afternoon was quite frustrating.
While the browser said I had a wiki page and was logged in, the email was lost in the ether.

In addition, the IRC hung up. I could type all day but it would never post to any channel.

The solution: redo everything and use a different email address.
In retrospect, I believe that the CS dept. email system's tough spam filters were the cause.

Update: The email finally arrived around 4pm, but I had already given up using that address.