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

Restyling fails with "unknown executable: lua" #208

Closed
bzbarsky-apple opened this issue Jun 15, 2023 · 6 comments
Closed

Restyling fails with "unknown executable: lua" #208

bzbarsky-apple opened this issue Jun 15, 2023 · 6 comments

Comments

@bzbarsky-apple
Copy link

bzbarsky-apple commented Jun 15, 2023

When I try to run

exec docker run -it --rm \
  --env DEBUG=1 \
  --env HOST_DIRECTORY="$PWD" \
  --env UNRESTRICTED=1 \
  --volume "$PWD":/code \
  --volume /tmp:/tmp \
  --volume /var/run/docker.sock:/var/run/docker.sock \
  --entrypoint restyle-path \
  "restyled/restyler:master-final" filenames here

I get:

[info] Fetching remote file: /tmp/restylers-stable.yaml
restyle-path: ConfigErrorInvalidRestylersYaml (AesonException "Error in $[19].interpreters[0]: Unknown executable: lua")

This used to work a few days ago...

@bzbarsky-apple
Copy link
Author

This may be related to the failure at https://restyled.io/gh/project-chip/repos/connectedhomeip/jobs/3275564 or that might be a different error...

@pbrisbin
Copy link
Member

pbrisbin commented Jun 15, 2023

Hi there. There is a few things going on...

1- restyled/restyler:master-final is no longer the image to use, you want restyled/restyler:edge

I would suggest keeping our restyle-path around and using that, unless there is some reason you can't. If not, just update your invocation to use :edge instead.

2- Even with that, this is still possible

docker run will use an image if present, even if that image has been updated remotely. Since :edge (and :master-final before it) are mutable tags this means we might change things (such as config schema) and you won't see those updates until you re-pull your local copy of that image. That's what restyle-path -p is for.

If you can't use restyle-path -p, I would just do an explicit docker pull restyled/restyler:edge every now and then to be sure you're staying up to date. This should resolve the lua-related error.

3- That last failure is something else entirely

I pushed a new version of the prettier restyler which uses a prettier-with-tailwindcss executable to address tailwindcss users. Long story, but that means prettier/info.yaml is saying to run that command. But you're specifically pinning an old version of the image, which of course won't have that executable. I hadn't considered this, and I should do something to better support this use-case. In the meantime, you can configure the command back to what the older image expects with something like the following:

restylers:
  - prettier:
      image: ...
      command: ["prettier", "--write"]
  # ...

@bzbarsky-apple
Copy link
Author

bzbarsky-apple commented Jun 15, 2023

1- restyled/restyler:master-final is no longer the image to use, you want restyled/restyler:edge

I see. I was using an old version of restyle-path, which had the old thing.

I would just do an explicit docker pull restyled/restyler:edge

When I do that, I get:

% docker pull restyled/restyler:edge
edge: Pulling from restyled/restyler
no matching manifest for linux/arm64/v8 in the manifest list entries

and the lua error persists. Possibly relevant: I am on an ARM-based Mac.

In the meantime, you can configure the command back to what the older image expects

Will look into that, thanks!

@pbrisbin
Copy link
Member

no matching manifest for linux/arm64/v8 in the manifest list entries

Hmm. We don't, and never did, build images for arm64. See restyled-io/restylers#468. I'm not clear how the :master-final image was ever working for you before. 🤔

I could probably update our build to produce an arm image for the main restyled/restyler one -- that'd be much less work than trying to do it for every individual restyler.

@bzbarsky-apple
Copy link
Author

docker pull --platform linux/amd64 restyled/restyler:edge

did resolve the lua issue.

@pbrisbin
Copy link
Member

Makes sense. It seems you can pull and run amd64 images, if you do so explicitly.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Jun 15, 2023
See
restyled-io/restyler#208 (comment) item
3: we are pinning a specific version of the prettier image, which means we have
to use a command syntax that works with that version.
bzbarsky-apple added a commit to project-chip/connectedhomeip that referenced this issue Jun 15, 2023
See
restyled-io/restyler#208 (comment) item
3: we are pinning a specific version of the prettier image, which means we have
to use a command syntax that works with that version.
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

No branches or pull requests

2 participants