Skip to content

Add build mode for local source builds for iolan_apps, see README in …#30

Merged
ShuZhou16 merged 1 commit into
psl-masterfrom
local-app-build-mode
Jun 11, 2026
Merged

Add build mode for local source builds for iolan_apps, see README in …#30
ShuZhou16 merged 1 commit into
psl-masterfrom
local-app-build-mode

Conversation

@ShuZhou16

Copy link
Copy Markdown
Collaborator

Adds a new build_mode option to support building packages from local source directories without requiring git clone/checkout operations.

Changes

  • Added build_mode configuration option with two modes:

    • git_full (default): Standard behavior - clones repository and checks out specific commit
    • local_app: Builds from the current working directory without git operations
  • When build_mode = 'local_app':

    • Skips git clone and checkout steps
    • Uses current working directory as the source tree
    • Skips tarball creation
    • Adds explicit apt-get install for build dependencies

Use Case

Enables building individual packages from repositories that contain multiple independent sub-projects. Unlike standard packages that are built as a whole from a single repository, iolan_apps contains multiple subdirectories where each subdirectory is a standalone package that can be built independently.

With local_app mode, you can navigate to any subdirectory and build just that package without cloning the entire repository or affecting other packages.

Usage

In package.toml:

build_mode = "local_app"

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new build_mode option to scripts/package-build/build.py to support building packages from a local source tree (skipping git clone/checkout and tarball creation), intended for repos that contain multiple independent sub-project packages.

Changes:

  • Introduces build_mode with git_full (default) vs local_app.
  • Skips git operations (and tarball generation) when building from local sources.
  • Adds an additional dependency-install step for local_app.

Comment on lines 84 to 86
repo_name = package['name']
repo_dir = Path(repo_name)
print(f"I: build_package {repo_name} in {repo_dir}")
Comment on lines 143 to 146
if package.get('apply_patches', True):
# Check if the 'patches' directory exists in the repository
if (repo_dir / 'patches'):
apply_patches(repo_dir, patch_dir / repo_name)
Comment on lines +148 to +157
if build_mode == 'local_app':
# PSL-iolan_apps: For local_app mode, use current working directory as the source tree
# instead of a cloned repository directory
repo_dir = Path(os.getcwd())
else:
# Sanitize the commit ID and build a tarball for the package
commit_id_sanitized = package['commit_id'].replace('/', '_')
tarball_name = f"{repo_name}_{commit_id_sanitized}.tar.gz"
run(['tar', '--exclude=.git', '--exclude=.github', '-czf', tarball_name, '-C', str(repo_dir.parent), repo_name], check=True)
print(f"I: Tarball created: {tarball_name}")
Comment on lines +172 to +176
if build_mode == 'local_app':
# PSL-iolan_apps: For local_app mode, explicitly install all dependencies listed in the
# build-deps package. This ensures locally built libs are used instead of
# versions from the upstream repositories if exists so local changes are prioritized.
run("sudo apt-get install -y $(dpkg-deb -f *build-deps*.deb Depends | tr ',' ' ') 2>&1", cwd=repo_dir, check=True, shell=True)
Comment on lines +92 to +95
build_mode = package.get('build_mode', 'git_full')

# PSL-iolan_apps: Skip git clone/checkout for 'local_app' mode since we build from local sources
if build_mode != 'local_app':
@ShuZhou16 ShuZhou16 merged commit 4b32a04 into psl-master Jun 11, 2026
2 of 3 checks passed
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.

4 participants