The Mer Wiki now uses your Mer user account and password (create account on https://bugs.merproject.org/)


Local Mer

From Mer Wiki
(Difference between revisions)
Jump to: navigation, search
 
Line 1: Line 1:
= Local Mer =
+
A ''local Mer'' setup is the term given to the local OBS setup you need if you want to do a clean build of Mer.
 
+
A “local Mer” setup is the term given to the local OBS setup you need if you want to do a clean build of Mer.
+
  
 
Why?
 
Why?
Line 11: Line 9:
 
* …
 
* …
  
The process has the following steps - repeat for whatever architectures are needed: i586 is mandatory and must be first:
+
= Requirements =
  
# Create local project tied to the remote source
+
Before you start, you must setup:
# Set the target schedulers
+
# Setup a suitable prjconf
+
# Create a linkpac for each of the packages
+
# Allow the local build to take place
+
# Remove the remote link
+
  
Notes:<br />
+
* A working instance of [[MDS2|Mer Delivery System 2]], containing the release of Mer that you want to build.
Limitations in the current OBS mean we can&rsquo;t use normal linked builds because it doesn&rsquo;t disable all i586 builds except the ones we want
+
* A project on your OBS that links to that instance. We called it ''MDS''. If you choose another name, remember to change it while performing the commands.
 +
* OSC installed on your machine and configured to reach your OBS instance. Your user must be able to create projects and packages.
  
A typical session looks like this:
+
= Build process =
  
<pre>BS_ARCH=armv7l
+
The process has the following steps. Repeat for whatever architectures are needed. '''i586''' is mandatory and must be done for first.
 +
 
 +
Limitations in the current OBS mean we can&rsquo;t use normal linked builds because it doesn&rsquo;t disable all i586 builds except the ones we want.
 +
 
 +
To match Mer architecture with the correct OBS scheduler, check out [[OBS architecture naming]].
 +
 
 +
MDS2 allows you to choose the release of Mer by appending the version number to the project name.
 +
 
 +
Let's take for example:
 +
 
 +
'''i586 architecture'''
 +
 
 +
<pre>
 +
BS_ARCH=i586
 +
BS_SCHED=i586
 +
MER_RELEASE=0.20130528.1
 +
</pre>
 +
 
 +
'''Other architectures'''
 +
 
 +
<pre>
 +
BS_ARCH=armv7l
 
BS_SCHED=armv7el
 
BS_SCHED=armv7el
 +
MER_RELEASE=0.20130528.1
 +
</pre>
  
osc -A merci meta prj Core:${BS_ARCH} -F - &lt;&lt;EOF
+
== Create XML configuration file for OBS project ==
&lt;project name=&quot;Core:${BS_ARCH}&quot;&gt;
+
  &lt;title&gt;&lt;/title&gt;
+
  &lt;description&gt;
+
  
 +
Using your preferred text editor, create a temporary XML file (we called it ''CorePrj.xml''), containing:
 +
 +
'''i586 architecture'''
 +
 +
<pre>
 +
<project name="Core:i586">
 +
  <title></title>
 +
  <description>
 
Tied to remote.
 
Tied to remote.
   &lt;/description&gt;
+
   </description>
   &lt;person role=&quot;maintainer&quot; userid=&quot;Admin&quot;/&gt;
+
   <person role="maintainer" userid="Admin"/>
   &lt;person role=&quot;bugowner&quot; userid=&quot;Admin&quot;/&gt;
+
   <person role="bugowner" userid="Admin"/>
   &lt;debuginfo&gt;
+
   <debuginfo>
     &lt;disable/&gt;
+
     <disable/>
   &lt;/debuginfo&gt;
+
   </debuginfo>
   &lt;build&gt;
+
   <build>
     &lt;enable/&gt;
+
     <enable/>
   &lt;/build&gt;
+
   </build>
   &lt;publish&gt;
+
   <publish>
     &lt;enable/&gt;
+
     <enable/>
   &lt;/publish&gt;
+
   </publish>
   &lt;repository name=&quot;Core_${BS_ARCH}&quot;&gt;
+
   <repository name="Core_i586">
     &lt;arch&gt;i586&lt;/arch&gt;
+
     <arch>i586</arch>
    &lt;arch&gt;${BS_SCHED}&lt;/arch&gt;
+
   </repository>
   &lt;/repository&gt;
+
</project>
&lt;/project&gt;
+
</pre>
EOF
+
osc -A merci ls fakeobs:Core:${BS_ARCH} | xargs -L1 -Ixxx osc -A merci linkpac -C copy fakeobs:Core:${BS_ARCH} xxx Core:${BS_ARCH} xxx
+
  
# Crude check there were no errors
+
'''Other architectures'''
osc -A merci ls fakeobs:Core:${BS_ARCH} | sort &gt; /tmp/fake-list
+
 
osc -A merci ls Core:${BS_ARCH} | sort &gt; /tmp/bs-list
+
<pre>
 +
<project name="Core:${BS_ARCH}">
 +
  <title></title>
 +
  <description>
 +
Tied to remote.
 +
  </description>
 +
  <person role="maintainer" userid="Admin"/>
 +
  <person role="bugowner" userid="Admin"/>
 +
  <debuginfo>
 +
    <disable/>
 +
  </debuginfo>
 +
  <build>
 +
    <enable/>
 +
  </build>
 +
  <publish>
 +
    <enable/>
 +
  </publish>
 +
  <repository name="Core_${BS_ARCH}">
 +
    <arch>i586</arch>
 +
    <arch>${BS_SCHED}</arch>
 +
  </repository>
 +
</project>
 +
</pre>
 +
 
 +
== Create project ==
 +
 
 +
<pre>
 +
osc meta prj Core:${BS_ARCH} -F CorePrj.xml
 +
</pre>
 +
 
 +
== Copy/link packages ==
 +
 
 +
The next command links the packages from MDS2 to your local project. You can copy them instead of linking by changing ''osc linkpac -C copy'' to ''osc copypac''.
 +
 
 +
'''WARNING:''' this can take some time due to the large number of packages.
 +
 
 +
<pre>
 +
osc ls MDS:Core:${BS_ARCH}:${MER_RELEASE} | xargs -L1 -Ixxx osc linkpac -C copy MDS:Core:${BS_ARCH}:${MER_RELEASE} xxx Core:${BS_ARCH} xxx
 +
</pre>
 +
 
 +
Crude check there were no errors after it finishes
 +
 
 +
<pre>
 +
osc ls MDS:Core:${BS_ARCH}:${MER_RELEASE} | sort > /tmp/fake-list
 +
osc ls Core:${BS_ARCH} | sort > /tmp/bs-list
 
diff /tmp/fake-list /tmp/bs-list
 
diff /tmp/fake-list /tmp/bs-list
 +
</pre>
  
# Copy the prjconf
+
If some packages are missing, link or copy them again:
osc -A merci meta prjconf fakeobs:Core:${BS_ARCH} | osc -A merci meta prjconf Core:${BS_ARCH} -F -
+
  
# Add in the paths
+
<pre>
 +
echo -e "elfutils-libelf-x86\nmeego-cross-armv7hl-sysroot" | xargs -L1 -Ixxx osc linkpac -C copy MDS:Core:${BS_ARCH}:${MER_RELEASE} xxx Core:${BS_ARCH} xxx
 +
</pre>
  
echo &quot;Please add:&quot;
+
== Copy the prjconf file ==
echo '&lt;path repository=&quot;Core_i586&quot; project=&quot;Core:i586&quot;/&gt;'
+
 
echo '&lt;path repository=&quot;Core_${BS_ARCH}&quot; project=&quot;fakeobs:Core:${BS_ARCH}&quot;/&gt;'
+
<pre>
osc -A merci meta prj Core:${BS_ARCH} -e</pre>
+
osc meta prjconf MDS:Core:${BS_ARCH}:${MER_RELEASE} | osc -A merci meta prjconf Core:${BS_ARCH} -F -
At this point you chould check the project monitor page for any broken projects - these should be manually linkpac&rsquo;ed again eg:
+
</pre>
 +
 
 +
== Set the target schedulers ==
 +
 
 +
Open the editor for the local project XML file with this command:
 +
 
 +
<pre>
 +
osc meta prj Core:${BS_ARCH} -e
 +
</pre>
 +
 
 +
And add these lines inside the ''repository'' tag:
 +
 
 +
'''i586 architecture'''
 +
 
 +
<pre>
 +
<path repository="Core_i586" project="MDS:Core:i586:${MER_RELEASE}"/>
 +
</pre>
 +
 
 +
'''Other architectures'''
 +
 
 +
<pre>
 +
<path repository="Core_i586" project="Core:i586"/>
 +
<path repository="Core_${BS_ARCH}" project="MDS:Core:${BS_ARCH}:${MER_RELEASE}"/>
 +
</pre>
 +
 
 +
== Allow the local build to take place ==
  
<pre>echo -e &quot;elfutils-libelf-x86\nmeego-cross-armv7hl-sysroot&quot; | xargs -L1 -Ixxx osc -A merci linkpac -C copy fakeobs:Core:${BS_ARCH} xxx Core:${BS_ARCH} xxx</pre>
 
 
Now wait for the project to rebuild. The following command is interesting:
 
Now wait for the project to rebuild. The following command is interesting:
  
<pre>watch osc -A merci jobhistory Core:${BS_ARCH} Core_${BS_ARCH} ${BS_SCHED}</pre>
+
<pre>
 +
watch osc jobhistory Core:${BS_ARCH} Core_${BS_ARCH} ${BS_SCHED}
 +
</pre>
 +
 
 +
== Remove the remote link ==
 +
 
 +
Once the build is done, edit the project and remove the ''MDS:Core'' lines (also remove the ''Tied to remote'' reminder in the description):
 +
 
 +
<pre>
 +
osc meta prj Core:${BS_ARCH} | grep -v "MDS" | grep -v "Tied to remote" | osc meta prj Core:${BS_ARCH} -F -
 +
</pre>
 +
 
 +
= Notes about using Mer Delivery System 1 =
  
Once this is done edit the project and remove the fakeobs:Core lines (also remove the "Tied to remote" reminder in the description) :
+
If possible, Mer Delivery System 2 should always be used instead of Mer Delivery System 1.
  
<pre>osc -A merci meta prj Core:${BS_ARCH} | grep -v fakeobs | grep -v "Tied to remote" | osc -A merci meta prj Core:${BS_ARCH} -F -</pre>
+
If you want to use MDS1, you can follow the same process. You just have to remove the ${MER_RELEASE} part from the remote project names, because MDS1 always points to the latest release.

Latest revision as of 09:03, 14 June 2013

A local Mer setup is the term given to the local OBS setup you need if you want to do a clean build of Mer.

Why?

  • Independence
  • Project configuration changes (build flags, etc)
  • Paranoia
  • Experiments

Contents

[edit] Requirements

Before you start, you must setup:

  • A working instance of Mer Delivery System 2, containing the release of Mer that you want to build.
  • A project on your OBS that links to that instance. We called it MDS. If you choose another name, remember to change it while performing the commands.
  • OSC installed on your machine and configured to reach your OBS instance. Your user must be able to create projects and packages.

[edit] Build process

The process has the following steps. Repeat for whatever architectures are needed. i586 is mandatory and must be done for first.

Limitations in the current OBS mean we can’t use normal linked builds because it doesn’t disable all i586 builds except the ones we want.

To match Mer architecture with the correct OBS scheduler, check out OBS architecture naming.

MDS2 allows you to choose the release of Mer by appending the version number to the project name.

Let's take for example:

i586 architecture

BS_ARCH=i586
BS_SCHED=i586
MER_RELEASE=0.20130528.1

Other architectures

BS_ARCH=armv7l
BS_SCHED=armv7el
MER_RELEASE=0.20130528.1

[edit] Create XML configuration file for OBS project

Using your preferred text editor, create a temporary XML file (we called it CorePrj.xml), containing:

i586 architecture

<project name="Core:i586">
  <title></title>
  <description>
Tied to remote.
  </description>
  <person role="maintainer" userid="Admin"/>
  <person role="bugowner" userid="Admin"/>
  <debuginfo>
    <disable/>
  </debuginfo>
  <build>
    <enable/>
  </build>
  <publish>
    <enable/>
  </publish>
  <repository name="Core_i586">
    <arch>i586</arch>
  </repository>
</project>

Other architectures

<project name="Core:${BS_ARCH}">
  <title></title>
  <description>
Tied to remote.
  </description>
  <person role="maintainer" userid="Admin"/>
  <person role="bugowner" userid="Admin"/>
  <debuginfo>
    <disable/>
  </debuginfo>
  <build>
    <enable/>
  </build>
  <publish>
    <enable/>
  </publish>
  <repository name="Core_${BS_ARCH}">
    <arch>i586</arch>
    <arch>${BS_SCHED}</arch>
  </repository>
</project>

[edit] Create project

osc meta prj Core:${BS_ARCH} -F CorePrj.xml

[edit] Copy/link packages

The next command links the packages from MDS2 to your local project. You can copy them instead of linking by changing osc linkpac -C copy to osc copypac.

WARNING: this can take some time due to the large number of packages.

osc ls MDS:Core:${BS_ARCH}:${MER_RELEASE} | xargs -L1 -Ixxx osc linkpac -C copy MDS:Core:${BS_ARCH}:${MER_RELEASE} xxx Core:${BS_ARCH} xxx

Crude check there were no errors after it finishes

osc ls MDS:Core:${BS_ARCH}:${MER_RELEASE} | sort > /tmp/fake-list
osc ls Core:${BS_ARCH} | sort > /tmp/bs-list
diff /tmp/fake-list /tmp/bs-list

If some packages are missing, link or copy them again:

echo -e "elfutils-libelf-x86\nmeego-cross-armv7hl-sysroot" | xargs -L1 -Ixxx osc linkpac -C copy MDS:Core:${BS_ARCH}:${MER_RELEASE} xxx Core:${BS_ARCH} xxx

[edit] Copy the prjconf file

osc meta prjconf MDS:Core:${BS_ARCH}:${MER_RELEASE} | osc -A merci meta prjconf Core:${BS_ARCH} -F -

[edit] Set the target schedulers

Open the editor for the local project XML file with this command:

osc meta prj Core:${BS_ARCH} -e

And add these lines inside the repository tag:

i586 architecture

<path repository="Core_i586" project="MDS:Core:i586:${MER_RELEASE}"/>

Other architectures

<path repository="Core_i586" project="Core:i586"/>
<path repository="Core_${BS_ARCH}" project="MDS:Core:${BS_ARCH}:${MER_RELEASE}"/>

[edit] Allow the local build to take place

Now wait for the project to rebuild. The following command is interesting:

watch osc jobhistory Core:${BS_ARCH} Core_${BS_ARCH} ${BS_SCHED}

[edit] Remove the remote link

Once the build is done, edit the project and remove the MDS:Core lines (also remove the Tied to remote reminder in the description):

osc meta prj Core:${BS_ARCH} | grep -v "MDS" | grep -v "Tied to remote" | osc meta prj Core:${BS_ARCH} -F -

[edit] Notes about using Mer Delivery System 1

If possible, Mer Delivery System 2 should always be used instead of Mer Delivery System 1.

If you want to use MDS1, you can follow the same process. You just have to remove the ${MER_RELEASE} part from the remote project names, because MDS1 always points to the latest release.

Personal tools