Merge pull request #121 from kinvolk/krnowak/jobs-be-gone

Drop `--jobs` parameter
This commit is contained in:
Krzesimir Nowak 2021-05-05 19:25:20 +02:00 committed by GitHub
commit 3cf5d83056
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 12 additions and 38 deletions

View File

@ -54,8 +54,6 @@ DEFINE_string version "" \
"Sets the docker version to build."
DEFINE_integer aci_version "" \
"Sets the aci version tag identifier."
DEFINE_integer jobs "${NUM_JOBS}" \
"How many packages to build in parallel at maximum."
# Parse command line.
FLAGS "$@" || exit 1

View File

@ -72,8 +72,6 @@ show_help_if_requested "$@"
# not needed for the typical developer workflow.
DEFINE_integer build_attempt 1 \
"The build attempt for this image build."
DEFINE_integer jobs "${NUM_JOBS}" \
"How many packages to build in parallel at maximum."
DEFINE_boolean replace ${FLAGS_FALSE} \
"Overwrite existing output, if any."
DEFINE_string version "" \

View File

@ -145,7 +145,7 @@ emerge_to_image() {
sudo -E ROOT="${root_fs_dir}" \
PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
emerge --root-deps=rdeps --usepkgonly --jobs=$FLAGS_jobs -v "$@"
emerge --root-deps=rdeps --usepkgonly --jobs="${NUM_JOBS}" -v "$@"
# Shortcut if this was just baselayout
[[ "$*" == *sys-apps/baselayout ]] && return
@ -172,7 +172,7 @@ emerge_to_image_unchecked() {
sudo -E ROOT="${root_fs_dir}" \
PORTAGE_CONFIGROOT="${BUILD_DIR}"/configroot \
emerge --root-deps=rdeps --usepkgonly --jobs=$FLAGS_jobs -v "$@"
emerge --root-deps=rdeps --usepkgonly --jobs="${NUM_JOBS}" -v "$@"
# Shortcut if this was just baselayout
[[ "$*" == *sys-apps/baselayout ]] && return

View File

@ -522,7 +522,6 @@ install_oem_aci() {
"${SCRIPT_ROOT}/build_oem_aci" \
--board="${BOARD}" \
--build_dir="${aci_dir}" \
--jobs="${FLAGS_jobs}" \
"${binpkgflags[@]}" \
"${oem_aci}"

View File

@ -46,8 +46,6 @@ DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
"Directory in which to place image result directories (named by version)"
DEFINE_string version "" \
"Overrides version number in name to this version."
DEFINE_integer jobs "${NUM_JOBS}" \
"How many packages to build in parallel at maximum."
# Parse command line.
FLAGS "$@" || exit 1

View File

@ -30,8 +30,6 @@ DEFINE_boolean workon "${FLAGS_TRUE}" \
"Automatically rebuild updated cros-workon packages."
DEFINE_boolean fetchonly "${FLAGS_FALSE}" \
"Don't build anything, instead only fetch what is needed."
DEFINE_integer jobs "${NUM_JOBS}" \
"How many packages to build in parallel at maximum."
DEFINE_boolean rebuild "${FLAGS_FALSE}" \
"Automatically rebuild dependencies."
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
@ -113,9 +111,6 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
else
UPDATE_ARGS+=( --nousepkg )
fi
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
UPDATE_ARGS+=( --jobs=${FLAGS_jobs} )
fi
if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_TRUE}" ]; then
UPDATE_ARGS+=( --skip_toolchain_update )
fi
@ -161,10 +156,8 @@ if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]]; then
fi
fi
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
EMERGE_FLAGS+=( --jobs=${FLAGS_jobs} )
REBUILD_FLAGS+=( --jobs=${FLAGS_jobs} )
fi
EMERGE_FLAGS+=( "--jobs=${NUM_JOBS}" )
REBUILD_FLAGS+=( "--jobs=${NUM_JOBS}" )
if [[ "${FLAGS_rebuild}" -eq "${FLAGS_TRUE}" ]]; then
EMERGE_FLAGS+=( --rebuild-if-unbuilt )

View File

@ -8,7 +8,10 @@
# The number of jobs to pass to tools that can run in parallel (such as make
# and dpkg-buildpackage
if [[ -z ${NUM_JOBS} ]]; then
case "${NUM_JOBS}" in
*[!0-9]*) NUM_JOBS='' ;;
esac
if [[ -z ${NUM_JOBS} ]] || [[ ${NUM_JOBS} -eq 0 ]]; then
NUM_JOBS=$(grep -c "^processor" /proc/cpuinfo)
fi
# Ensure that any sub scripts we invoke get the max proc count.

View File

@ -44,8 +44,6 @@ DEFINE_boolean getbinpkg "${FLAGS_FALSE}" \
"Download binary packages from remote repository."
DEFINE_string getbinpkgver "" \
"Use binary packages from a specific version."
DEFINE_integer jobs "${NUM_JOBS}" \
"How many packages to build in parallel at maximum."
# include upload options
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1

View File

@ -15,8 +15,6 @@ assert_not_root_user
# Developer-visible flags.
DEFINE_string board "${DEFAULT_BOARD}" \
"The board to build packages for."
DEFINE_integer jobs "${NUM_JOBS}" \
"How many packages to build in parallel."
# include upload options
. "${BUILD_LIBRARY_DIR}/release_util.sh" || exit 1
@ -76,7 +74,7 @@ if [[ "${#rebuild_atoms[@]}" -eq 0 ]]; then
info "No ebuild changes detected"
else
info "Rebuilding ${#rebuild_atoms[@]} packages..."
emerge-$BOARD --jobs=${FLAGS_jobs} "${rebuild_atoms[@]}"
emerge-$BOARD "--jobs=${NUM_JOBS}" "${rebuild_atoms[@]}"
info "Checking build root"
test_image_content "${BOARD_ROOT}"

View File

@ -31,8 +31,6 @@ DEFINE_string binhost "" \
"Use binary packages from a specific location (e.g. https://storage.googleapis.com/flatcar-jenkins/sdk/amd64/2000.0.0/pkgs)"
DEFINE_boolean toolchainpkgonly "${FLAGS_FALSE}" \
"Use binary packages only for the board toolchain."
DEFINE_integer jobs "${NUM_JOBS}" \
"How many packages to build in parallel at maximum."
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
"Don't update toolchain automatically."
DEFINE_boolean skip_chroot_upgrade "${FLAGS_FALSE}" \
@ -206,9 +204,6 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
else
UPDATE_ARGS+=" --nousepkg"
fi
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
UPDATE_ARGS+=" --jobs=${FLAGS_jobs}"
fi
if [ "${FLAGS_skip_toolchain_update}" -eq "${FLAGS_TRUE}" ]; then
UPDATE_ARGS+=" --skip_toolchain_update"
fi
@ -295,9 +290,7 @@ ${EMAINT_WRAPPER} --fix world
if [[ ${FLAGS_regen_configs} -eq ${FLAGS_FALSE} ]]; then
EMERGE_FLAGS="--select --quiet --root-deps=rdeps"
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
EMERGE_FLAGS+=" --jobs=${FLAGS_jobs}"
fi
EMERGE_FLAGS+=" --jobs=${NUM_JOBS}"
EMERGE_TOOLCHAIN_FLAGS="${EMERGE_FLAGS}"
if [[ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" && \

View File

@ -21,8 +21,6 @@ DEFINE_boolean usepkgonly "${FLAGS_FALSE}" \
"Only use/download binary packages. Implies --noworkon"
DEFINE_boolean workon "${FLAGS_TRUE}" \
"Automatically rebuild updated cros-workon packages."
DEFINE_integer jobs "${NUM_JOBS}" \
"How many packages to build in parallel at maximum."
DEFINE_boolean skip_toolchain_update "${FLAGS_FALSE}" \
"Don't update the toolchains."
DEFINE_string toolchain_boards "" \
@ -201,10 +199,8 @@ if [ "${FLAGS_usepkg}" -eq "${FLAGS_TRUE}" ]; then
REBUILD_FLAGS+=( $(get_binonly_args $(get_chost_list)) )
fi
if [[ "${FLAGS_jobs}" -ne -1 ]]; then
EMERGE_FLAGS+=( "--jobs=${FLAGS_jobs}" )
REBUILD_FLAGS+=( "--jobs=${FLAGS_jobs}" )
fi
EMERGE_FLAGS+=( "--jobs=${NUM_JOBS}" )
REBUILD_FLAGS+=( "--jobs=${NUM_JOBS}" )
# Perform an update of coreos-devel/sdk-depends and world in the chroot.
EMERGE_CMD="emerge"