Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ynezz/build improvements #1

Closed
wants to merge 6 commits into from
Closed

Ynezz/build improvements #1

wants to merge 6 commits into from

Conversation

ynezz
Copy link
Owner

@ynezz ynezz commented Nov 30, 2024

No description provided.

Currently if get_git_commit_id() fails, its not clear why:

  Generation for Bootloader to /build_dir has completed.
    ...snip...
     File "/usr/lib/python3.11/subprocess.py", line 571, in run
       raise CalledProcessError(retcode, process.args,
   subprocess.CalledProcessError: Command '['git', '-C', '/build', 'rev-parse', 'HEAD']' returned non-zero exit status 128.

So lets fix it by providing stderr output, thus making the issue
obvious:

  Generation for Bootloader to /build_dir has completed.
    ...snip...
    File "/build/tools/build_project.py", line 113, in git
      raise RuntimeError(
      RuntimeError: Git command `git -C /build rev-parse HEAD` failed: fatal: detected dubious ownership in repository at '/build'
      To add an exception for this directory, call:

          git config --global --add safe.directory /build

Signed-off-by: Petr Štetiar <[email protected]>
Using the build workflow with rootless podman containers and volumes:

 podman \
         run --rm -it \
         --privileged \
         -v $(PWD)/build:/build:Z \
         silabs-firmware-builder \
         bash -c " \
                 cd /build && \
                 ./tools/build_firmware.sh test.yml \
         "

results into following permssions issue:

 The sdk /simplicity_sdk_2024.6.2/ ( com.silabs.sdk.stack.sisdk:2024.6.2._-620023087 )  is now trusted.
 ln: failed to create symbolic link '/simplicity_sdk_2024.6.2/extension': Permission denied

This is happening due to the user/group mapping between container and
the host and currently the simplicity_sdk_2024 directory is owned as
root, thus builder user won't be able to create an extension symlink,
resulting in this failure.

So lets fix it by chown-ing the simplicity_sdk_2024 for builder.

References: https://www.redhat.com/en/blog/debug-rootless-podman-mounted-volumes
Signed-off-by: Petr Štetiar <[email protected]>
@ynezz ynezz force-pushed the ynezz/build-improvements branch from 6afc062 to efc5822 Compare November 30, 2024 12:38
@ynezz ynezz changed the base branch from main to SiSDK November 30, 2024 12:42
@ynezz ynezz force-pushed the ynezz/build-improvements branch 4 times, most recently from 3628dce to f254e7b Compare November 30, 2024 13:15
Currently its not possible to easily reuse the steps taken on the GitHub
CI to build firmware, so lets factor out those bits into new
build_firmware.sh script help which basically mimics the current
firmware build flow on the GitHub CI.

Signed-off-by: Petr Štetiar <[email protected]>
Currently it needs a lot of steps to build single firmware, so lets
streamline this workflow by using container.

 Usage: make [all|build_container|build_firmware]
 Targets:
   all             Build container and firmware
   build_container Build container
   build_firmware  Build firmware
   help            Show this help message

 Options:
   build_firmware MANIFESTS=<path>  Override default manifest files (default: all .yaml/.yml files in manifests/)

 Examples:
   # Build the container image
   make build_container

   # Build all firmware manifests
   make build_firmware

   # Build a specific firmware manifest
   make build_firmware MANIFESTS=manifests/nabucasa/yellow_bootloader.yaml

Signed-off-by: Petr Štetiar <[email protected]>
Signed-off-by: Petr Štetiar <[email protected]>
@ynezz ynezz force-pushed the ynezz/build-improvements branch 4 times, most recently from a7928ba to dc58e6c Compare November 30, 2024 13:39
@ynezz ynezz force-pushed the ynezz/build-improvements branch from 9332d66 to c4c82e0 Compare November 30, 2024 14:01
@ynezz ynezz closed this Dec 1, 2024
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.

1 participant