blue-build / modules

BlueBuild standard modules used for building your Atomic Images
Apache License 2.0
21 stars 27 forks source link

Font module breaks build: "cannot find zipfile directory" for google fonts #179

Closed michaelhaaf closed 3 months ago

michaelhaaf commented 3 months ago

I've been having this issue pop up intermittedly on my personal builds (see https://github.com/michaelhaaf/bluebuild-custom/actions/runs/8462707712/job/23184496580). I also saw someone on the Discord with the same issue, which I'll paste the log from:

Installation of google-fonts started
Downloading Roboto Open Sans.zip
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100  1642    0  1642    0     0  13197      0 --:--:-- --:--:-- --:--:-- 13136
100  1642    0  1642    0     0  13185      0 --:--:-- --:--:-- --:--:-- 13136
Warning: Got more output options than URLs
Archive:  Roboto Open Sans.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of Roboto Open Sans.zip or
        Roboto Open Sans.zip.zip, and cannot find Roboto Open Sans.zip.ZIP, period.
Error: building at STEP "RUN --mount=type=tmpfs,target=/tmp --mount=type=tmpfs,target=/var --mount=type=bind,from=docker.io/mikefarah/yq,src=/usr/bin/yq,dst=/usr/bin/yq --mount=type=bind,from=stage-config,src=/config,dst=/tmp/config,rw --mount=type=bind,from=stage-modules,src=/modules,dst=/tmp/modules,rw --mount=type=bind,from=stage-exports,src=/exports.sh,dst=/tmp/exports.sh --mount=type=cache,dst=/var/cache/rpm-ostree,id=rpm-ostree-cache-os-image-39,sharing=locked chmod +x /tmp/modules/fonts/fonts.sh   && source /tmp/exports.sh && /tmp/modules/fonts/fonts.sh '{"type":"fonts","fonts":{"nerd-fonts":["FiraCode","NerdFontsSymbolsOnly"],"google-fonts":["Roboto","Open Sans"]}}'": while running runtime: exit status 9

Not sure why the issue doesn't happen all time, which makes it tricky to reproduce (though: I haven't actually set up the local bluebuild-cli properly yet, which doesn't help, lol).

I can't see an obvious problem with the google font module code, though it has some differences from the nerd font module code.

I hope to have time in the near future to set up a local build process and investigate this myself, but thought I'd raise the issue in the meantime in case anyone already knows why this might be happening.

xynydev commented 3 months ago

The font module is due to be refactored. Let us just hope that the refactor will not repeat these bugs...

fiftydinar commented 3 months ago

The font module is due to be refactored. Let us just hope that the refactor will not repeat these bugs...

I think that this bug is related to the usage of older BlueBuild GitHub action.

When you were previously a fork & then you detached it when migrating to BlueBuild, you would still need to manually enable Dependabot to notify for Action updates, as Dependabot is not automatically enabled for forks.

michaelhaaf commented 3 months ago

Thanks for the help everyone.

Seems unrelated, but since updating to github action 1.2 I'm getting a different blocking error.

I had thought it may be module order (something like, modules that depend on the existence of /usr/ weren't working since my files module wasn't running first) but I've ruled that out

#33 [stage-4  6/15] COPY ./config/files/usr /usr
#33 ERROR: cannot copy to non-directory: /var/lib/docker/overlay2/yggvj9u0in8wk3ivzrfnhfk2y/merged/usr/local
------
> [stage-4  6/15] COPY ./config/files/usr /usr:
------
Containerfile:41
--------------------
  39 |     COPY --from=docker.io/mikefarah/yq /usr/bin/yq /usr/bin/yq
  40 |     COPY --from=ghcr.io/blue-build/cli:latest-installer /out/bluebuild /usr/bin/bluebuild
  41 | >>> COPY ./config/files/usr /usr
  42 |     RUN \
  43 |       --mount=type=tmpfs,target=/tmp \
--------------------
ERROR: failed to solve: cannot copy to non-directory: /var/lib/docker/overlay2/yggvj9u0in8wk3ivzrfnhfk2y/merged/usr/local
[2024-03-28T15:28:51Z ERROR blue_build::commands] Failed to build ghcr.io/michaelhaaf/sway:39
zelikos commented 3 months ago

I think that this bug is related to the usage of older BlueBuild GitHub action.

I had this same issue with the fonts module happen in my builds today, on the latest version of the Github action.

m0ngr31 commented 3 months ago

When you were previously a fork & then you detached it when migrating to BlueBuild, you would still need to manually enable Dependabot to notify for Action updates, as Dependabot is not automatically enabled for forks.

How do you do that?

m0ngr31 commented 3 months ago

I had this same issue with the fonts module happen in my builds today, on the latest version of the Github action.

I'm on 1.2 and it's happening for me as well

scottames commented 3 months ago

It looks like the download url changed on Google's side.

Module url: https://fonts.google.com/download?family= New url: https://fonts.google.com/download/list?family=

Proposed fix in https://github.com/blue-build/modules/pull/180

xynydev commented 3 months ago

Commented on the PR. I am now getting the same error too. Not available for long today, but will be back tomorrow.

https://github.com/xynydev/linuXYZ/actions/runs/8471125178/job/23210416658

scottames commented 3 months ago

Commented on the PR. I am now getting the same error too. Not available for long today, but will be back tomorrow.

https://github.com/xynydev/linuXYZ/actions/runs/8471125178/job/23210416658

@xynydev you're right, my proposed URL fix is incorrect. It does seem like something changed on my end though. I'll try to investigate further later on.

fiftydinar commented 3 months ago

How do you do that?

@m0ngr31 Go to your repo, Dependencies tab, Dependabot tab, Recent update jobs

Then it should ask you to enable Dependabot or not.