User Tools

Site Tools


wiki:development:development-workspace

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
wiki:development:development-workspace [2011/08/09 08:01]
morty More info for non-maintainers
wiki:development:development-workspace [2013/03/14 23:40] (current)
sunweaver [Build X2Go Packages for Debian]
Line 1: Line 1:
-====== How to set up an X2go Development Workspace ======+====== How to set up an X2Go Development Workspace ======
  
 ===== Get the Code ===== ===== Get the Code =====
  
 Before you can start developing you need the source code. Before you can start developing you need the source code.
-The code is managed in a [[git | GIT repository]]. +The code is managed in a [[git| GIT repository]]. 
  
 ===== Building ===== ===== Building =====
 +
 +==== Debian/Ubuntu ====
 +
 +On Ubuntu you'll probably need the following dependencies to get a proper build:
 +
 +<code>
 +  sudo apt-get install devscripts debhelper ubuntu-dev-tools build-essential
 +</code>
 +
 +More info in general form: [[https://wiki.ubuntu.com/PackagingGuide/HandsOn]]
 +
 ==== Getting Build Dependencies ==== ==== Getting Build Dependencies ====
-Each git has a file'' debian/control''. It has a section ''Build-Depends''.+Each Git has a file'' debian/control''. It has a section ''Build-Depends''.
  
 The package ''ubuntu-dev-tools'' (also provided in Debian) allows to install them running ''sudo get-build-deps debian/control''. The package ''ubuntu-dev-tools'' (also provided in Debian) allows to install them running ''sudo get-build-deps debian/control''.
  
 ==== Makefile ==== ==== Makefile ====
-Most projects should have makefile, that builds the project running make (This is work in progress).+ 
 +Most projects should have a Makefile, that builds the project by running make (This is work in progress).
  
 ==== DPKG ==== ==== DPKG ====
-installable package can be built running ''debuild -b -us -uc'' in the projet folder. The .deb-file will be place in the superior folder. The package can be installed using ''dpkg -i <packagenmame>*.deb''.+ 
 +An installable package can be built running ''debuild -b -us -uc'' in the project folder. The .deb-file will be placed in the superior folder. The package can be installed using ''dpkg -i <packagenmame>*.deb''.
  
  
 ===== Development Strategies ===== ===== Development Strategies =====
  
-There are a few different approaches for working on X2go code (or Git-hosted code in general). This wiki page will address two of them: HEAD development and local branch development.+There are a few different approaches for working on X2Go code (or Git-hosted code in general). This wiki page will address two of them: HEAD development and local branch development.
  
-=== HEAD X2go Development ===+=== HEAD X2Go Development ===
  
-With the term HEAD one refers to the topmost recent code in a code repository. The Git branch that HEAD development gets committed to is the master branch of each X2go Git project.+With the term HEAD one refers to the topmost recent code in a code repository. The Git branch that HEAD development gets committed to is the master branch of each X2Go Git project.
  
-If you are a core X2go developer and the code you are working on is something that is intended to become a core component of X2go then you are likely to directly work on HEAD.+If you are a core X2Go developer and the code you are working on is something that is intended to become a core component of X2Go then you are likely to directly work on HEAD.
  
 Also bug fixes should be committed to the master branch directly. Also bug fixes should be committed to the master branch directly.
Line 34: Line 47:
 === Development on Local Git Branches === === Development on Local Git Branches ===
  
-However, if you work on a piece of code or a feature, that may or may not become a part of X2go or a piece of code that will break a couple of things when committed to the master branch then you should rather start a local branch to work on that.+However, if you work on a piece of code or a feature, that may or may not become a part of X2Go or a piece of code that will break a couple of things when committed to the master branch then you should rather start a local branch to work on that.
  
 If you want to branch of from HEAD, use this command: If you want to branch of from HEAD, use this command:
Line 51: Line 64:
 You then continue your work on the <my-local-branch-name> branch and commit your changes there. You then continue your work on the <my-local-branch-name> branch and commit your changes there.
  
-You may also upload your local branch to the X2go Git site. Please discuss this first on the x2go-dev mailing list.+You may also upload your local branch to the X2Go Git site. Please discuss this first on the x2go-dev mailing list.
  
 <code> <code>
Line 59: Line 72:
 To incorporate changes from your <my-local-branch-name> you may use e.g. the ''git-cherry-pick'' command or the ''git-checkout'' command.  To incorporate changes from your <my-local-branch-name> you may use e.g. the ''git-cherry-pick'' command or the ''git-checkout'' command. 
  
-Note: The only thing we do not accept on X2go Git are Git merges.+Note: The only thing we do not accept on X2Go Git are Git merges.
  
 ==== Coding Strategies ==== ==== Coding Strategies ====
  
-There are some recommendations that we give when coding X2go and committing in X2go Git:+There are some recommendations that we give when coding X2Go and committing in X2Go Git:
  
   * run ''git-pull'' before starting to work on new code snippets (to avoid nasty merge problems)   * run ''git-pull'' before starting to work on new code snippets (to avoid nasty merge problems)
Line 79: Line 92:
 </code> </code>
  
-__After__ you have performed some changes on an X2go Git project, please use the ''git-commit'' command to commit your changes to your local Git:+__After__ you have performed some changes on an X2Go Git project, please use the ''git-commit'' command to commit your changes to your local Git:
  
 <code> <code>
Line 119: Line 132:
 ==== Maintaining Changelogs ==== ==== Maintaining Changelogs ====
  
-Currently we use Debian tools to maintain each project's changelog file. Debian tools are optimal for developing Debian packages. For an upstream project like X2go we have to find something that's more generic.+Currently we use Debian tools to maintain each project's changelog file. Debian tools are optimal for developing Debian packages. For an upstream project like X2Go we have to find something that's more generic.
  
-However, as this is in process and till it has settled, please continue as described below when maintaining the X2go projects' changelog files.+However, as this is in process and till it has settled, please continue as described below when maintaining the X2Go projects' changelog files.
  
   - code your code   - code your code
Line 132: Line 145:
  
  
-===== Maintiner Stuff =====+===== Maintainer Stuff =====
  
 ==== Install Software ==== ==== Install Software ====
  
-For working with X2go Git you have to install some software on your development workstation. We will presume you develop under Debian:+For working with X2Go Git you have to install some software on your development workstation. We will presume you develop under Debian:
  
 <code> <code>
Line 165: Line 178:
  
  
-==== Reverting Merge Commits ==== 
  
-If you forget to run ''git-pull'' before modifying code files you will run into merge problems when committing your changes. 
  
-There is nothing bad about merge commits apart from the fact that the X2go Git system won't allow them being pushed to the server :-/.+==== Releasing X2Go Projects ====
  
-Thus, you probably want to avoid merge commits right from the beginning. However, from time to time it occurs that you crunch your Git log with a merge commit. This is how such thing can happen:+The X2Go version scheme is a four digit version number''<major>.<minor>.<micro>.<nano>''
  
-  * change file +For releasing X2Go components make sure that you have GPG key for your commit mail address available and installed on your local systemThe commit mail address can normally be found in ''~/.gitconfig'' (see above).
-  * commit it locally +
-  * push it to X2go Git +
-  * find that the push operation gets rejected :-( +
-  * then run ''git-pull'' instead +
-  * and then uuups... realize: the ''git-pull'' fetched in some code for the same file, I have just been working on...-> you probably forgot to run a ''git-pull'' before starting to work on that particular file...+
  
-One possible solution for this is //cherry-picking//. Here is an example (presuming that your are working on the master branch): +If you decide for releasing an X2Go component, please perform the following steps:
- +
-<code> +
-# make a temporary backup copy of the master branch +
-$ git checkout -b master-bak-tmp +
- +
-# go back to master branch +
-$ git checkout master +
- +
-# and reset it to that refspec where local Git and server's Git were known to be still in sync +
-$ git reset --hard <last-refspec-known-to-be-identical-with-server> +
- +
-# then take a look at the log of your old local master branch +
-$ git log master-bak-tmp +
- +
-# now cherry-pick your local changes individually from the master-bak-tmp branch (where refspec-1 ... refspec-n are the commit hashes of each commit): +
-$ git cherry-pick <refspec-1> +
-$ git cherry-pick <refspec-2> +
-... +
-$ git cherry-pick <refspec-n> +
- +
-# finally drop the tmp backup of old master +
-$ git branch -D master-bak-tmp +
-</code> +
- +
-==== Pushing to X2go Git ==== +
- +
-Whenever your local X2go Git project is in an acceptable state for the community, feel free to push the code to the X2go Git server: +
- +
-<code> +
-$ git push +
-</code> +
- +
-<note> +
-When working on master's HEAD do not wait __too__ long before pushing them to the server as it may happen that others work on master's HEAD as well. +
- +
-Keeping back code for too long can result in code conflicts (changes in the same code block of the same file by two different developers). +
-</note> +
- +
-The update scripts of X2go Git will shout warnings at you while pushing. These warnings relate to +
- +
-  * whitespaces found at the end of lines +
-  * tabs found in the file (for Python: no tabs, for Bash, Perl, C++, etc. tabs are wanted, so you can ignore these if not coding Python) +
-  * no \newline at end of file +
- +
-You may consider silencing those warnings before committing the next time... +
- +
-===== Releasing X2go Projects ===== +
- +
-The X2go version scheme is a four digit version number: ''<major>.<minor>.<micro>.<nano>'' +
- +
-For releasing X2go components make sure that you have a GPG key for your commit mail address available and installed on your local system. The commit mail address can normally be found in ''~/.gitconfig'' (see above). +
- +
-If you decide for releasing an X2go component, please perform the following steps:+
  
   - Change any string location in the project that reflects the version number: changelog, VERSION.<x2go-project> file, maybe there is a version number somewhere in the code (Python: __init__.py files)   - Change any string location in the project that reflects the version number: changelog, VERSION.<x2go-project> file, maybe there is a version number somewhere in the code (Python: __init__.py files)
Line 243: Line 196:
 $ git push --tags $ git push --tags
 </code> </code>
-  - Use the ''x2go-updatebuildmain'' script from the X2go buildscripts to update the build-main branch of the project<code>+  - Use the ''x2go-updatebuildmain'' script from the X2Go buildscripts to update the build-main branch of the project<code>
 $ x2go-updatebuildmain HEAD $ x2go-updatebuildmain HEAD
 </code> </code>
-  - Run ''x2go-tarballrelease'' in the base folder of the X2go Git project to be released:<code>+  - Run ''x2go-tarballrelease'' in the base folder of the X2Go Git project to be released:<code>
 $ x2go-tarballrelease <a.b.c.d> [<blessed-refspec-or-tag>] $ x2go-tarballrelease <a.b.c.d> [<blessed-refspec-or-tag>]
 </code>The tarball will then be moved to this location: ''../_releases_/source/<project>/''. </code>The tarball will then be moved to this location: ''../_releases_/source/<project>/''.
Line 254: Line 207:
   - Before you continue working on the code you should make sure that the newly released code has been built on Launchpad and also moved to the x2go-stable PPA.   - Before you continue working on the code you should make sure that the newly released code has been built on Launchpad and also moved to the x2go-stable PPA.
  
-===== Git / Code Administration =====+==== Git / Code Administration ====
  
 For Git / code administation you have to be able to logon to the host ''code.x2go.org'' as user ''x2go-admin'': For Git / code administation you have to be able to logon to the host ''code.x2go.org'' as user ''x2go-admin'':
Line 264: Line 217:
 As ''x2go-admin'' you can: As ''x2go-admin'' you can:
  
-  * create new X2go Git projects+  * create new X2Go Git projects
   * edit Git configs   * edit Git configs
   * edit Git descriptions   * edit Git descriptions
Line 272: Line 225:
   * upload Debian packages to http://packages.x2go.org/debian   * upload Debian packages to http://packages.x2go.org/debian
  
-==== Using X2go Build Scripts ====+==== Using X2Go Build Scripts ====
  
-The X2go project uses a hand full of build scripts that are also hosted in X2go Git:+The X2Go project uses a hand full of build scripts that are also hosted in X2Go Git:
  
 <code> <code>
Line 304: Line 257:
 After extending the PATH variable log off an on to make sure it takes effect (or use your own style of letting it take effect). After extending the PATH variable log off an on to make sure it takes effect (or use your own style of letting it take effect).
  
-==== Create new Git Project on X2go Git ==== 
- 
-If you want to create a new X2go Git project on ''code.x2go.org'' please discuss this first on the x2go-dev mailing list. 
- 
-Then create a local Git project: 
- 
-<code> 
-$ mkdir -p ~/MyCode/x2go-upstream/x2gonewthing 
-$ cd ~/MyCode/x2go-upstream/x2gonewthing 
-$ git init 
-</code> 
- 
-Then add your first files to the new ''x2gonewthing'' project. Commit these files as the first commit. Maybe commit more... 
- 
-Then run the following command sequence: 
- 
-<code> 
-$ cd ~/MyCode/x2go-upstream/ 
-$ x2go-gitcreate x2gonewthing 
-# if the Git creation succeeds (check via http://code.x2go.org/gitweb), only then... 
-$ rm x2gonewthing -Rfv 
-$ git clone ssh://x2go@code.x2go.org:32032/srv/git/code.x2go.org/x2gonewthing.git 
-</code> 
- 
-Now you can start working on your new X2go project as on any of the other already existing X2go Git projects. 
- 
-==== Edit Git Configs ==== 
- 
-As ''x2go-admin'' on ''code.x2go.org'': 
- 
-<code> 
-$ cd /srv/git/code.x2go.org/<x2go-project>.git 
-$ vim config 
-</code> 
- 
-==== Edit Git Descriptions ==== 
- 
-As ''x2go-admin'' on ''code.x2go.org'': 
- 
-<code> 
-$ cd /srv/git/code.x2go.org/<x2go-project>.git 
-$ vim description 
-</code> 
- 
-==== Edit Git ACLs ==== 
- 
-Unused feature, may come later... 
  
 ==== Upload Released Tarballs ==== ==== Upload Released Tarballs ====
Line 360: Line 266:
 </code> </code>
  
-==== Build X2go Packages for Debian ==== +==== Build X2Go Packages for Debian ====
- +
-On ''code.x2go.org'' there is a qemubuilder build environment installed. However, as the underlying system is already a VM, and thus, does not render KVM support (qemu software emulation only :-( ), building packages with qemubuilder on ''code.x2go.org'' is not at all recommended.+
  
-Currently, packages for Debian are built on a non-public machine at DAS-NETZWERKTEAM in Northern Germany and then get uploaded to ''code.x2go.org'' aka ''packages.x2go.org''.+On ''japsand.x2go.org'' there is a qemubuilder build environment installed.
  
-==== Upload X2go Packages to X2go's Debian Repository ====+==== Upload X2Go Packages to X2Go's Debian Repository ====
  
-As ''x2go-admin'' you have upload rights for the X2go Debian repository. Use Debian's ''dupload'' tool for this (for further info refer to ''man dupload'' and ''man dupload.conf''). Please add the following lines to your ''~/.dupload'' configuration file:+As ''x2go-admin'' you have upload rights for the X2Go Debian repository. Use Debian's ''dupload'' tool for this (for further info refer to ''man dupload'' and ''man dupload.conf''). Please add the following lines to your ''~/.dupload'' configuration file:
  
 <code> <code>
-### X2go/DEBIAN+### X2Go/DEBIAN
 $cfg{"x2go-debian-sid"} = { $cfg{"x2go-debian-sid"} = {
         fqdn => "code.x2go.org",         fqdn => "code.x2go.org",
wiki/development/development-workspace.1312876882.txt.gz · Last modified: 2013/03/08 13:31 (external edit)