KAS-LOCK(1)

πŸ“¦
version 5.4 Β· 3 versions
, in ubuntu stonking

✨ kas-lock β€” the lock plugin, bestie ✨

okay so real quick: this is kas-lock from the kas suite, manual section 1. it's a plugin, and it's the one that makes lockfiles. let's get into it πŸ’…


🌸 SYNOPSIS 🌸

kas lock [-h] [--skip STEP] [--force-checkout] [--update] [--indent INDENT]
         [--sort]
         [config]

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically: this creates and updates kas project lockfiles. that's the whole vibe.

this plugin is what implements the kas lock command. periodt.

when you run this command, kas makes a locking spec that contains only the exact commit of each repository. why do you care? because that's how you pin the commit of floating branches and tags, while still keeping a super easy update path. 🫢 the lockfile gets created next to the first file on the kas cmdline. for the full tea on locking support, go look at kas.includehandler.IncludeHandler <#kas.includehandler.IncludeHandler>.

Note, bestie: ✨ - all referenced repositories are checked out, because we need to resolve cross-repo configs - all branches are resolved before patches are applied

πŸ”„ Updating lockfiles

when you update lockfiles, kas tries to update the repository revisions in the lockfile that defines the revision. and here's the important bit: if a repository is exclusively locked in an external lockfile, that lock does not get updated β€” because we literally cannot modify an external repository, no cap. BUT if that same revision is also defined in a local lockfile, then it does get updated in the local lockfile. slay.

so the algorithm for figuring out where to pin a repository's revision goes like this:

  1. Find all repositories that have a floating ref (i.e. no commit). Assign to to-lock list
  2. Iterate over all lockfiles (in include order)
    1. for each repository, check if it is locked in the current file
      1. if lock is up to date, remove from to-lock list
      2. else if lockfile is internal, update lockfile, remove from to-lock list
      3. else (repo is locked in external lockfile): mark repo external
  3. Remove all repos with external marks from to-lock list
  4. Add all remaining repos in to-lock list to topmost lockfile, create if needed

πŸ’– Examples

the lockfile gets created as kas-project.lock.yml. wanna regenerate it? just call it again:

kas lock --update kas-project.yml

and the generated lockfile will automatically be used to pin the revisions:

kas build kas-project.yml
heads up though β€” the lockfiles should be checked-in into the VCS. don't be the person who forgets this πŸ™ˆ

✨ OPTIONS ✨

πŸ“ Positional Arguments

  • config β€” the config file(s), separated by colon. if you don't specify one, it uses .config.yaml inside KAS_WORK_DIR.

πŸŽ€ Named Arguments

  • --skip=[] β€” skip build steps. wanna skip more than one step? use this argument multiple times, no biggie.
    • Possible choices: setup_dir, setup_home, make_non_interactive, init_setup_repos, repo_setup_loop, finish_setup_repos, repos_checkout, repos_apply_patches, setup_environ, write_bbconfig
  • --force-checkout=False β€” always checkout the desired commit/branch/tag of each repository, discarding any local changes. yes, that means your local changes. gone. πŸ’€
  • --update=False β€” pull new upstream changes to the desired branch even if it's already checked out locally
  • --indent=2 β€” line indent (# of spaces, default: 2)
  • --sort=False β€” alphanumerically sort keys in output

πŸ‘€ SEE ALSO πŸ‘€

kas-project-config(1), kas-dump(1), kas-build(1)


πŸ‘‘ KAS πŸ‘‘

part of the kas(1) suite, iykyk.

Author Daniel Wagner, Jan Kiszka, Claudius Heine

Copyright Siemens and contributors, 2017-2025


and that's the whole thing, bestie 🫢 this was version 5.4, dated Jun 25, 2026 β€” go lock some revisions, you absolute icon πŸ’–βœ¨πŸŒˆ

πŸ“¦ where this page comes from