improved lots of documentation and fixed a few build issues
diff --git a/aos/build/aos.gypi b/aos/build/aos.gypi
index 92b3e8f..20df99b 100644
--- a/aos/build/aos.gypi
+++ b/aos/build/aos.gypi
@@ -67,8 +67,8 @@
},
], ['PLATFORM=="linux-amd64-gcc"', {
'make_global_settings': [
- ['CC', '<(ccache)<!(which gcc)'],
- ['CXX', '<(ccache)<!(which g++)'],
+ ['CC', '<(ccache)<!(which gcc-4.7)'],
+ ['CXX', '<(ccache)<!(which g++-4.7)'],
],
},
], ['PLATFORM=="linux-amd64-gcc_4.8"', {
diff --git a/aos/build/build.py b/aos/build/build.py
index 4ad5021..1a84b1b 100755
--- a/aos/build/build.py
+++ b/aos/build/build.py
@@ -213,8 +213,8 @@
"""
raise NotImplementedError('build_env should be overriden')
- def check_installed(self):
- """Makes sure that all packages necessary to build are installed."""
+ def check_installed(self, platforms, is_deploy):
+ """Makes sure that everything necessary to build platforms are installed."""
raise NotImplementedError('check_installed should be overriden')
def parse_platforms(self, string):
"""Args:
@@ -254,15 +254,29 @@
Args:
other_packages: A tuple of platform-specific packages to check for."""
- all_packages = () + other_packages
+ all_packages = other_packages
+ # Necessary to build stuff.
+ all_packages += ('ccache', 'make')
+ # Necessary to download stuff to build.
+ all_packages += ('wget', 'git', 'subversion', 'patch', 'unzip', 'bzip2')
+ # Necessary to build externals stuff.
+ all_packages += ('python', 'gcc', 'g++')
try:
result = subprocess.check_output(
('dpkg-query', '--show') + all_packages,
stdin=open(os.devnull, 'r'),
stderr=subprocess.STDOUT)
except subprocess.CalledProcessError as e:
- user_output('Some packages not installed:\n'
- + e.output.decode('utf-8').rstrip())
+ output = e.output.decode('utf-8').rstrip()
+ not_found = []
+ for line in output.splitlines(True):
+ match = re.match(r'dpkg-query: no packages found matching (.*)',
+ line)
+ if match:
+ not_found.append(match.group(1))
+ user_output('Some packages not installed: %s.' % ', '.join(not_found))
+ user_output('Try something like `sudo apt-get install %s`.' %
+ ' '.join(not_found))
exit(1)
class CRIOProcessor(Processor):
@@ -276,12 +290,12 @@
self.__wind_base = wind_base
def __repr__(self):
- return 'CRIOProcessor.Platform(debug=%s)' % self.debug
+ return 'CRIOProcessor.Platform(debug=%s)' % self.debug()
def __str__(self):
- return 'crio%s' % ('-debug' if self.debug else '')
+ return 'crio%s' % ('-debug' if self.debug() else '')
def outname(self):
- return 'crio-debug' if self.debug else 'crio'
+ return 'crio-debug' if self.debug() else 'crio'
def os(self):
return 'vxworks'
def gyp_platform(self):
@@ -290,6 +304,8 @@
return 'ppc'
def compiler(self):
return 'gcc'
+ def sanitizer(self):
+ return 'none'
def debug(self):
return self.__debug
def wind_base(self):
@@ -335,10 +351,11 @@
def download_externals(self, _):
call_download_externals('crio')
- def check_installed(self):
- # TODO(brians): Add powerpc-wrs-vxworks (a new enough version too).
- self.do_check_installed(
- ('ncftp',))
+ def check_installed(self, platforms, is_deploy):
+ packages = ('powerpc-wrs-vxworks', 'tcl')
+ if is_deploy:
+ packages += ('ncftp',)
+ self.do_check_installed(packages)
class PrimeProcessor(Processor):
"""A Processor subclass for building prime code."""
@@ -524,6 +541,8 @@
def parse_platforms(self, string):
if string is None:
return self.default_platforms()
+ elif string == 'all':
+ return self.platforms()
r = self.default_platforms()
for part in string.split(','):
if part[0] == '+':
@@ -571,10 +590,25 @@
debug=debug,
sanitizer=sanitizer)
- def check_installed(self):
- self.do_check_installed(
- ('clang-3.5', 'gcc-4.7-arm-linux-gnueabihf',
- 'g++-4.7-arm-linux-gnueabihf', 'openssh-client'))
+ def check_installed(self, platforms, is_deploy):
+ packages = set(('lzip', 'm4', 'realpath'))
+ packages.add('ruby')
+ # clang-format from here gets used for all versions.
+ packages.add('clang-3.5')
+ packages.add('arm-eabi-gcc')
+ for platform in platforms:
+ if platform.architecture() == 'arm':
+ packages.add('gcc-4.7-arm-linux-gnueabihf')
+ packages.add('g++-4.7-arm-linux-gnueabihf')
+ if platform.compiler() == 'clang' or platform.compiler() == 'gcc_4.8':
+ packages.add('clang-3.5')
+ if is_deploy:
+ packages.add('openssh-client')
+ if platform.compiler() == 'gcc' and platform.architecture() == 'amd64':
+ packages.add('gcc-4.7')
+ packages.add('g++-4.7')
+
+ self.do_check_installed(tuple(packages))
def main():
class TryParsingAgain(Exception):
@@ -652,7 +686,6 @@
args.action_name == 'deploy')
else:
parser.exit(status=1, message='Unknown processor "%s".' % args.processor)
- processor.check_installed()
if 'target' in args:
targets = args.target[:]
@@ -669,6 +702,7 @@
user_output("No platforms selected!")
exit(1)
+ processor.check_installed(platforms, args.action_name == 'deploy')
processor.download_externals(platforms)
class ToolsConfig(object):
@@ -713,8 +747,8 @@
return True
dirs = os.listdir(os.path.join(aos_path(), '..'))
# Looking through these folders takes a long time and isn't useful.
- dirs.remove('output')
- dirs.remove('.git')
+ if dirs.count('output'): dirs.remove('output')
+ if dirs.count('.git'): dirs.remove('.git')
return not not subprocess.check_output(
('find',) + tuple(os.path.join(aos_path(), '..', d) for d in dirs)
+ ('-newer', platform.build_ninja(),
diff --git a/aos/build/download_externals.sh b/aos/build/download_externals.sh
index bb2fe76..106e2db 100755
--- a/aos/build/download_externals.sh
+++ b/aos/build/download_externals.sh
@@ -6,6 +6,10 @@
AOS=$(readlink -f $(dirname $0)/..)
. $(dirname $0)/tools_config
+# A separate variable for stuff that should be in LDFLAGS for everything because
+# the value from CONFIGURE_FLAGS has to get overriden in some places.
+ALL_LDFLAGS=""
+
if [ "$1" == "arm" ]; then
COMPILED=${EXTERNALS}/../compiled-arm
@@ -29,7 +33,8 @@
export CFLAGS="-fPIE"
export CXXFLAGS="-fPIE"
- export LDFLAGS="-fPIE"
+ ALL_LDFLAGS="-fPIE"
+ export LDFLAGS=${ALL_LDFLAGS}
CONFIGURE_FLAGS="CFLAGS=\"${CFLAGS}\" CXXFLAGS=\"${CXXFLAGS}\" LDFLAGS=\"${LDFLAGS}\""
IS_CRIO=0
elif [ "$1" == "crio" ]; then
@@ -170,9 +175,10 @@
wget ${LIBCDD_URL} -O ${LIBCDD_TAR}
[ -d ${LIBCDD_DIR} ] || ( mkdir ${LIBCDD_DIR} && tar \
--strip-components=1 -C ${LIBCDD_DIR} -xf ${LIBCDD_TAR} )
-[ -f ${LIBCDD_LIB} ] || LDFLAGS=-L${GMP_PREFIX}/lib \
+[ -f ${LIBCDD_LIB} ] || \
bash -c "cd ${LIBCDD_DIR} && ./configure \
--disable-shared ${CONFIGURE_FLAGS} \
+ LDFLAGS=\"${ALL_LDFLAGS} -L${GMP_PREFIX}/lib\"\
--prefix=$(readlink -f ${LIBCDD_PREFIX}) \
&& make gmpdir=${GMP_PREFIX} && make install"
diff --git a/aos/build/queues/compiler.rb b/aos/build/queues/compiler.rb
index 90c88a7..864d1c6 100644
--- a/aos/build/queues/compiler.rb
+++ b/aos/build/queues/compiler.rb
@@ -60,7 +60,7 @@
end
def format_pipeline(output)
read_in, write_in = IO.pipe()
- child = Process.spawn('clang-format-3.4 --style=google',
+ child = Process.spawn('/opt/clang-3.5/bin/clang-format --style=google',
{:in=>read_in, write_in=>:close,
:out=>output.fileno})
read_in.close
diff --git a/doc/building-the-code.txt b/doc/building-the-code.txt
index 14a739c..fc3a7ae 100644
--- a/doc/building-the-code.txt
+++ b/doc/building-the-code.txt
@@ -6,41 +6,14 @@
[Install Packages]
First, you have to download and follow the directions in
<http://robotics.mvla.net/files/frc971/packages/frc971.list>.
-You also have to follow the directions at
- <http://backports-master.debian.org/Instructions/>.
-Then, run `apt-get install subversion git g++-multilib gcc-multilib ruby patch \
- make openjdk-6-jdk lib32event-dev python unzip bzip2 default-jdk`
- and `apt-get install -t squeeze-backports swig` (package lists correct for
- amd64 Squeeze; you might be able to get it to build on other
- versions/platforms/distributions (Ubuntu, Mint, ...) if you can find the
- right packages.
+Then, run `apt-get install python3`.
+The build script will tell you what other packages to install when you run it.
+ It's pretty smart about not checking for things it doesn't need, so you might
+ want to build 'deploy all' to see everything it wants.
You will have to accept the
- "WARNING: The following packages cannot be authenticated!" warning for the
- "libevent-2.0-5 lib32event-2.0-5 libevent-core-2.0-5 lib32event-core-2.0-5 \
- libevent-extra-2.0-5 libevent-pthreads-2.0-5 libevent-openssl-2.0-5 \
- libevent-dev lib32event-extra-2.0-5 lib32event-pthreads-2.0-5 \
- lib32event-openssl-2.0-5 lib32event-dev" packages.
-
-(On 64-bit Ubuntu Precise Pangolin:
-`apt-get install subversion git g++-multilib gcc-multilib ruby patch \
- make openjdk-6-jdk default-jdk libevent-dev:i386 libevent-2.0-5:i386`)
-
-Also run `apt-get install powerpc-wrs-vxworks tcl` if you want to be able to
- build the cRIO code too.
- NOTE: This is in *addition* to the above commands.
- You will have to accept the
- "WARNING: The following packages cannot be authenticated!" warning for the
- "powerpc-wrs-vxworks" package.
-If you want to actually download code to a robot (it will only work on amd64
- Squeeze), then
- (1) do `apt-get install ncftp rsync socat`.
- socat is used for the netconsole.sh tool that is used to talk to the cRIO.
- (2) Set the IP address of the downloading machine to be on the same subnet.
- ifconfig eth0 10.9.71.22
- This will need to be redone when the computer Ethernet connection is
- reset. For example, it is reset by disconnecting and reconnecting
- the Ethernet cable or power cycling the robot. Check it with
- ifconfig eth0
+ "WARNING: The following packages cannot be authenticated!" warning for
+ various packages downloaded from our package repository.
+ This works for amd64 Wheezy, no guarantees or support for anything else.
[Running Locally]
If you want to be able to run the realtime code on your development machine
@@ -48,13 +21,21 @@
variable), follow the directions in /src/aos/config/aos.conf.
[Compiling and Downloading]
-Run `./build.sh` from src/frc971/atom_code/ and src/frc971/crio/.
-Use `./build.sh deploy` to download to a robot.
+Run src/frc971/{atom_code,crio}/build.sh.
+ Give it clean, tests, or deploy as a first argument to do something other
+ than just build.
+ Each action (build (the default), clean, tests, or deploy) has a different
+ default set of versions of the code it builds. You can change those by
+ passing another argument. Some popular ones are 'all' (build everything),
+ 'clang-amd64-none' (the most basic one for local testing), and
+ 'gcc-arm-nodebug' (the one that gets downloaded). See its --help for
+ more details.
[Communicating with the cRIO]
-Use netconsole.sh to communicate directly with the cRIO.
-frc971/2013/trunk/src/aos/crio/bin/netconsole.sh
+Use netconsole (in the amd64 outputs directories) to communicate directly with
+ the cRIO.
Use "reboot" from within netconsole.sh will reboot the cRIO. ^C will
-stop it the netconsole.sh command. "version" will tell you the the
-VxWorks and WIND versions and "help" will give you a list of VxWorks
-commands that you can use.
+ stop the netconsole program. "version" will tell you the the
+ VxWorks and WIND versions and "help" will give you a list of VxWorks
+ commands that you can use.
+Make sure your computer is on the right subnet first.
diff --git a/doc/clang-3.5.ctl b/doc/clang-3.5.ctl
index dfbae3e..b20c52a 100644
--- a/doc/clang-3.5.ctl
+++ b/doc/clang-3.5.ctl
@@ -1,28 +1,13 @@
-# This is a control file for creating the clang-3.5 package.
-### Commented entries have reasonable defaults.
-### Uncomment to edit them.
Source: llvm-toolchain-snapshot
Section: misc
Priority: optional
Homepage: http://www.llvm.org/
Standards-Version: 3.9.2
-
Package: clang-3.5
Version: 1:3.5~svn201561
Maintainer: FRC Team 971 <spartanrobotics.org>
-# Pre-Depends: <comma-separated list of packages>
Depends: libbsd0, libc6, libedit2, libncurses5, libpython2.7, libtinfo5, zlib1g
-# Recommends: <comma-separated list of packages>
-# Suggests: <comma-separated list of packages>
-# Provides: <comma-separated list of packages>
-# Replaces: <comma-separated list of packages>
Architecture: amd64
-# Copyright: <copyright file; defaults to GPL2>
-# Changelog: <changelog file; defaults to a generic changelog>
-# Readme: <README.Debian file; defaults to a generic one>
-# Extra-Files: <comma-separated list of additional files for the doc directory>
-# Files: /opt/clang-3.5/ /opt/
-# <more pairs, if there's more than one file to include. Notice the starting space>
Description: Clang 3.5 with included GCC 4.8 so it actually works.
This is just 1 massive package with a newer clang that doesn't conflict with
other stuff like the official clang-3.5 package does.
diff --git a/doc/git-setup.txt b/doc/git-setup.txt
index d0fd0af..6fc52b5 100644
--- a/doc/git-setup.txt
+++ b/doc/git-setup.txt
@@ -1,16 +1,13 @@
Some of us are using git for managing quickly changing code. This file has
notes for setting that up.
-ssh to robotics.mvla.net and add the git executables to your .bashrc:
- PATH=$PATH:/www/https/files/frc971/2013/brian/
-
[Cloning]
`git clone \
- ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2013.git`
+ ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2014.git`
where USERNAME is your login on the server and SOMEBODY is whoever's git
repo you want to clone
If you don't have a login on the server, then cloning
- https://robotics.mvla.net/git/frc971/somebody/2013.git instead should work
+ https://robotics.mvla.net/git/frc971/somebody/2014.git instead should work
(with your SVN username and password). However, that form of URL is read-
only. In order for this to work, you have to either set the environment
variable GIT_SSL_NO_VERIFY to 1 or set the git option http.sslverify to false.
@@ -22,46 +19,36 @@
[Adding Other People's Repositories]
`git remote add SOMEBODY \
- ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2013.git`
+ ssh://USERNAME@robotics.mvla.net/www/https/git/frc971/SOMEBODY/2014.git`
where USERNAME is your login on the server and SOMEBODY is another person's
git repository
The https:// URL discussed above in [Cloning] will work too.
[Working with Other People's Repositories]
`git fetch SOMEBODY` will pull their changes, and then you can rebase on top of
- them etc.
+ them, merge them in, etc.
`git push --mirror` will push all of your local branches so that everybody else
can see them. (This is the default if the configuration option remote.<remote>.mirror is set.)
However, you can not do that with an https:// URL.
[Synchronizing with SVN]
-In order to synchronize the git commits with svn, somebody has to set up git-svn in their local git repo and then push/pull commits.
-
-To do that, `git svn init https://robotics.mvla.net/svn/frc971/2013/trunk/src`
-
-Then, unless you want git-svn to pull down everything from SVN again, you have to edit .git/refs/remotes/git-svn (or whatever you name the remote) in your local repository and put in the commit ID of the latest commit in the repository that's from SVN.
-
-After doing that (and a `git svn fetch`), git-svn works like usual (see git-svn(1) for details).
-
-To pull changes from svn, do `git-svn fetch`. To push changes to svn, do `git svn dcommit`, which will take all of your git commits between the latest commit from svn and your HEAD and make them into svn commits.
-
-Multiple people dealing with svn works OK because the git commit SHAs end up the same so they all just become the same objects.
+Somebody should occasionally copy all of the files from git (bbb_cape,
+ frc971, and aos) into svn.
[Server Setup]
-To get started working with git on the server, first you have to set up your
- .bashrc so that the git tools work. To do that, add the following line to your
- .bashrc *ABOVE* the '[ -z "$PS1" ] && return' line.
- PATH=$PATH:/www/https/files/frc971/2013/brian/
-You also need a place to store your files. You will need an adminstrator to
+You need a place to store your files. You will need an adminstrator to
create a folder for you in /www/https/git/frc971 (on the server) with the
correct permissions and group.
[Repository Setup]
To create a git repository on the server,
- "/www/https/git/frc971/brian/bare-git-repo" to wherever you want your
- repository (using `git init` won't work correctly). The standard location for
- mirrors of the "https://robotics.mvla.net/svn/frc971/YEAR/trunk/src" folder is
- "/www/https/git/frc971/USERNAME/YEAR.git".
+ `git init --bare 2014.git` in your folder (ie
+ "/www/https/git/frc971/USERNAME/"), `cd 2014.git`,
+ `git config --local gc.pruneExpire never`, `rm -r objects/`, and then
+ `ln -s /www/https/git/frc971/objects/2014 objects`. That will set you up
+ with a repository in the standard location and make it so all of the objects
+ in it won't be duplicated with the identical ones in everybody else's
+ repositories.
In order for https:// access to work, you have to make sure to rename
.git/hooks/post-update.sample to .git/hooks/post-update (and then run
`git update-server-info` if you're not going to push immediately).