On 1/10/2012 10:41 AM, Christian Dywan wrote:
Hejsan,

currently how one deploys DXR is somewhat up in the air. So let's get
the pieces together. It's a little challenge to make this non-specific
to the individual, so input from anyone who set up or will setup DXR is
appreciated. I'm looking at Malini in particular here.

Below is the most relevant part of the script that has been used on dxr.mozilla.org.

# Before: pull the source trees

# Rebuild source trees
# The '-std=gnu89' is needed because of the age of our libc, which causes
# issues with clang's c99 default.
export CFLAGS=-std=gnu89
for i in $(seq 0 $((${#srcdirs[@]} - 1))); do
  srcdir=${srcdirs[i]}
  objdir=${objdirs[i]}
  name=$(basename $srcdir)
  # XXX: temporarily hardcoded
  conferr=/tmp/configure.errors.log
  builderr=/tmp/build.errors.log

  # Prepare the environment to build DXR indexing
  pushd $HOME/dxr-clang
  . setup-env.sh $srcdir $objdir
  popd

  # A clobber build: remove the objdir, build from scratch
  rm -rf $objdir
  pushd $srcdir
  echo "Starting the configure process..."
  make -f client.mk configure &> $conferr
  if [ $? != 0 ] ; then
   submitError "Error configuring $name" $conferr
   exit 1
  fi

  # Since we trashed the objdir, we need to add these myrules.mk back in
  # [this is needed for IDL support]
  pushd $objdir
  for f in $(find -name 'autoconf.mk'); do
echo '-include $(DXRSRC)/xref-tools/moztools/myrules.mk' >> ${f/autoconf/myrules}
  done
  popd

  # Clean up any old .csv files, particularly those generated by configure
  find $objdir -name '*.csv' | xargs rm

  # Build
  echo "Starting the build process..."
  make -f client.mk build &> $builderr
  if [ $? != 0 ] ; then
   echo "build error: $builderr"
   # Is this an acceptable error?
   out=$(grep -P -L -f /home/mozbuild/safe-errs.txt $builderr)
   if [ $out ] ; then
     submitError "Error building $name" $builderr
     exit 1
   fi
  fi
  popd
done

# This does the actual indexing
index_file=/tmp/dxr.index
pushd /var/www/html/dxr/mozilla/
python26 $HOME/dxr-clang/dxr-index.py &> $index_file
if [ $? != 0 ] ; then
 submitError "Error indexing mozilla-central" $index_file
 exit 1
fi
popd
pushd /var/www/html/dxr/comm-central/
python26 $HOME/dxr-clang/dxr-index.py &> $index_file
if [ $? != 0 ] ; then
 submitError "Error indexing comm-central" $index_file
 exit 1
fi
popd




You find the script in my github:
https://github.com/kalikiana/dxr/blob/update-sh/update.sh

So update.sh has a couple of variables at the top. The idea is, you
prepare this once. If you have multiple trees, there are 2 variables:

./update.sh

or

TREE=comm-central VCSPULL='echo .' ./update.sh

VCSPULL is the command updating the source, or doing nothing.

I also included the typical error checks. So if you pipe this to a log
file that should save some time being puzzled.

If you specify REMOTE, rsync will copy to your web frontend server
assuming the file layout is the exact same.


To make sure you don't get surprises I have a patch waiting for review,
to version the databases. Ehsan, could you look into that, please?

https://bugzilla.mozilla.org/show_bug.cgi?id=708588

And some cleaning up for the layout:

https://bugzilla.mozilla.org/show_bug.cgi?id=708600
https://bugzilla.mozilla.org/show_bug.cgi?id=708589

Originally I was going to literally tear apart the modules, see the
branch I pushed earlier. You would have the indexer, the HTML generator
and the search frontend split. But it turns out, that would be a pain to
maintain for plugin writers. So I figure mirroring the folder layout and
wasting a few bytes, which is hot air compared to the actual data, is
eventually more useful.

Feedback still welcome of course. If I'm assuming too much to my
specific setup, please point it out.

To me, the biggest issue is that there may want to be more steps. Eventually, I think there needs to be the following:
1. Update source code
2. Configure the tree
[ Clobber generated files from configure ]
3. Run some post-configuration steps (for Mozilla code, we want to stuff some things in myrules.mk)
4. Build the tree
5. Run some post-build steps (e.g., code-coverage)
[ Generate index ]
6. Move results elsewhere

I think all of the numbered steps probably want commands to do them
_______________________________________________
dev-static-analysis mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-static-analysis

Reply via email to