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

Add Containerfile for development #493

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add Containerfile for development #493

wants to merge 1 commit into from

Conversation

crawfxrd
Copy link
Member

@crawfxrd crawfxrd commented Oct 17, 2023

Add a command to create a Debian-based container with the coreboot, SDCC, and Rust toolchains installed in order to minimize the workspace setup time and ensure build environments are the same.

make -C containers
podman run -it --rm \
    -v $PWD:/workspace:Z \
    -v ~/.ccache:/root/.cache/ccache:Z \
    system76/firmware-open:latest \
    ./scripts/build.sh oryp8

A locally built image is 2.46 GiB.

Ref: #463

TODO (later)

  • Versioning for the container?
  • Build from CI and publish somewhere? (publish to/pull from ghcr.io or Docker Hub)
  • Simplify using it for local development? (don't require typing the full podman command)
    • Default to using the container, and have an override to build on the host
  • Get Jenkins to use it?

Add a command to create a Debian-based container with the coreboot,
SDCC, and Rust toolchains installed in order to minimize the setup time
of a container-based workflow, such as CI.

    make -C containers
    podman run -it --rm \
        -v $PWD:/workspace:Z \
        -v ~/.ccache:/root/.ccache:Z \
        system76/firmware-open:latest \
        ./scripts/build.sh oryp8

A locally built image is 2.46 GiB.

Signed-off-by: Tim Crawford <[email protected]>
@XV-02
Copy link
Contributor

XV-02 commented Jul 19, 2024

I get an error due to not having a ~/.ccache directory. What do I need to do to remedy that?

@crawfxrd
Copy link
Member Author

crawfxrd commented Jul 19, 2024

Host will still need ccache installed, and it seems to be ~/.cache/ccache on Debian (ccache -p | grep cache_dir).

So the example probably needs to be:

-     -v ~/.ccache:/root/.ccache:Z \
+     -v ~/.cache/ccache:/root/.cache/ccache:Z \

Copy link
Contributor

@XV-02 XV-02 left a comment

Choose a reason for hiding this comment

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

I've been able to build firmware reliably and flash it using the containerized build several times today. I don't see any reason not to move with this if engineering desires.

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