rMake:rmake build
From rPath Wiki
| rmake build | ||
| rmake build [<trovename[=<versionSpec>[<flavor>]>] [<recipe>][<flavor>][{context}] | ||
| Example> rmake build foo | ||
|
This command builds the packages specified. If a versionSpec is specified, it should point to a source version of <trovename>. Although this command finds source packages to build, the :source component part of the name is implicit.
Build from Local Recipe Source
If a recipe is specified (such as in rmake build example.recipe), and that recipe file is a source checkout from a repository, rMake shadows that recipe to an internal repository, and it commits any local changes to that shadow. Then, when committing the rMake job (see rMake:rmake commit), the related source component(s) will be also be committed.
Build from Committed Repository Source
If a recipe source is not specified locally, rMake looks to the repository for the source. For example, rmake build example will rebuild the example package by shadowing its source and building in the rMake change root. After such a build, the rmake commit <jobNumber> should not prompt for a commit message as the source has not been modified from what is already in the repository. When applicable, be sure to include the flavor specifications appropriate to the package or group you are building.
The following example builds glib from the Foresight repository as "preferred not" for the mysql flavor specification:
$> rmake build 'glib=foresight.rpath.org@fl:desktop/1.0-1[!mysql]'
Separate Contexts for Each Build in a Job
In rMake, unlike Conary's native cvc cook command, a specific context may be specified for each build within the build job. The context is only applied to the one build for which it is specified, and it is added into any default context specified for all the builds in that job.
The following example builds glibc for both x86_64 and x86 platforms, assuming there are contexts [x86_64] and [x86] in the rMake or Conary configuration. Both builds would pick up the base configuration from the [foresight] context.
$> rmake build glib{x86_64} glib{x86} --context foresight
rMake can build groups, redirect packages, and filesets as long as they are the only trove specified as part of the job. When these types of troves are specified alongside other packages, rMake fails to build them. This limitation may be lifted in a future version of rMake.
Recurse Groups when Building
Use --recurse when building groups to prompt rMake to find the source version of the group and to build all packages contained within. This flag replaces the deprecated buildgroup command from earlier versions of rMake. Note that this does not currently pay attention to remove lines used by the source to avoid building troves, and it does not recurse into externally-defined groups that are added to that group.
Add the --binary-search option with --recurse to prompt rMake to find the matching binary version of this group, instead of the source version, and to rebuild the packages within that group with the flavors they were built with previously.
Scripting an rMake Build
When scripting an rMake build, use the rmake build command options to provide appropriate information to the output stream, especially when following a build command with an rmake commit of the job number. For example, the following command builds example.recipe while outputting only the job number created by rMake:
$> rmake build -quiet --no-watch example.recipe
Such a command in a script could have standard output to a variable, and that variable subsequently used in place of the build number in the rmake commit command.
Command Options
- --binary-search
- See the previous section Recurse Groups when Building.
- --commit
- After the build finishes successfully, commit the build. This is like running rmake build <job> followed by rmake commit <jobId>. If the build does not complete successfully, the commit is not performed.
- --flavor=FLAVOR
- Specify the flavor to build with. For example, rMake uses this parameter to support building x86 packages on x86_64 systems. To build x86 troves on an x86_64 system, type rmake build foo --flavor 'is:x86(~cmov,~i486,~i586,~i686)'
- --message
- When committing automatically after the build, this is the message to use as a log for all source commits. Also can be called with the -m flag.
- --no-clean
- Do not clean chroots after builds finish successfully. Note that only the number of chroots that can remain is determined by the chrootLimit configuration option.
- --host=HOST
- Can be used multiple times. Limits a build to the given host(s). This command is useful when building groups using rmake, when you only have control over commit access to a few labels.
- --label=LABEL
- Can be used multiple times. Limits a build to the given label(s). This command is similar to --host above, but it is more specific.
- --macro="NAME VALUE"
- Uses the value VALUE for macro NAME for each recipe. Equivalent to the same option for cvc cook.
- --prep
- Creates the chroot and checks out the package in the chroot but does not build it.
- --match="[-][name][=version][[flavor]]"
- Causes the troves specified (usually via --recurse) to be filtered so that only the troves matching the --match parameters will be used.
- The following example builds any package in group-dist that has a name that starts with python-, as well as any package that is has a label that ends in :1-compat, as well as kernels in group-dist with the flavor kernel.smp, unless they have the smp flavor:
rmake buildgroup group-dist --match=python-* --match="=:1-compat" --match="kernel[kernel.smp]" --match="-kernel[xen]"
- --no-watch
- Do not run rmake watch immediately after starting the build. See watch for more information.
- --quiet
- Prints the job ID only after starting the job. This option can be useful when automating builds.
- --info
- Displays debugging information about the build that would be performed. Useful for seeing exactly what information you are sending to the rMake server to be built.
- --recurse
- See the previous section Recurse Groups when Building.
- --reuse
- Sets the reuseRoots config option, useful for iterative test builds. See reuseRoots config option for more information. (--no-reuse turns off this functionality if it's turned on from the config file).
