Life on the bleeding edge
There is no formal support for snapshot users; we respond to pleas for assistance on a case-by-case basis as time allows. Snapshot users are encouraged to sign up for and use the
bocca bug tracker.
It's not so bad. We really, really won't hurt your code
Question: Assuming you have used a bocca snapshot to create a project, written some sidl and impl files, and want not to lose that work, how should you proceed to a new version of bocca?
Answer (bocca svn version 1077 (Oct 17, 2007) or later):
- Backup: tar up your project into a nice safe tar file, e.g. tar cf myproj.tar myproj.
- Reconfigure the project. specifying the new bocca, e.g.
./configure --with-bocca=/path/to/bocca ;# full path to bocca executable
make clean; make
- Try continuing to work with the new bocca version by issuing some bocca commands to create a component and to add, then remove a port instance from an existing component and then make clean; make. If all that works, you're in possession of a compatible new bocca. If that fails, continue with the next step.
- Since you're trying these later steps, first delete the project and untar your untouched project. Tar is your friend.
- You will recreate a pristine new project with all new bocca bits simply by importing your existing code from the old project, as outlined in the next section. All your existing sidl and impl files are used strictly in read-only mode for importing, so the worst that can happen is you may find an incompleteness in our import process.
Importing code from a project made with an old snapshot of bocca
The process illustrated is a workaround based on current capabilities. There are plans (with no definite implementation schedule) for a bocca aware "bocca project import" that would automatically take care of all the details. Basically the workaround process to import an old project is to repeat the bocca create commands that led to the existing code, but to use --import options to have bocca extract your existing sidl/impl codes and put them in the new project.
By example, say you did the following to create the old project P:
bocca create project P
cd P
bocca create port S
bocca edit S ; #inserted your methods
bocca create component C -lc --uses=S:useS --go=run --provides=S:provideS
bocca edit -m C ; # add some private data to the header
bocca edit -i C ; # add the impl bodies
You now repeat all that, but the code you wrote is preserved by importing it.
- First copy (or untar) your project to a new location or just rename it.
- For this example, we assume the directory had the project name P and so we rename it to P.orig.
- P.orig exists in a directory we will denote $TOPDIR.
bocca create project P; cd P
bocca config project --set-var=Project:exclude_from_import --value=None
bocca create port S \
--import-sidl=P.S:$TOPDIR/P.orig/ports/sidl/P.S.sidl
bocca create component C -lc --uses=S:useS --go=run --provides=S:provideS \
--import-impl=P.C:$TOPDIR/P.orig/components/P.C \
--import-sidl=P.C:$TOPDIR/P.orig/components/sidl/P.C.sidl
- Voila, you now have your old components with all the latest bocca bells and whistles, including the new makefile setup if that changed. If you want to verify, just run diff or mgdiff or compare to see what changed, e.g.:
cd ../
mgdiff P.orig/components/P.C/P_C_Impl.c P/components/P.C/P_C_Impl.c
mgdiff P.orig/components/P.C/P_C_Impl.h P/components/P.C/P_C_Impl.h
Version controls and build customization
In the new directory you no longer have your CVS or .svn directories and you no longer have any user-customized makefile fragments (make.vars.user, make.rules.user) or configure.in script. There is no automated solution yet for moving that build information to the new project directory or for moving the newly generated project files back into your version controlled directory space; these features may be part of the project import functionality previous mentioned.
If you were clever enough to check bocca out of subversion and use it, we expect you to be clever enough to write a shell script that copies files as needed in/out of your version controlled source tree. "diff -r --brief P.orig P" should tell you what the files you may need to copy/update manually are (make clean in both P and P.orig before the diff to simplify the examination).
Basic items to attend to in the diff:
- anything in a .bocca or BOCCA directory.
- any tailored configure.in and configure.
- any make.vars.user, make.rules.user.
- any customization that connects your project to external code (external libraries, headers, sidl). Soon most of these you will be able to handle with 'bocca config' comma nds, but this is still in development.
Version control hint:
Likely the most efficient way to reliably move your newly generated project into the existing repository is to move the version control information into the newly generated directory tree rather than moving files out. This can be done by using find and a shell script intelligently. e.g. (sh script):
NEWDIR=/where/is/P ; # the project directory just created with --import
cd P.orig/
find . -type d -name CVS -exec copyVCdir.sh {} $NEWDIR \;
where copyVCdir.sh is in your path and looks like:
#!/bin/sh
# put a copy of CVS or .svn in NEWDIR
# $1 should be the relative path of the directory in both source trees.
# assumes gnu cp.
target=`dirname $1`
cp -a $1 $2/$target
Then you can svn status or cvs -n update inside your new project and let your version control system tell you what happened. Pay particular attention to new files marked with "'?' filename" that you don't recognized as compilation artifacts.