cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
47.06k stars 3.19k forks source link

Alpine Linux support #419

Open cdaguerre opened 7 years ago

cdaguerre commented 7 years ago

I don't know if this is even possible but I was wondering if there are any plans to support Alpine Linux.

I don't know if it's helpful but here's an ldd on the Cypress executable from within Alpine:

root@6b425a4f775a[~/.cypress/Cypress] $ ldd ./Cypress 
    /lib64/ld-linux-x86-64.so.2 (0x5603ddf7c000)
    libnode.so => ./libnode.so (0x7f37b4b22000)
    libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x5603ddf7c000)
    libgtk-x11-2.0.so.0 => /usr/lib/libgtk-x11-2.0.so.0 (0x7f37b4557000)
    libgdk-x11-2.0.so.0 => /usr/lib/libgdk-x11-2.0.so.0 (0x7f37b42b5000)
    libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x7f37b4092000)
    libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x7f37b3d29000)
    libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x7f37b3b1d000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x7f37b3900000)
    libcairo.so.2 => /usr/lib/libcairo.so.2 (0x7f37b361b000)
    libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x7f37b33d8000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x7f37b3133000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x7f37b2ef7000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x7f37b2cb7000)
    libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x7f37b2a71000)
    libXi.so.6 => /usr/lib/libXi.so.6 (0x7f37b2862000)
    libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x7f37b2658000)
    libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x7f37b2455000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x7f37b224b000)
    libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x7f37b2048000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x7f37b1e38000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x7f37b1c32000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x7f37b1a28000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x7f37b1705000)
    libXtst.so.6 => /usr/lib/libXtst.so.6 (0x7f37b14ff000)
    libXss.so.1 => /usr/lib/libXss.so.1 (0x7f37b12fc000)
    libgconf-2.so.4 => /usr/lib/libgconf-2.so.4 (0x7f37b10c4000)
    libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x7f37b0ec0000)
    librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x5603ddf7c000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x7f37b0bd1000)
    libnss3.so => /usr/lib/libnss3.so (0x7f37b08a8000)
    libnssutil3.so => /usr/lib/libnssutil3.so (0x7f37b067a000)
    libsmime3.so => /usr/lib/libsmime3.so (0x7f37b0453000)
    libnspr4.so => /usr/lib/libnspr4.so (0x7f37b0214000)
    libffmpeg.so => ./libffmpeg.so (0x7f37afe3d000)
    libasound.so.2 => /usr/lib/libasound.so.2 (0x7f37afb4b000)
    libcups.so.2 => /usr/lib/libcups.so.2 (0x7f37af8d3000)
    libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x5603ddf7c000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x7f37af6b3000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f37af362000)
    libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x5603ddf7c000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f37af150000)
    libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x5603ddf7c000)
    ld-linux-x86-64.so.2 => /lib/ld-linux-x86-64.so.2 (0x7f37aeec3000)
    libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x7f37aecaf000)
    libintl.so.8 => /usr/lib/libintl.so.8 (0x7f37aeaa1000)
    libz.so.1 => /lib/libz.so.1 (0x7f37ae88b000)
    libmount.so.1 => /lib/libmount.so.1 (0x7f37ae64a000)
    libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x7f37ae3ba000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x7f37ae18d000)
    libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x7f37adf89000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x7f37add63000)
    libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x7f37adb55000)
    libbz2.so.1 => /usr/lib/libbz2.so.1 (0x7f37ad948000)
    libffi.so.6 => /usr/lib/libffi.so.6 (0x7f37ad740000)
    libORBit-2.so.0 => /usr/lib/libORBit-2.so.0 (0x7f37ad4d9000)
    libpcre.so.1 => /usr/lib/libpcre.so.1 (0x7f37ad27d000)
    libplc4.so => /usr/lib/libplc4.so (0x7f37ad078000)
    libplds4.so => /usr/lib/libplds4.so (0x7f37ace74000)
    libgnutls.so.30 => /usr/lib/libgnutls.so.30 (0x7f37acb60000)
    libavahi-common.so.3 => /usr/lib/libavahi-common.so.3 (0x7f37ac954000)
    libavahi-client.so.3 => /usr/lib/libavahi-client.so.3 (0x7f37ac745000)
    libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x7f37ac4f7000)
    libblkid.so.1 => /lib/libblkid.so.1 (0x7f37ac2bc000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x7f37ac0b9000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x7f37abeb3000)
    libp11-kit.so.0 => /usr/lib/libp11-kit.so.0 (0x7f37abc57000)
    libtasn1.so.6 => /usr/lib/libtasn1.so.6 (0x7f37aba47000)
    libnettle.so.6 => /usr/lib/libnettle.so.6 (0x7f37ab813000)
    libhogweed.so.4 => /usr/lib/libhogweed.so.4 (0x7f37ab5e0000)
    libgmp.so.10 => /usr/lib/libgmp.so.10 (0x7f37ab37c000)
    libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x7f37ab15c000)
    libuuid.so.1 => /lib/libuuid.so.1 (0x7f37aaf58000)
Error relocating ./libnode.so: __isinf: symbol not found
Error relocating ./libnode.so: __rawmemchr: symbol not found
Error relocating ./libnode.so: __isnan: symbol not found
Error relocating ./libnode.so: backtrace: symbol not found
Error relocating ./libffmpeg.so: __isnan: symbol not found
Error relocating ./libffmpeg.so: __isinf: symbol not found
Error relocating ./Cypress: __sbrk: symbol not found
Error relocating ./Cypress: __isnan: symbol not found
Error relocating ./Cypress: __res_ninit: symbol not found
Error relocating ./Cypress: __finite: symbol not found
Error relocating ./Cypress: backtrace: symbol not found
Error relocating ./Cypress: __isinf: symbol not found
Error relocating ./Cypress: backtrace_symbols: symbol not found
Error relocating ./Cypress: getcontext: symbol not found
Error relocating ./Cypress: __res_nclose: symbol not found
Error relocating ./Cypress: __cmsg_nxthdr: symbol not found
Error relocating ./Cypress: __libc_stack_end: symbol not found
wavesoft commented 7 years ago

I had the same issue... Yeah, it looks like Cypress needs to be built against musl libc instead of glibc. I guess we would need to wait for a new build.

brian-mann commented 7 years ago

This likely has to do with electron and not necessarily Cypress.

It may be easier opening an issue over there https://github.com/electron/electron/issues and ask about what it will take to build Chromium against Alpine.

It may already be possible, so any direction here would be helpful and we can look at adding a new dist when we release.

jwalton commented 6 years ago

This is a year old. -_-

tomatau commented 6 years ago

Also would like this

bahmutov commented 6 years ago

I spent some time looking into this yesterday, and could not get all the required libraries work on Alpine. If anyone can actually build Electron on Alpine Linux, then we could potentially setup a CI chain that builds Alpine-specific Cypress version, but I expect the demand to be pretty low

bahmutov commented 6 years ago

I am going to close this for now, because Electron itself has their Alpine Linux build issue open https://github.com/electron/electron/issues/2727 (opened in 2015). If that issue is resolved successfully, we can revisit Alpine Linux support.

simondiep commented 6 years ago

It appears that Electron 3 no longer depends on gconf. Could this issue be reopened?

rohmanhm commented 5 years ago

It's been two years. Any way to support cypress work with alpine linux?

jennifer-shehane commented 5 years ago

This issue will be covered as part of our 4.0 release - which includes upgrading Electron.

dsebastien commented 5 years ago

Hello,

Any news about this issue? I've just started setting up my CI/CD pipeline and since we're using node:alpine for our Dockerfile, I'm also using it for Gitlab CI, which has led me right here ;-)

502647092 commented 5 years ago

Hello,

Any news about this issue? I've just started setting up my CI/CD pipeline and since we're using node:alpine for our Dockerfile, I'm also using it for Gitlab CI, which has led me right here ;-)

maybe you can try frolvlad/alpine-glibc image

basickarl commented 5 years ago

@dsebastien A lot of us are waiting for this still. As a workaround I only run tests using cypress in the cypress node image and everything else in alpine images. I'll just swap the cypress node image afterwards with the appropriate image later.

kwuite commented 5 years ago

Hi guys, I tried installing cypress via npm on alpine linux and ended up with:

image

I got the /usr/lib/libasound.so.2 from:

My first run was with alpine:3.10 but that did not get me anywhere. So I used this image: frolvlad/alpine-glibc:alpine-3.9_glibc-2.29

Would it be an option to clone the git repo and just completely build Cypress against musl or is the problem with my libasound 2 library?

kwuite commented 5 years ago

Tried building on alpine linux and can confirm that my main problem is this error:

/usr/lib/libasound.so.2: no version information available (required by /home/root/cypress/build/linux/Cypress/Cypress)

image

StackOverflow answer

Quote: Chris => The "no version information available" means that the library version number is lower on the shared object. For example, if your major.minor.patch number is 7.15.5 on the machine where you build the binary, and the major.minor.patch number is 7.12.1 on the installation machine, ld will print the warning.

Alsa-libs APKBUILD for alpine contains this statement: --without-versioned and thus it might cause 'no version information available' error. But that is just an hypothesis.

Anybody got an idea to resolve this issue?

kwuite commented 5 years ago

UPDATE:

I manually build alsa-lib to fix the version error with shared library /usr/lib/libasound.so.2 . Building without the --without-versioned solved the problem.

Unfortunately the following error still appears and make the build fail: Relink `/usr/lib/libgmp.so.10' with `/usr/glibc-compat/lib/libc.so.6' for IFUNC symbol `memset'

image

ffxluca commented 5 years ago

Installing thealsa-lib package (alpine 3.10) I didn't have any ALSA issue

ffxluca commented 5 years ago

I have installed the following packages using apk:

ℹ️Command cypress verify fail when it comes to load libgobject-2.0.so.0

ℹ️Other mislinked libraries (found with ldd)

This is as far as I could get with Alpine 3.10 and Cypress (base image being php:7.3.8-fpm-alpine3.10 )

mishra-prabhakar commented 4 years ago

Hello,

Any news about this issue? I've just started setting up my CI/CD pipeline and since we're using node:alpine for our Dockerfile, I'm also using it for Gitlab CI, which has led me right here ;-)

Xvfb package enables you to run graphical applications without a display (e.g., browser tests on a CI server) so cypress needs xvfb package to be installed.

It is not going to work on node:alpine image as the xvfb package is not present.

Running on markadams/chromium-xvfb-js docker image fixed the issue for me.

eylonmalin commented 4 years ago

Hello, Any news about this issue? I've just started setting up my CI/CD pipeline and since we're using node:alpine for our Dockerfile, I'm also using it for Gitlab CI, which has led me right here ;-)

Xvfb package enables you to run graphical applications without a display (e.g., browser tests on a CI server) so cypress needs xvfb package to be installed.

It is not going to work on node:alpine image as the xvfb package is not present.

Running on markadams/chromium-xvfb-js docker image fixed the issue for me.

@Prabhakar-17 markadams/chromium-xvfb-js is not based on alpine

kwuite commented 4 years ago

@ffxluca

Installing thealsa-lib package (alpine 3.10) I didn't have any ALSA issue

I never said I had an issue installing the library on alpine. It is the libasound driver that is packaged in alsa-lib that gave me the error about versioning. Which in return was solved by packaging it myself.

This is as far as I could get with Alpine 3.10 and Cypress (base image being php:7.3.8-fpm-alpine3.10 )

As you can see in my post I am compiling Cypress with glibc. Not pulling it from some php based base image.

jennifer-shehane commented 4 years ago

Is this resolved? Previously it was believed that the issue was dependent on an Electron upgrade. We've upgraded Electron close to its most recent version now. Can anywhere verify?

flotwig commented 4 years ago

I tried playing with Cypress in the alpine:latest Docker image (docker run --entrypoint sh -it alpine:latest), and ran into issues with permissions when installing as root.

I got further installing as a regular user, but even after that, Alpine seems to have some issue with the Cypress binary. The cli fails to launch the binary with an ENOENT error, and you can't even launch it manually, even though it certifiably exists:

~ $ ls -al ./.cache/Cypress/4.8.0/Cypress/Cypress 
-rwxr-xr-x    1 foo      foo      116418440 Jun 10 13:38 ./.cache/Cypress/4.8.0/Cypress/Cypress
~ $ ./.cache/Cypress/4.8.0/Cypress/Cypress 
ash: ./.cache/Cypress/4.8.0/Cypress/Cypress: not found

Maybe someone who knows more about Alpine knows more about why this is happening.


EDIT: The same issue occurs when installing & trying to run vanilla Electron, so it does not appear to be a Cy-specific issue.

flotwig commented 4 years ago

This issue still seems to exist even after Electron 9.0.5.

PlantDaddy commented 4 years ago

Yeah I recently tried to get cypress running on alpine 3.12, with no luck. I was able to get all dependencies with the exception of gconf, which electron still seems to rely on

x-yuri commented 4 years ago

Is this resolved? Previously it was believed that the issue was dependent on an Electron upgrade. We've upgraded Electron close to its most recent version now. Can anywhere verify?

@jennifer-shehane Actually I'm not sure where the idea came from that it has something to do with gconf. In the original post I see no:

Error loading shared library libgconf-2.so.4: No such file or directory (needed by /root/.cache/Cypress/3.4.1/Cypress/Cypress)

What I see is:

https://gist.github.com/x-yuri/c96dd195e8293f292de824aba203ab3e

which supposedly means that Electron was built against glibc, and that is the reason it doesn't start.

I understand Cypress comes with a custom version of Electron? Why? How can I build one?

flotwig commented 4 years ago

I understand Cypress comes with a custom version of Electron? Why? How can I build one?

@x-yuri Cypress uses the Electron binaries that get installed with electron from the NPM registry. You can actually reproduce this issue using the Electron binaries directly, without Cypress, see my comment: https://github.com/cypress-io/cypress/issues/419#issuecomment-642017901 It seems to be a generic issue with running Electron in Alpine.

x-yuri commented 4 years ago

Indeed, the issue can be reproduced w/o cypress. And they don't seem to want to support it:

In order for this to happen someone would need to confirm that Chromium, Node, et al will run correctly on it and to add support for it in all the affected build scripts, so I don't think it's likely this will be on the project's supported roadmap.

However MUSL-libc does indeed look cool. If a volunteer wrote the code to make this happen, I suspect the project would accept the code as an unsupported feature.

Apr 15, 2018

https://github.com/electron/electron/issues/12610#issuecomment-381412186

I'm closing this for now because we don't plan to support musl officially. I'm happy to offer what help I can, though!

Sep 12, 2018

https://github.com/electron/electron/issues/9662#issuecomment-420480342

And there's at least one person who succeeded in those threads.

T9Xe3c9RjBJ commented 4 years ago

Hi all. Can someone offer the latest update on whether or not there is currently support for latest Alpine Linux? Any progress?

F1r3Hydr4nt commented 3 years ago

I just stumbled upon this annoying issue and found the dependencies listed on Cypress' website, but could not find equivalent packages like this person: https://gitlab.com/gitterHQ/webapp/-/merge_requests/1852 so I tried the following:

sudo apk add libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev lib
gconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb
ERROR: unable to select packages:
  libasound2 (no such package):
    required by: world[libasound2]
  libgbm-dev (no such package):
    required by: world[libgbm-dev]
  libgconf-2-4 (no such package):
    required by: world[libgconf-2-4]
  libgtk-3-0 (no such package):
    required by: world[libgtk-3-0]
  libgtk2.0-0 (no such package):
    required by: world[libgtk2.0-0]
  libnss3 (no such package):
    required by: world[libnss3]
  libxss1 (no such package):
    required by: world[libxss1]
  libxtst6 (no such package):
    required by: world[libxtst6]

Then I searched and found what I think might be suitable replacements:

sudo apk add xauth xvfb libxtst alsa-lib-dev libxscrnsaver nss l
ibnotify-dev mesa-gbm gtk+3.0 gtk+2.0

sudo apk add gconf --repository=http://dl-cdn.alpinelinux.org/alpine/
v3.8/main

To no avail:

yarn cy:open
yarn run v1.22.10
$ cypress open
It looks like this is your first time using Cypress: 6.3.0
  ✖  Verifying Cypress can run /home/alb/.cache/Cypress/6.3.0/Cypress
    → Cypress Version: 6.3.0
Cypress failed to start.

This is usually caused by a missing library or dependency.
The error below should indicate which dependency is missing.
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Command failed with ENOENT: /home/alb/.cache/Cypress/6.3.0/Cypress/Cypress --no-sandbox --smoke-test --ping=980
spawn /home/alb/.cache/Cypress/6.3.0/Cypress/Cypress ENOENT
----------
Platform: linux (Alpine Linux - 3.13.0)
Cypress Version: 6.3.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

This is not very verbose ^ where is the log file?

x-yuri commented 3 years ago

@F1r3Hydr4nt https://docs.cypress.io/guides/references/troubleshooting.html#Print-DEBUG-logs

F1r3Hydr4nt commented 3 years ago

@x-yuri Thank you, here is the output, it does not mention any specific missing dependency as far as I can see:

export DEBUG=cypress:*
hostname:~/Work/base$ yarn cypress open
yarn run v1.22.10
$ /home/Work/base/node_modules/.bin/cypress open
  cypress:cli:cli cli starts with arguments ["/usr/bin/node","/home/Work/base/node_modules/.bin/cypress","open"] +0ms
  cypress:cli NODE_OPTIONS is not set +0ms
  cypress:cli:cli program parsing arguments +3ms
  cypress:cli:cli opening Cypress +1ms
  cypress:cli parsed cli options {} +160ms
  cypress:cli opening from options {"project":"/home/Work/base"} +0ms
  cypress:cli command line arguments ["--project","/home/Work/base"] +0ms
  cypress:cli verifying Cypress app +0ms
  cypress:cli checking environment variables +2ms
  cypress:cli checking if executable exists /home/.cache/Cypress/6.3.0/Cypress/Cypress +5ms
  cypress:cli Binary is executable? : true +13ms
  cypress:cli binaryDir is  /home/.cache/Cypress/6.3.0/Cypress +1ms
  cypress:cli Reading binary package.json from: /home/.cache/Cypress/6.3.0/Cypress/resources/app/package.json +0ms
  cypress:cli Found binary version 6.3.0 installed in: /home/.cache/Cypress/6.3.0/Cypress +14ms
  cypress:cli could not read binary_state.json file at "/home/.cache/Cypress/6.3.0/binary_state.json" +19ms
  cypress:cli {} +0ms
  cypress:cli is Verified ? undefined +5ms
  cypress:cli running binary verification check 6.3.0 +0ms
It looks like this is your first time using Cypress: 6.3.0

  cypress:cli clearing out the verified version +5ms
  cypress:cli DISPLAY environment variable is set to :0.0 on Linux
  cypress:cli Assuming this DISPLAY points at working X11 server,
  cypress:cli Cypress will not spawn own Xvfb
  cypress:cli 
  cypress:cli NOTE: if the X11 server is NOT working, Cypress will exit without explanation,
  cypress:cli   see https://github.com/cypress-io/cypress/issues/4034
  cypress:cli Solution: Unset the DISPLAY variable and try again:
  cypress:cli   DISPLAY= npx cypress run ... +0ms
  cypress:cli needs Xvfb? false +4ms
  cypress:cli spawning, should retry on display problem? true +0ms
  cypress:cli disabling Electron sandbox +1ms
  **cypress:cli running smoke test +0ms
  cypress:cli using Cypress executable /home/.cache/Cypress/6.3.0/Cypress/Cypress +0ms
  cypress:cli smoke test command: /home/.cache/Cypress/6.3.0/Cypress/Cypress --no-sandbox --smoke-test --ping=452 +0ms
  cypress:cli smoke test timeout 30000 ms +0ms
  cypress:cli Smoke test failed: Error: Command failed with ENOENT:** /home/.cache/Cypress/6.3.0/Cypress/Cypress --no-sandbox --smoke-test --ping=452
spawn /home/.cache/Cypress/6.3.0/Cypress/Cypress ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:269:19)
    at onErrorNT (internal/child_process.js:465:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn /home/.cache/Cypress/6.3.0/Cypress/Cypress',
  path: '/home/.cache/Cypress/6.3.0/Cypress/Cypress',
  spawnargs: [ '--no-sandbox', '--smoke-test', '--ping=452' ],
  originalMessage: 'spawn /home/.cache/Cypress/6.3.0/Cypress/Cypress ENOENT',
  shortMessage: 'Command failed with ENOENT: /home/.cache/Cypress/6.3.0/Cypress/Cypress --no-sandbox --smoke-test --ping=452\n' +
    'spawn /home/.cache/Cypress/6.3.0/Cypress/Cypress ENOENT',
  command: '/home/.cache/Cypress/6.3.0/Cypress/Cypress --no-sandbox --smoke-test --ping=452',
  exitCode: undefined,
  signal: undefined,
  signalDescription: undefined,
  stdout: '',
  stderr: '',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
} +24ms
  cypress:cli error message: Command failed with ENOENT: /home/.cache/Cypress/6.3.0/Cypress/Cypress --no-sandbox --smoke-test --ping=452
spawn /home/.cache/Cypress/6.3.0/Cypress/Cypress ENOENT +2ms
  ✖  Verifying Cypress can run /home/.cache/Cypress/6.3.0/Cypress
    → Cypress Version: 6.3.0
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.

----------

Command failed with ENOENT: /home/.cache/Cypress/6.3.0/Cypress/Cypress --no-sandbox --smoke-test --ping=452
spawn /home/.cache/Cypress/6.3.0/Cypress/Cypress ENOENT

----------

Platform: linux (Alpine Linux - 3.13.0)
Cypress Version: 6.3.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Maybe this will help, not sure what the 'smoketest' is about

x-yuri commented 3 years ago

This will unlikely help. Does /home/.cache/Cypress/6.3.0/Cypress/Cypress exist? What ldd /home/.cache/Cypress/6.3.0/Cypress/Cypress says?

F1r3Hydr4nt commented 3 years ago
ldd /home/.cache/Cypress/6.3.0/Cypress/Cypres
s
    /lib64/ld-linux-x86-64.so.2 (0x7f551963e000)
    libffmpeg.so => /home/.cache/Cypress/6.3.0/Cypress/libffmpeg.so (0x7f551108e000)
    libdl.so.2 => /lib64/ld-linux-x86-64.so.2 (0x7f551963e000)
    libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f551963e000)
    librt.so.1 => /lib64/ld-linux-x86-64.so.2 (0x7f551963e000)
    libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x7f5511043000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x7f5510f3c000)
    libgio-2.0.so.0 => /usr/lib/libgio-2.0.so.0 (0x7f5510d93000)
    libnss3.so => /usr/lib/libnss3.so (0x7f5510c87000)
    libnssutil3.so => /usr/lib/libnssutil3.so (0x7f5510c58000)
    libsmime3.so => /usr/lib/libsmime3.so (0x7f5510c32000)
    libnspr4.so => /usr/lib/libnspr4.so (0x7f5510bef000)
    libatk-1.0.so.0 => /usr/lib/libatk-1.0.so.0 (0x7f5510bc8000)
    libatk-bridge-2.0.so.0 => /usr/lib/libatk-bridge-2.0.so.0 (0x7f5510b94000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x7f5510a72000)
    libX11-xcb.so.1 => /usr/lib/libX11-xcb.so.1 (0x7f5510a6d000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x7f5510a46000)
    libdbus-1.so.3 => /usr/lib/libdbus-1.so.3 (0x7f55109fc000)
    libgdk_pixbuf-2.0.so.0 => /usr/lib/libgdk_pixbuf-2.0.so.0 (0x7f55109da000)
    libgtk-3.so.0 => /usr/lib/libgtk-3.so.0 (0x7f5510282000)
    libgdk-3.so.0 => /usr/lib/libgdk-3.so.0 (0x7f5510197000)
    libpangocairo-1.0.so.0 => /usr/lib/libpangocairo-1.0.so.0 (0x7f5510187000)
    libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x7f5510141000)
    libcairo.so.2 => /usr/lib/libcairo.so.2 (0x7f5510052000)
    libm.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f551963e000)
    libXcomposite.so.1 => /usr/lib/libXcomposite.so.1 (0x7f551004d000)
    libXdamage.so.1 => /usr/lib/libXdamage.so.1 (0x7f5510048000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0x7f5510035000)
    libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x7f551002d000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0x7f5510021000)
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0x7f550fffe000)
    libdrm.so.2 => /usr/lib/libdrm.so.2 (0x7f550ffec000)
    libxkbcommon.so.0 => /usr/lib/libxkbcommon.so.0 (0x7f550ffaf000)
    libgbm.so.1 => /usr/lib/libgbm.so.1 (0x7f550ffa0000)
    libasound.so.2 => /usr/lib/libasound.so.2 (0x7f550fed9000)
    libcups.so.2 => /usr/lib/libcups.so.2 (0x7f550fe52000)
    libatspi.so.0 => /usr/lib/libatspi.so.0 (0x7f550fe1f000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f550fe05000)
    libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f551963e000)
Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /home/.cache/Cypress/6.3.0/Cypress/Cypress)
    libffi.so.7 => /usr/lib/libffi.so.7 (0x7f550fdfa000)
    libpcre.so.1 => /usr/lib/libpcre.so.1 (0x7f550fd9e000)
    libintl.so.8 => /usr/lib/libintl.so.8 (0x7f550fd91000)
    libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x7f550fd8c000)
    libz.so.1 => /lib/libz.so.1 (0x7f550fd72000)
    libmount.so.1 => /lib/libmount.so.1 (0x7f550fd21000)
    libplc4.so => /usr/lib/libplc4.so (0x7f550fd1a000)
    libplds4.so => /usr/lib/libplds4.so (0x7f550fd15000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x7f550fd10000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x7f550fd08000)
    libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x7f550fc66000)
    libpangoft2-1.0.so.0 => /usr/lib/libpangoft2-1.0.so.0 (0x7f550fc4f000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x7f550fc12000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x7f550fb5e000)
    libfribidi.so.0 => /usr/lib/libfribidi.so.0 (0x7f550fb41000)
    libcairo-gobject.so.2 => /usr/lib/libcairo-gobject.so.2 (0x7f550fb36000)
    libepoxy.so.0 => /usr/lib/libepoxy.so.0 (0x7f550fa26000)
    libXi.so.6 => /usr/lib/libXi.so.6 (0x7f550fa15000)
    libwayland-client.so.0 => /usr/lib/libwayland-client.so.0 (0x7f550fa05000)
    libwayland-cursor.so.0 => /usr/lib/libwayland-cursor.so.0 (0x7f550f9fc000)
    libwayland-egl.so.1 => /usr/lib/libwayland-egl.so.1 (0x7f550f9f7000)
    libXcursor.so.1 => /usr/lib/libXcursor.so.1 (0x7f550f9eb000)
    libXinerama.so.1 => /usr/lib/libXinerama.so.1 (0x7f550f9e6000)
    libpixman-1.so.0 => /usr/lib/libpixman-1.so.0 (0x7f550f950000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x7f550f91f000)
    libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x7f550f91a000)
    libxcb-render.so.0 => /usr/lib/libxcb-render.so.0 (0x7f550f90b000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0x7f550f8ff000)
    libwayland-server.so.0 => /usr/lib/libwayland-server.so.0 (0x7f550f8ea000)
    libavahi-common.so.3 => /usr/lib/libavahi-common.so.3 (0x7f550f8dd000)
    libavahi-client.so.3 => /usr/lib/libavahi-client.so.3 (0x7f550f8cb000)
    libgnutls.so.30 => /usr/lib/libgnutls.so.30 (0x7f550f6f9000)
    libblkid.so.1 => /lib/libblkid.so.1 (0x7f550f6b1000)
    libbsd.so.0 => /usr/lib/libbsd.so.0 (0x7f550f69b000)
    libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x7f550f67c000)
    libuuid.so.1 => /lib/libuuid.so.1 (0x7f550f672000)
    libbz2.so.1 => /usr/lib/libbz2.so.1 (0x7f550f663000)
    libbrotlidec.so.1 => /usr/lib/libbrotlidec.so.1 (0x7f550f656000)
    libp11-kit.so.0 => /usr/lib/libp11-kit.so.0 (0x7f550f547000)
    libunistring.so.2 => /usr/lib/libunistring.so.2 (0x7f550f3d1000)
    libtasn1.so.6 => /usr/lib/libtasn1.so.6 (0x7f550f3bd000)
    libnettle.so.8 => /usr/lib/libnettle.so.8 (0x7f550f379000)
    libhogweed.so.6 => /usr/lib/libhogweed.so.6 (0x7f550f332000)
    libgmp.so.10 => /usr/lib/libgmp.so.10 (0x7f550f2cc000)
    libbrotlicommon.so.1 => /usr/lib/libbrotlicommon.so.1 (0x7f550f2a9000)
Error relocating /home/.cache/Cypress/6.3.0/Cypress/libffmpeg.so: __isnan: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/libffmpeg.so: __isinf: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/libffmpeg.so: strtoll_l: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/libffmpeg.so: strtoull_l: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __snprintf_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __sprintf_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __memcpy_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __fprintf_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __memmove_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: gnu_get_libc_version: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __fdelt_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __vsnprintf_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __strncpy_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __isnan: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __isinf: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __sbrk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __res_nclose: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __res_ninit: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __isnanf: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __longjmp_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __memset_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: strtoll_l: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: strtoull_l: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: backtrace: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __strncat_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: random_r: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: initstate_r: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __isinff: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __vfprintf_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __register_atfork: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __longjmp_chk: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: __libc_stack_end: symbol not found
F1r3Hydr4nt commented 3 years ago

Error loading shared library ld-linux-x86-64.so.2: No such file or directory (needed by /home/.cache/Cypress/6.3.0/Cypress/Cypress)

This is taken care of by: sudo apk add gcompat

x-yuri commented 3 years ago

Which means (predictably) that you first need to build electron, only then you can proceed with running Cypress, since the latter "uses the Electron binaries."

F1r3Hydr4nt commented 3 years ago

Aha yes, the predictable libc vs musl roadblock because obviously Cypress "uses the Electron binaries" how ignorant of me... Despite the fact that chromium is available from the community repo work building electron has stalled. I tried installing the void electron binary with no luck either.

I wonder how we might force Cypress to point towards the unofficially supported alpine community repo Chromium? Maybe we can simply disable the Cypress verify step

x-yuri commented 3 years ago

Is this what you're looking for? https://docs.cypress.io/guides/guides/launching-browsers.html#Launching-by-a-path UPD But you need electron in any case (cypress simply won't start), so not a solution.

F1r3Hydr4nt commented 3 years ago

Correct, thanks though it nearly worked and gave some better errors:

yarn cypress run --browser /usr/bin/chromium-browser 
yarn run v1.22.10
$ /home/Work/base/node_modules/.bin/cypress run --browser /usr/bin/chromium-browser
It looks like this is your first time using Cypress: 6.3.0

  ✖  Verifying Cypress can run /home/.cache/Cypress/6.3.0/Cypress
    → Cypress Version: 6.3.0
Cypress failed to start.

This is usually caused by a missing library or dependency.

The error below should indicate which dependency is missing.

https://on.cypress.io/required-dependencies

If you are using Docker, we provide containers with all required dependencies installed.

----------

Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: random_r: symbol not found
Error relocating /home/.cache/Cypress/6.3.0/Cypress/Cypress: initstate_r: symbol not found

----------

Platform: linux (Alpine Linux - 3.13.0)
Cypress Version: 6.3.0
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
scottf9 commented 2 years ago

Any chance of support for Alpine Linux? Cypress still will not run on it. Alpine Linux is integral to many testing pipelines that use Docker, so it'd be really great to get support.

salarhfz-fs commented 2 years ago

Same here. Please support Alpine Linux. All of our organization pipelines are on Alpine. It's really necessary.

x-yuri commented 2 years ago

@scott-f9 @salarhfz-fs The issue is with Electron, not with Cypress. If you can provide step-by-step instructions on how to build Electron under Alpine Linux that would be a major push in this direction.

akauppi commented 2 years ago

To widen the envelope a bit, the browser engine doesn't need to be Electron, right? The original poster doesn't define which engine they want to run.

This comment mentions it in 2017:

This likely has to do with electron and not necessarily Cypress.

It may be easier opening an issue over there https://github.com/electron/electron/issues and ask about what it will take to build Chromium against Alpine.

For me, Alpine + Chromium headless + Cypress would be sweet. My itch is long image downloads in Cloud Build (CI).

x-yuri commented 2 years ago

@akauppi Correct me if I'm wrong, but in order to run Cypress you need Electron, even if you run your tests in Edge down the road.

By the way, I just noticed that there's a chromium package under Alpine Linux. Which makes me think that the hardest part is done. But it's been there at least since v3.3, which might suggest that there's more to it than that.

cbleek commented 2 years ago

I have also stumbled across this problem. I am under the impression that it has now been described in detail and that someone familiar with the components involved can do it for little money.

I would be willing to give $100 to the person who summarizes the details found and describes what needs to be done.

$500 I would pay for the implementation.

How do you guys see this. Am I completely wrong on this or is this realistic.

F1r3Hydr4nt commented 2 years ago

Here are steps to build electron for libc: https://www.electronjs.org/docs/latest/development/build-instructions-linux And for musl (alpine), you have to patch as discussed in this thread.

cbleek commented 2 years ago

I've created an $500 offer. https://www.upwork.com/jobs/~01a73a498cdd7bd7f5

JuliaFoerster commented 2 years ago

Hi @cbleek The offer is not on the website anymore. Has someone completed it? Is so, can you share the image? If not, will I get 500 USD if I share the image with you? It's a win & win situation for me ;-) Unless you dont reply.

cbleek commented 2 years ago

It's a task that takes a lot of time. Rather weeks than days. At least that's what I was told by a very good developer who wanted to try.

Unfortunately I didn't make much substantial progress worth sharing, I was just trying to build electron with musl-libc by trying to apply the patches from alpine's chromium package, that kinda worked but there were still plenty of failures to fix.. TBH, even if I would have gotten it to build, it isn't clear how it would been incorporated into the electron project..

JessicaSachs commented 1 year ago

👋🏻 Hey friends. Perhaps I could get a quick status update here? @flotwig do you know what the deal is w/ Alpine? I'm going through like 8 repositories at work and adding Cy in is particularly painful because the Docker setups are Alpine-based 😸

liam-verta commented 1 year ago

It looks like there's a package for electron in the testing repository for Alpine: https://pkgs.alpinelinux.org/package/edge/testing/x86_64/electron