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

Makefile: Fix Fontconfig error #43

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

rene
Copy link
Contributor

@rene rene commented Feb 19, 2024

Define HOME env. variable to the working directory of the proto container in order to avoid Fontconfig errors due to cache writing, like the following:

dot ./images/devconfig.dot -Tpng -o ./images/devconfig.png Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories

Setting HOME to the working directory fixes the problem.

More detailed logs:

docker build -f .devcontainer/Dockerfile -t eve-api-builder .
[+] Building 1.4s (13/13) FINISHED                                                                     docker:default
 => [internal] load build definition from Dockerfile                                                             0.0s
 => => transferring dockerfile: 981B                                                                             0.0s
 => resolve image config for docker.io/docker/dockerfile:1.6.0                                                   0.7s
 => CACHED docker-image://docker.io/docker/dockerfile:1.6.0@sha256:ac85f380a63b13dfcefa89046420e1781752bab20212  0.0s
 => [internal] load metadata for docker.io/library/alpine:3.18                                                   0.4s
 => [internal] load .dockerignore                                                                                0.0s
 => => transferring context: 2B                                                                                  0.0s
 => [1/7] FROM docker.io/library/alpine:3.18@sha256:11e21d7b981a59554b3f822c49f6e9f57b6068bb74f49c4cd5cc4c663c7  0.0s
 => CACHED [2/7] RUN apk add --no-cache bash curl git go make graphviz ttf-freefont                              0.0s
 => CACHED [3/7] RUN arch=$(uname -m);   if [ "${arch: -3:1}" != "_" ]; then     arch="${arch%??}_${arch: -2:2}  0.0s
 => CACHED [4/7] RUN git clone https://github.com/seamia/protodot.git /protodot                                  0.0s
 => CACHED [5/7] RUN go build -C /protodot -o /usr/local/bin/protodot .                                          0.0s
 => CACHED [6/7] RUN mkdir -p $(go env GOPATH)                                                                   0.0s
 => CACHED [7/7] RUN go install google.golang.org/protobuf/cmd/protoc-gen-go@v1.31.0 && mv /root/go/bin/protoc-  0.0s
 => exporting to image                                                                                           0.0s
 => => exporting layers                                                                                          0.0s
 => => writing image sha256:bbae8f5db38ee627c9ba9f1ee8a2ae04e856d48d8ea905a21c15d6bc98d3bdee                     0.0s
 => => naming to docker.io/library/eve-api-builder                                                               0.0s
docker run --rm -v /home/rene/workspace/eve-api:/src -w /src -u $(id -u) eve-api-builder make proto
rm -rf go/*/; mkdir -p go # building proto-api-go
protoc -I./proto --go_out=paths=source_relative:./go proto/*/*.proto
rm -rf python/*/; mkdir -p python # building proto-api-python
protoc -I./proto --python_out=./python proto/*/*.proto
protodot -inc /usr/local/include -src ./proto/config/devconfig.proto -output devconfig -generated ./images
dot ./images/devconfig.dot -Tpng -o ./images/devconfig.png
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
dot ./images/devconfig.dot -Tsvg -o ./images/devconfig.svg
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories
echo generated ./images/devconfig.*
generated ./images/devconfig.dot ./images/devconfig.dot.svg ./images/devconfig.png ./images/devconfig.svg
Done building protobuf, you may want to vendor it into your packages, e.g. pkg/pillar.
See ./go/README.md for more information.

Define HOME env. variable to the working directory of the proto container
in order to avoid Fontconfig errors due to cache writing, like the
following:

dot ./images/devconfig.dot -Tpng -o ./images/devconfig.png
Fontconfig error: No writable cache directories
Fontconfig error: No writable cache directories

Setting HOME to the working directory fixes the problem.

Signed-off-by: Renê de Souza Pinto <rene@renesp.com.br>
@rene rene requested a review from eriknordmark as a code owner February 19, 2024 12:19
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

Works for Christoph.

@eriknordmark eriknordmark merged commit cc36101 into lf-edge:main Feb 19, 2024
4 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.

3 participants