Difference between revisions of "SPO600 Code Building Lab"

From CDOT Wiki
Jump to: navigation, search
Line 1: Line 1:
{{Chris Tyler Draft}}[[Category:SPO600 Labs]]{{Admon/lab|Purpose of this Lab|In this lab, you will do a baseline build of a software package.}}
+
[[Category:SPO600 Labs]]{{Admon/lab|Purpose of this Lab|In this lab, you will do a baseline build of a software package.}}
  
 
== Lab 2 ==
 
== Lab 2 ==
Line 11: Line 11:
 
{{Admon/caution|Do not build or install this software as the root user.|Do not build the software as root, and do not install the software into the system directories. Doing so may cause conflicts with other software on the system and/or may leave your system in an unusable state, and may be very difficult to reverse.}}
 
{{Admon/caution|Do not build or install this software as the root user.|Do not build the software as root, and do not install the software into the system directories. Doing so may cause conflicts with other software on the system and/or may leave your system in an unusable state, and may be very difficult to reverse.}}
  
# Build an open source software package
+
==== Build an open source software package ====
## Select an open source software package from the [http://www.gnu.org/software/software.html Free Software Foundation's GNU Project] or another open source project.
+
# Select an open source software package from the [http://www.gnu.org/software/software.html Free Software Foundation's GNU Project] or another open source project.
## Download the source code for the software. (Do not install with dnf/yum!)
+
# Download the source code for the software. (Do not install with dnf/yum!)
## Build the software. You may need to install build dependencies (e.g., compilers, tools, and libraries); you can do this (and only this) as the root user.
+
# Build the software. You may need to install build dependencies (e.g., compilers, tools, and libraries); you can do this (and only this) as the root user.
## Without installing the new software that you just build (because that could override the existing and working version), test that it works.
+
# Without installing the new software that you just build (because that could override the existing and working version), test that it works.
{Admon/important|Read the glibc Instructions|The glibc software and build system are complex, since this is core library which underlies most of the software on the system. [https://www.gnu.org/software/libc/ Read the documentation carefully.]}
+
# Blog your results. Explain (don't just document) each of the steps required to build your software and any dependencies you need to install. Include your reflections on the process.
# Build and test glibc
+
 
## Find and build the source code for the latest released version of the GNU Standard C Library (glibc). Note that glibc uses two parallel directory trees: one which contains the source code, and one which contains configuration and the output of the build system. You can safely delete all of the contents of the build directory and rebuild at any time.
+
==== Build and test glibc ====
## Test the library which you have built (Critical: do this without installing it on your system and overwriting your existing glibc installation!). Prove that your version of the library is used in your tests by introducing a change in behaviour (for example, a small bug).
+
{{Admon/tip|Read the glibc Instructions|The glibc software and build system are complex, since this is core library which underlies most of the software on the system. [https://www.gnu.org/software/libc/ Read the documentation carefully.]}}
## There may be multiple implementations of a function.
+
 
## Blog about the process, your results, your observations, and what you learned.
+
# Find and build the source code for the latest released version of the GNU Standard C Library (glibc). Note that glibc uses two parallel directory trees: one which contains the source code, and one which contains configuration and the output of the build system. You can safely delete all of the contents of the build directory and rebuild at any time.
## Obtain the source code for glibc via git using the instructions at https://sourceware.org/glibc/wiki/Testing/Builds
+
# Test the library which you have built (Critical: do this without installing it on your system and overwriting your existing glibc installation!). Prove that your version of the library is used in your tests by introducing a change in behaviour (for example, a small bug).
## Build and test your version of glibc. '''Do Not''' install it into the system directories or you may destroy the existing Linux installation!
+
# There may be multiple implementations of a function: a basic version, written in C, and one or more versions for the target architecture. Learn the mechanisms used to override one implementation with another. Read up on the multiarch system.
 +
# Blog about the process, your results, your observations, and what you learned.
 +
# Obtain the source code for glibc via git using the instructions at https://sourceware.org/glibc/wiki/Testing/Builds
 +
# Build and test your version of glibc. '''Do Not''' install it into the system directories or you may destroy the existing Linux installation!
 +
# Blog about your results. Provide convincing proof that you can test the specific version of glibc which you build. Explain override and multiarch mechanisms.

Revision as of 03:08, 20 September 2017

Lab icon.png
Purpose of this Lab
In this lab, you will do a baseline build of a software package.

Lab 2

Prerequisites

You must have a working accounts on a Linux system (such as Matrix, Zenit, the SPO600 Servers or your own system).

Tasks

Stop (medium size).png
Do not build or install this software as the root user.
Do not build the software as root, and do not install the software into the system directories. Doing so may cause conflicts with other software on the system and/or may leave your system in an unusable state, and may be very difficult to reverse.

Build an open source software package

  1. Select an open source software package from the Free Software Foundation's GNU Project or another open source project.
  2. Download the source code for the software. (Do not install with dnf/yum!)
  3. Build the software. You may need to install build dependencies (e.g., compilers, tools, and libraries); you can do this (and only this) as the root user.
  4. Without installing the new software that you just build (because that could override the existing and working version), test that it works.
  5. Blog your results. Explain (don't just document) each of the steps required to build your software and any dependencies you need to install. Include your reflections on the process.

Build and test glibc

Idea.png
Read the glibc Instructions
The glibc software and build system are complex, since this is core library which underlies most of the software on the system. Read the documentation carefully.
  1. Find and build the source code for the latest released version of the GNU Standard C Library (glibc). Note that glibc uses two parallel directory trees: one which contains the source code, and one which contains configuration and the output of the build system. You can safely delete all of the contents of the build directory and rebuild at any time.
  2. Test the library which you have built (Critical: do this without installing it on your system and overwriting your existing glibc installation!). Prove that your version of the library is used in your tests by introducing a change in behaviour (for example, a small bug).
  3. There may be multiple implementations of a function: a basic version, written in C, and one or more versions for the target architecture. Learn the mechanisms used to override one implementation with another. Read up on the multiarch system.
  4. Blog about the process, your results, your observations, and what you learned.
  5. Obtain the source code for glibc via git using the instructions at https://sourceware.org/glibc/wiki/Testing/Builds
  6. Build and test your version of glibc. Do Not install it into the system directories or you may destroy the existing Linux installation!
  7. Blog about your results. Provide convincing proof that you can test the specific version of glibc which you build. Explain override and multiarch mechanisms.