diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 0090fafe..a33ac0eb 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -1,6 +1,6 @@ # kas - setup tool for bitbake based projects # -# Copyright (c) Siemens AG, 2021 +# Copyright (c) Siemens AG, 2021-2024 # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,11 +23,16 @@ version: 2 build: - os: ubuntu-20.04 + os: ubuntu-24.04 tools: - python: "3.9" + python: "3.12" apt_packages: - python3-newt + - make + - podman + jobs: + pre_build: + - cd docs && make kas-container-usage && cd .. python: install: diff --git a/docs/command-line/environment-variables.inc b/docs/command-line/environment-variables.inc index 09174629..bb33b6ec 100644 --- a/docs/command-line/environment-variables.inc +++ b/docs/command-line/environment-variables.inc @@ -166,6 +166,13 @@ Variables Glossary | ``PARALLEL_MAKE`` | | | (C,K,E) | | +--------------------------+--------------------------------------------------+ +| ``BUILDTOOLS_DIR`` (K) | The path to the directory where buildtools have | +| | been installed. The environment-setup script | +| | will run before bitbake, so the whole buildtools | +| | environment will be available. More information | +| | on how to install or generate buildtools can be | +| | found at: |yp_doc_buildtools| | ++--------------------------+--------------------------------------------------+ .. |aws_cred| replace:: ``AWS_ROLE_ARN`` ``AWS_SHARED_CREDENTIALS_FILE`` @@ -177,6 +184,7 @@ Variables Glossary ``CI_SERVER_SHELL_SSH_HOST`` ``CI_SERVER_SHELL_SSH_PORT`` +.. |yp_doc_buildtools| replace:: https://docs.yoctoproject.org/3.3/ref-manual/system-requirements.html#required-git-tar-python-and-gcc-versions .. only:: html For details about the access of remote resources, see diff --git a/kas/libkas.py b/kas/libkas.py index a8a6c423..73391aad 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -33,6 +33,7 @@ import errno import pathlib import signal +import glob from subprocess import Popen, PIPE from .context import get_context from .kasusererror import KasUserError, CommandExecError @@ -252,9 +253,16 @@ def get_build_environ(build_system): if not init_repo: raise InitBuildEnvError('Did not find any init-build-env script') + buildtools_env ="" + if "BUILDTOOLS_DIR" in os.environ: + envfiles = glob.glob(os.path.join(os.environ["BUILDTOOLS_DIR"],"environment-setup-*")) + if len(envfiles) == 1: + buildtools_env = "source {}\n".format(os.path.realpath(envfiles[0])) + with tempfile.TemporaryDirectory() as temp_dir: script = f"""#!/bin/bash set -e + {buildtools_env} source {init_script} $1 > /dev/null env """