Notes about my development environment...
(
BrendanOConnor collected links to a bunch of these pages in
DevEnvNotes.)
One Source Tree
After wasting a bunch of time moving files between platforms during the 0.5 cycle, I'm trying something new for 0.6: I'm doing all my work out of one file tree, and sharing that tree between platforms. My Ubuntu box hosts the fileshare because the platforms with case-sensitive filesystems (Mac & Linux) have problems if I share from Windows. I'm sharing a directory called "shared" in my Ubuntu home directory; I've also got an "unshared" directory in my home directory on each platform, where all the platform-specific stuff lives. The other platforms mount the shared directory in ~/shared on Mac, and as z:\ on Windows.
At the root of the shared folder, I've got a "sharedbashrc" file that I source from my regular .bashrc on each platform; it sets up a bunch of exports and a shell function that I use to switch between development instances: the share contains several instances of our sources: one for tip-of-tree where I do most of my work, one for branches. I've also got one "full" environment (chandler-all, as opposed to chandler-python) where I hope to learn to do C++ debugging of wx stuff, but I haven't messed with that much yet. (I'm starting to; see below.)
I use a shell function ("go") defined in the sharedbashrc file to switch between instances; "go instancename" sets up a bunch of shell exports and aliases for that environment (including CHANDLERHOME, CHANDLERBIN, CHANDLERARCHIVES, and DEBUG.) Where it matters, both cygwin-format and unix-format versions are created.
I use individual platform-specific Wing project files in each instance's chandler directory (eg, Chandler-release-mac.{wpr,wpu}). It's a pain to keep copying them around, and I hope to either write a script to install baseline versions localized from a template, or to modify Wing's project mechanism to support more-flexible includes and/or variable substitution.
I keep a "parcels" directory at the root of the shared folder, too, and point at it with PARCELPATH - this gives me pre-set-up email accounts, as well as a place to put a "hack" parcel I wrote that does a bunch of other debugging-convenience-related things (changing the Chandler window's default size and/or position, creating test items, etc.)
I define PROFILEDIR to point into the unshared tree as well; this helps avoid conflicts if I run Chandler at the same time on more than one platform, and gives me per-platform logs. Note that even with the shared CHANDLERHOMEs, it's not completely safe to run Chandler from two platforms at the same time, especially when debugging: while the .pyc files that Python creates are mostly cross-platform safe, there are paths embedded in them that aren't (and that confuse Wing).
I "export CHANDLER_CURL_OPTIONS=-s" to work around a problem with curl's progress output being really slow in cygwin.
(I'll add more notes here as I refine this strategy.)
My "hack" parcel
I put this parcel in my personal parcel directory, to make my debugging life better: it has a bunch of little tweaks in it that run at parcel-install time. (Note that the new settings only get used when the repository is initially created - I almost always use --create when debugging, so this works for me.)
At various times, it's done things like:
- make the main window a little smaller, and put it in a fixed location. This leaves more room to see my debugger and log windows.
- stamp the Welcome note as a calendar event + email + note, which helps me test the detail view.
- create test collections and items
- add test menu items that do special logging (like dumping all the items with reminders when I hit F12).
- other stuff as I think of it.
I've checked it into my sandbox
here.
"Hybrid" Build Notes
I nearly always develop against prebuilt ("make install") binaries, but when I'm tracking down wx issues, I do a hybrid build that uses prebuilt binaries for everything except wx, which is built locally and installed as if the wx binaries were prebuilt (but with symbol information that points at the local sources). Here are notes about the steps I follow...
Windows (helpful notes from John
here, and Robin pointed me at
WxBuildNotes).
- Removed my $SHARED_CYG/full to start fresh
- Turned off realtime antivirus checking, as well as TortoiseSVN file icons (per my friend Pete Gontier here), both of which seem to interfere with the checkout process: I was getting Permission Denied errors from svn co...
- cd $SHARED_CYG; svn co svn+ssh://svn.osafoundation.org/svn/chandler/trunk full
- Turn virus checking and Tortoise icons back on
- cd $SHARED_CYG/full/external; make compilers; make env (Note: normally, "export BUILD_ROOT=`pwd`" would be needed before "make compilers", but I export BUILD_ROOT automatically)
- make DEBUG=1 to-python
- Installed gettext and gettext-devel using cygwin setup; the next step failed the first time before I'd done this.
- cd $SHARED_CYG/full/chandler; make DEBUG=1 install
- cd $SHARED_CYG/full; svn co svn+ssh://svn.osafoundation.org/svn/wx/trunk wx
- on Windows: cd $SHARED_CYG/full/wx; make DEBUG=1 wxWidgets wxPython installDLLs snap drop
- on Ubuntu: cd $SHARED_CYG/full/wx; make DEBUG=1 build snap drop
- Copied one of my WinDebug?.wp{ru} project file sets to $SHARED_CYG/full/chandler, opened Wing, opened that project, and changed the project settings to point at the $SHARED_CYG/full paths
- Ran Chandler from within Wing
- Ran Visual Studio; opened $SHARED_CYG/full/wx/build/msw/wx_osaf.sln; attached to the python_d process named "Chandler".
Subsequent rebuilds:
- cd $SHARED_CYG/full/chandler; svn up; make DEBUG=1 clean install purge
- cd $SHARED_CYG/full/external; export BUILD_ROOT=`pwd`; make env
- cd $SHARED_CYG/full/wx; svn st
- Consider reverting modified files (I noticed some locale files changed for some reason...)
- svn up
- make DEBUG=1
- make DEBUG=1 installDLLs snap drop
Mac notes (never completed):
- Installed XCode 1.5 on my (Panther) Mac (from a previously-downloaded disk image)
- Installed the November 2004 GCC updater, downloaded from Apple's developer member site.
- (still working on this...)
Other notes
My Wing Settings
(I recently talked through setting up Wing with Darshana - the conversation is
WingSetup20061024)
Note that these are the settings that I put in the projects in my main development tree (which lives in ~/shared/osaf).
In all projects, I have the Run Arguments for Chandler.py set to "--nocatch --create --profileDir ../../../unshared --webserver". Most of the rest of these settings are done in Project -> Properties..., in the Environment tab.
Linux
(I need to verify these, once the new shared Linux machine is set up!)
Python Executable: /home/stearns/unshared/osaf/chandler/release/bin/python
Initial Directory: /home/stearns/shared/osaf/chandler
Add to system environment: LD_LIBRARY_PATH=/home/stearns/unshared/osaf/chandler/release/lib:/home/stearns/unshared/osaf/chandler/release/db/lib
Mac
Python Executable:
/Users/stearns/unshared/osaf/chandler/release/Library/Frameworks/Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python
Python Path: /Users/stearns/shared/osaf/chandler
Initial Directory: /Users/stearns/shared/osaf/chandler
Add to system environment:
DYLD_LIBRARY_PATH=~/unshared/osaf/chandler/release/lib:~/unshared/osaf/chandler/release/db/lib
DYLD_FRAMEWORK_PATH=~/unshared/osaf/chandler/release/Library/Frameworks
PARCELPATH=~/shared/parcels
WinXP
Python Executable: c:\cygwin\home\bryan\osaf\chandler\release\bin\python.exe
Python Path: z:\main\chandler;z:\main\chandler\parcels
(Note: adding parcels allows running individual unit test files; also, add "UNIT_TESTING=True" to the file's environment settings.)
Add to system environment:
PATH=c:\cygwin\home\bryan\osaf\chandler\release\bin