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

fastly: fastly compute serve does not work, viceroy not nix'fieid #219897

Closed
nomeata opened this issue Mar 6, 2023 · 3 comments · Fixed by #220060
Closed

fastly: fastly compute serve does not work, viceroy not nix'fieid #219897

nomeata opened this issue Mar 6, 2023 · 3 comments · Fixed by #220060
Labels
0.kind: bug Something is broken

Comments

@nomeata
Copy link
Contributor

nomeata commented Mar 6, 2023

The fastly compute serve command uses the Rust program https://github.com/fastly/Viceroy/ to run stuff. It automatically fetches the latest release, but then that binary doesn’t work:

$ fastly compute serve
…

✓ Fetching latest Viceroy release
✓ Running local server

INFO: Command output:
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------

ERROR: fork/exec /home/jojo/.config/fastly/viceroy: no such file or directory.

This error may be caused by a problem with your host environment, for example too-restrictive file permissions, files that already exist, or a full disk.

As usual on NixOS, the wrong linker is the (or at least one) problem:

/home/jojo/.config/fastly/viceroy: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ad6929dea160708e4501e5e365ca6b80469a480e, for GNU/Linux 3.2.0, stripped

I see two possible ways to approach the problem:

  1. Package viceroy for nixpkgs (straightforward rustPlatform.buildRustPackage seems to work), patch fastly to always use that version, disable auto-updating viceroy.
  2. Let fastly fetch the binary release, but patch it to run patchelf on it after downloading.

@ereslibre @shyim, do you have thoughts on this?

@shyim
Copy link
Member

shyim commented Mar 7, 2023

We should package it and adjust the PATH of fastly to find it. For Auto Update we should make a PR to allow disabling that feature and enable that by default with nix

@ereslibre
Copy link
Member

We should package it

I will open a couple of PR's tonight, for adding viceroy and another one to wrap fastly with the PATH properly set.

@Integralist
Copy link

👋🏻 cross-posting in case it's useful
fastly/cli#859

nomeata added a commit to nomeata/haskell-on-fastly that referenced this issue Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants