Binders World

Coding

Information about Magnuz Binder's work with the OpenSimulator codebase.


Content


Back to top


Background

Magnuz Binder is neither a C# programmer nor an OpenSimulator developer, but has found a few bugs in OpenSimulator, managed to locate some of them in the OpenSimulator codebase, and submit code patches to fix some.

He also follows the OpenSimulator code development closely, and makes some own analyses and compilations from it.


Back to top


OpenSimulator Mantis

Mantis is the report systems where bugs found in OpenSimulator should be reported.


Back to top


OpenSimulator GIT

GIT is the versioning system used to manage the OpenSimulator codebase.


Back to top


Workflow

This is a suggested workflow for working with patches to the OpenSimulator codebase, adapted for Ubuntu 14.04.

Install programs

This assumes you already have components for running OpenSimulator and your editor installed.

sudo apt-get update
sudo apt-get install git-core nant nunit-console
yes
git config --global user.name "Your Name" # nick or real
git config --global user.email your.name@yourhost.com # valid e-mail
git config --global core.editor emacs # or nano, pico, vi, vim, or other favorite editor
git config --list

Initial setup

mkdir ~/patches # directory to collect patch files
git clone git://opensimulator.org/git/opensim ~/opensim_repo
cd ~/opensim_repo/
git checkout master
git pull
./runprebuild.sh
xbuild
nant test

Configure and run simulator

If you use MySQL or PostgreSQL, you will need to set up a database for the new simulator. You may also need to set up routers and firewalls for it.

cp ~/opensim_repo/bin/OpenSim.ini.example ~/opensim_repo/bin/OpenSim.ini
emacs ~/opensim_repo/bin/OpenSim.ini
...
<Ctrl-x><Ctrl-c>y
cp ~/opensim_repo/bin/config-include/StandaloneCommon.ini.example ~/opensim_repo/bin/config-include/StandaloneCommon.ini
emacs ~/opensim_repo/bin/config-include/StandaloneCommon.ini
...
<Ctrl-x><Ctrl-c>y
cp ~/opensim_repo/bin/config-include/GridCommon.ini.example ~/opensim_repo/bin/config-include/GridCommon.ini
emacs ~/opensim_repo/bin/config-include/GridCommon.ini
...
<Ctrl-x><Ctrl-c>y
cp ~/opensim_repo/bin/config-include/FlotsamCache.ini.example ~/opensim_repo/bin/config-include/FlotsamCache.ini
emacs ~/opensim_repo/bin/config-include/FlotsamCache.ini
...
<Ctrl-x><Ctrl-c>y
cp ~/opensim_repo/bin/Regions/Region.ini.example ~/opensim_repo/bin/Regions/Region.ini
emacs ~/opensim_repo/bin/Regions/Region.ini
...
<Ctrl-x><Ctrl-c>y
cd ~/opensim_repo/bin/
mono --debug OpenSim.exe
...
shutdown
screen -S opensim_test -dm mono --debug OpenSim.exe
screen -r opensim_test # check sim start
<Ctrl-a><Ctrl-d>
cd ~/opensim_repo/

Fix something

cd ~/opensim_repo/
git checkout -b 'FixSomething' origin/master
git pull
./runprebuild.sh
xbuild # note number of warnings as reference
nant test # note result as reference
screen -r opensim_test
shutdown
cd ~/opensim_repo/bin/
screen -S opensim_test -dm mono --debug OpenSim.exe
screen -r opensim_test # check sim start
<Ctrl-a><Ctrl-d>
# set up scene and test code in simulator negative
cd ~/opensim_repo/
emacs ~/opensim_repo/path1/file1
...
<Ctrl-x><Ctrl-c>y
git status
git add path1/file1
git commit -m "Fix something part 1"
emacs ~/opensim_repo/path1/file1
...
<Ctrl-x><Ctrl-c>y
emacs ~/opensim_repo/path2/file2
...
<Ctrl-x><Ctrl-c>y
git status
git add path1/file1 path2/file2
git commit -m "Fix something part 2"
emacs ~/opensim_repo/path3/file3
...
<Ctrl-x><Ctrl-c>y
git status
git add path3/file3
git commit -m "Fix something part 3"

Test fix

./runprebuild.sh
xbuild # compare number of warnings to reference, should not increase
nant test # compare result to reference, should not add errors
screen -r opensim_test
shutdown
cd ~/opensim_repo/bin/
screen -S opensim_test -dm mono --debug OpenSim.exe
screen -r opensim_test # check sim start
<Ctrl-a><Ctrl-d>
# test code fix in simulator positive
cd ~/opensim_repo/

Squash patches

git log # copy last <commit hash> before your own commits
q
git format-patch <commit hash>
less ~/opensim_repo/0001-Fix-something-part-1.patch # visual sanity check
q
less ~/opensim_repo/0002-Fix-something-part-2.patch # visual sanity check
q
less ~/opensim_repo/0003-Fix-something-part-3.patch # visual sanity check
q
git checkout -b 'FixSomething1' origin/master
git pull
git apply ~/opensim_repo/0001-Fix-something-part-1.patch # should give no warnings
git apply ~/opensim_repo/0002-Fix-something-part-2.patch # should give no warnings
git apply ~/opensim_repo/0003-Fix-something-part-3.patch # should give no warnings
git commit -m "Fix something"
git log # copy <commit hash> for your own last commit
q
git format-patch -1 <commit hash>
less ~/opensim_repo/0001-Fix-something.patch # visual sanity check
q

Test patch

git checkout -b 'FixSomething2' origin/master
git pull
git apply ~/opensim_repo/0001-Fix-something.patch # should give no warnings
git commit -m "Fix something"
./runprebuild.sh
xbuild # compare number of warnings to reference, should not increase
nant test # compare result to reference, should not add errors
screen -r opensim_test
shutdown
cd ~/opensim_repo/bin/
screen -S opensim_test -dm mono --debug OpenSim.exe
screen -r opensim_test # check sim start
<Ctrl-a><Ctrl-d>
# test code fix in simulator positive
cd ~/opensim_repo/

Clean up

git checkout master
git pull
mv ~/opensim_repo/0001-Fix-something.patch ~/patches/
rm ~/opensim_repo/0001-Fix-something-part-1.patch
rm ~/opensim_repo/0002-Fix-something-part-2.patch
rm ~/opensim_repo/0003-Fix-something-part-3.patch
git branch -D FixSomething1
git branch -D FixSomething2


Back to top


Valid XHTML 1.1 Valid CSS 2.1

http://binders.world/coding/index.html © 2015-2017 Binders World
Created 2015-05-08 and updated 2017-01-12 by magnuz.binder@gmail.com