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

Alpine Linux support #419

Open
cdaguerre opened this issue Feb 9, 2017 · 54 comments
Open

Alpine Linux support #419

cdaguerre opened this issue Feb 9, 2017 · 54 comments
Labels
browser: electron OS: linux pkg/electron This is due to an issue in the packages/electron directory prevent-stale mark an issue so it is ignored by stale[bot] stage: ready for work The issue is reproducible and in scope type: feature New feature that does not currently exist

Comments

@cdaguerre
Copy link

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
Copy link

wavesoft commented Mar 16, 2017

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
Copy link
Member

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
Copy link

jwalton commented Feb 3, 2018

This is a year old. -_-

@tomatau
Copy link

tomatau commented Feb 16, 2018

Also would like this

@bahmutov
Copy link
Contributor

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
Copy link
Contributor

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

@simondiep
Copy link

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

@rohmanhm
Copy link

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

@jennifer-shehane
Copy link
Member

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

@cypress-bot cypress-bot bot added stage: ready for work The issue is reproducible and in scope and removed stage: awaiting external fix A 3rd party bug in Cypress - awaiting release labels Feb 21, 2019
@jennifer-shehane jennifer-shehane added pkg/electron This is due to an issue in the packages/electron directory browser: electron labels Feb 21, 2019
@dsebastien
Copy link

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
Copy link

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
Copy link

basickarl commented Jul 23, 2019

@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
Copy link

kwuite commented Nov 4, 2019

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:

  • RUN apk add --no-cache alsa-lib
  • RUN apk add --no-cache alsa-lib-dev (header files)

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
Copy link

kwuite commented Nov 4, 2019

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
Copy link

kwuite commented Nov 4, 2019

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
Copy link

ffxluca commented Nov 17, 2019

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

@ffxluca
Copy link

ffxluca commented Nov 18, 2019

I have installed the following packages using apk:

  • chromium
  • xvfb
  • gtk+3.0-dev
  • libnotify
  • gconf
  • nss
  • libxscrnsaver
  • alsa-lib
  • xkbcomp
  • glibc-2.30-r0.apk (downloaded from sgerrand/alpine-pkg-glibc)

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

ℹ️Other mislinked libraries (found with ldd)

  • __isnan: symbol not found
  • __isinf: symbol not found
  • strtoll_l: symbol not found
  • strtoull_l: symbol not found
  • __sbrk: symbol not found
  • __res_nclose: symbol not found
  • __res_ninit: symbol not found
  • __vsnprintf_chk: symbol not found
  • __isnanf: symbol not found
  • __isnan: symbol not found
  • __isinf: symbol not found
  • __longjmp_chk: symbol not found
  • strtoll_l: symbol not found
  • strtoull_l: symbol not found
  • __fdelt_chk: symbol not found
  • backtrace: symbol not found
  • __strncat_chk: symbol not found
  • __fprintf_chk: symbol not found
  • __sprintf_chk: symbol not found
  • initstate_r: symbol not found
  • random_r: symbol not found
  • __strcat_chk: symbol not found
  • __isinff: symbol not found
  • __vfprintf_chk: symbol not found
  • __snprintf_chk: symbol not found
  • gnu_get_libc_version: symbol not found
  • __register_atfork: symbol not found
  • __longjmp_chk: symbol not found

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
Copy link

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.

@x-yuri
Copy link

x-yuri commented Jan 27, 2021

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
Copy link

F1r3Hydr4nt commented Jan 27, 2021

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
Copy link

x-yuri commented Jan 27, 2021

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
Copy link

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
Copy link

scottf9 commented Jun 17, 2022

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
Copy link

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

@x-yuri
Copy link

x-yuri commented Jun 27, 2022

@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
Copy link

akauppi commented Jun 27, 2022

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
Copy link

x-yuri commented Jun 27, 2022

@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
Copy link

cbleek commented Jul 20, 2022

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
Copy link

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
Copy link

cbleek commented Jul 21, 2022

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

@JuliaFoerster
Copy link

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
Copy link

cbleek commented Aug 16, 2022

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
Copy link
Contributor

👋🏻 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
Copy link

liam-verta commented Feb 13, 2023

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

@nagash77 nagash77 added the prevent-stale mark an issue so it is ignored by stale[bot] label Apr 3, 2023
@tobiasbueschel
Copy link

Linking a related issue of the cypress-docker-images repository: cypress-io/cypress-docker-images#110

@nagash77 nagash77 added the type: feature New feature that does not currently exist label Apr 25, 2023
@damianobarbati
Copy link

@tobiasbueschel @liam-verta @cbleek did you manage to find a solution for this?
Alpine is maybe the most used base image in docker, how can this still be an issue? 😢

@leordancarmona07
Copy link

leordancarmona07 commented May 7, 2024

Your system is missing the dependency: Xvfb

Ecountered:

$ npm run RunTCOnChrome
> [email protected] RunTCOnChrome
> cypress run --browser chrome
It looks like this is your first time using Cypress: 13.8.1
[STARTED] Task without title.
[FAILED] Your system is missing the dependency: Xvfb
[FAILED] 
[FAILED] Install Xvfb and run Cypress again.
[FAILED] 
[FAILED] Read our documentation on dependencies for more information:
[FAILED] 
[FAILED] https://on.cypress.io/required-dependencies
[FAILED] 
[FAILED] If you are using Docker, we provide containers with all required dependencies installed.
[FAILED] 
[FAILED] ----------
[FAILED] 
[FAILED] Error: spawn Xvfb ENOENT
[FAILED] 
[FAILED] ----------
[FAILED] 
[FAILED] Platform: linux-x64 (Debian - 12)
[FAILED] Cypress Version: 13.8.1
Your system is missing the dependency: Xvfb
Install Xvfb and run Cypress again.
Read our documentation on dependencies for more information:
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Error: spawn Xvfb ENOENT
----------
Platform: linux-x64 (Debian - 12)
Cypress Version: 13.8.1
Cleaning up project directory and file based variables
00:00
ERROR: Job failed: exit status 1

gitlab-ci.yml

stages:
  - test

e2eChrome:
  image: cypress/browsers:node18.12.0-chrome107
  stage: test
  script:
    - npm ci
    - npm run RunTCOnChrome

package.json

"scripts": {
    "test": "cypress open",
    "RunTCOnChrome": "cypress run --headless --browser chrome",
    "RunTCOnElectron": "cypress run --headless --browser electron"
}

Requesting assistance please, I need it on our company project.

@jennifer-shehane @MikeMcC399

@MikeMcC399
Copy link
Contributor

@leordancarmona07

Requesting assistance please, I need it on our company project.

You can request assistance from the Cypress technical community on Discord

Discord chat (click on button)

You can also refer to the GitLab CI documentation for using Cypress in this environment. In the example given on the documentation site, the Cypress Docker version used is cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1. This is not the latest version, however it is a lot newer than the image cypress/browsers:node18.12.0-chrome107 you mention in your post.

Since this issue is marked as type: feature New feature that does not currently exist and it not listed on the Cypress App Priorities dashboard it is unlikely to meet your needs in the short term.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
browser: electron OS: linux pkg/electron This is due to an issue in the packages/electron directory prevent-stale mark an issue so it is ignored by stale[bot] stage: ready for work The issue is reproducible and in scope type: feature New feature that does not currently exist
Projects
None yet
Development

No branches or pull requests