Skip to content

Drop --jobs parameter#121

Merged
krnowak merged 2 commits intomainfrom
krnowak/jobs-be-gone
May 5, 2021
Merged

Drop --jobs parameter#121
krnowak merged 2 commits intomainfrom
krnowak/jobs-be-gone

Conversation

@krnowak
Copy link
Copy Markdown
Member

@krnowak krnowak commented Feb 18, 2021

The --jobs parameter that some scripts defined was not used anywhere
in jenkins or mantle. So the value of the parameter always ended up
being equal to ${NUM_JOBS} set by common.sh. Also, even if the
--jobs parameter was used for some script, that script sometimes
didn't forward the jobs value to other scripts, so the other scripts
ended up using ${NUM_JOBS} again. Also, the ${FLAGS_jobs} variable
was used by some functions in the build library, and those functions
were sometimes invoked by scripts that didn't define the
${FLAGS_jobs} variable. It is tedious to track which script should
actually define the parameter, and where it should be forwarded.

Just get rid of this half-working pretense. If you want to affect how
many jobs emerge uses, export the NUM_JOBS environment variable
before calling any script.

For EMERGE_FLAGS and REBUILD_FLAGS we unconditionally specify the
--jobs flag's value to ${NUM_JOBS} because they are passed to
emerge. On the other hand we drop the --jobs parameter from the
UPDATE_ARGS variable, because this variable passed to setup_board
or update_chroot, which don't have this flag any more.

Also make sure that NUM_JOBS is a positive integer.

The `--jobs` parameter that some scripts defined was not used anywhere
in jenkins or mantle. So the value of the parameter always ended up
being equal to `${NUM_JOBS}` set by `common.sh`. Also, even if the
`--jobs` parameter was used for some script, that script usually
didn't forward the jobs value to other scripts, so the other scripts
ended up using `${NUM_JOBS}` again. Also, the `${FLAGS_jobs}` variable
was used by some functions in the build library, and those functions
were sometimes invoked by scripts that didn't define the
`${FLAGS_jobs}` variable. It is tedious to track which script should
actually define the parameter, and where it should be forwarded.

Just get rid of this half-working pretense. If you want to affect how
many jobs `emerge` uses, export the `NUM_JOBS` environment variable
before calling any script.

For `EMERGE_FLAGS` and `REBUILD_FLAGS` we unconditionally specify the
`--jobs` flag's value to `${NUM_JOBS}` because they are passed to
`emerge`. On the other hand we drop the `--jobs` parameter from the
`UPDATE_ARGS` variable, because this variable passed to `setup_board`
or `update_chroot`, which don't have this flag any more.
@krnowak krnowak changed the title Krnowak/jobs be gone Drop --jobs parameter Feb 18, 2021
@krnowak krnowak merged commit 3cf5d83 into main May 5, 2021
@krnowak krnowak deleted the krnowak/jobs-be-gone branch May 5, 2021 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants