libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
10.14k stars 1.85k forks source link

Emscripten CI does not work on ubuntu-latest #11218

Open sezero opened 1 month ago

sezero commented 1 month ago

See: https://github.com/sezero/SDL/actions/runs/11342398480/job/31542840236

Something about python, which I don't know anything about.

madebr commented 1 month ago

This is the log:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/selenium/webdriver/common/driver_finder.py", line 38, in get_path
    path = SeleniumManager().driver_location(options) if path is None else path
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/selenium/webdriver/common/selenium_manager.py", line 89, in driver_location
    args = [str(self.get_binary()), "--browser", browser]
                ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/selenium/webdriver/common/selenium_manager.py", line 73, in get_binary
    raise WebDriverException(f"Unable to obtain working Selenium Manager binary; {path}")
selenium.common.exceptions.WebDriverException: Message: Unable to obtain working Selenium Manager binary; /usr/lib/python3/dist-packages/selenium/webdriver/common/linux/selenium-manager

selenium-manager should be part of python3-selenium. Not sure what went wrong in this run. Re-running emscripten jobs on our ci gives no issues.

sezero commented 1 month ago

Re-running emscripten jobs on our ci gives no issues.

My 2nd re-run had failed, haven't done a 3rd time.

sezero commented 1 month ago

This seem 100% reliable is my fork:

https://github.com/sezero/SDL/actions/runs/11336255071/job/31525940596 https://github.com/sezero/SDL/actions/runs/11347119100/job/31557891870 https://github.com/sezero/SDL/actions/runs/11350191455/job/31568155913

madebr commented 1 month ago

I think your account is (once again) one of the firsts to use Ubuntu 24.04 as ubuntu-latest instead of Ubuntu 22.04.

Can you try pinning it to 22.04 until upstream resolves the issue?

--- a/.github/workflows/create-test-plan.py
+++ b/.github/workflows/create-test-plan.py
@@ -125,7 +125,7 @@ JOB_SPECS = {
     "android-cmake-lean": JobSpec(name="Android (CMake, lean)",             os=JobOs.UbuntuLatest,  platform=SdlPlatform.Android,     artifact="SDL-lean-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, lean=True, ),
     "android-mk": JobSpec(name="Android (Android.mk)",                      os=JobOs.UbuntuLatest,  platform=SdlPlatform.Android,     artifact=None,                     no_cmake=True, android_mk=True, ),
     "android-gradle": JobSpec(name="Android (Gradle)",                      os=JobOs.UbuntuLatest,  platform=SdlPlatform.Android,     artifact=None,                     no_cmake=True, android_gradle=True, ),
-    "emscripten": JobSpec(name="Emscripten",                                os=JobOs.UbuntuLatest,  platform=SdlPlatform.Emscripten,  artifact="SDL-emscripten", ),
+    "emscripten": JobSpec(name="Emscripten",                                os=JobOs.Ubuntu22_04,   platform=SdlPlatform.Emscripten,  artifact="SDL-emscripten", ),
     "haiku": JobSpec(name="Haiku",                                          os=JobOs.UbuntuLatest,  platform=SdlPlatform.Haiku,       artifact="SDL-haiku-x64",          container="ghcr.io/haiku/cross-compiler:x86_64-r1beta5", ),
     "loongarch64": JobSpec(name="LoongArch64",                              os=JobOs.UbuntuLatest,  platform=SdlPlatform.LoongArch64, artifact="SDL-loongarch64", ),
     "n3ds": JobSpec(name="Nintendo 3DS",                                    os=JobOs.UbuntuLatest,  platform=SdlPlatform.N3ds,        artifact="SDL-n3ds",               container="devkitpro/devkitarm:latest", ),
sezero commented 1 month ago

I think your account is (once again) one of the firsts to use Ubuntu 24.04 as ubuntu-latest instead of Ubuntu 22.04.

Can you try pinning it to 22.04 until upstream resolves the issue?

Created a test-11218 branch in my fork with your change. I'll report back with the CI result.

sezero commented 1 month ago

Unfortunately, it still fails: https://github.com/sezero/SDL/actions/runs/11350926022/job/31570527906

It did not run on ubuntu 22.04: https://github.com/sezero/SDL/actions/runs/11350926022/job/31570527906#step:1:4 Add [sdl-ci-filter emscripten] to your commit message to only run the emscripten job. It looks like the run has yet to finish: https://github.com/sezero/SDL/actions/runs/11351284397

sezero commented 1 month ago

Unfortunately, it still fails: https://github.com/sezero/SDL/actions/runs/11350926022/job/31570527906

It did not run on ubuntu 22.04: https://github.com/sezero/SDL/actions/runs/11350926022/job/31570527906#step:1:4 Add [sdl-ci-filter emscripten] to your commit message to only run the emscripten job. It looks like the run is yet to finish: https://github.com/sezero/SDL/actions/runs/11351284397

Oh, it's my screw-up: applied the patch but forgot committing it. Waiting for the actual result now.

sezero commented 1 month ago

Yes, seems like emscripten builder is green now: https://github.com/sezero/SDL/actions/runs/11351284397/job/31571651376

sezero commented 1 month ago

Yes, seems like emscripten builder is green now: https://github.com/sezero/SDL/actions/runs/11351284397/job/31571651376

Should we do anything about this here in upstream?

madebr commented 1 month ago

I don't know where the issue is. I think the most appropriate location would be to open an issue with the Ubuntu packagers. (I have no experience with Ubuntu packaging)

sezero commented 1 month ago

I think the most appropriate location would be to open an issue with the Ubuntu packagers

Not something I can do.

Leave this ticket open?

madebr commented 1 month ago

Yes, perhaps rename the title to "Emscripten CI does not work on ubuntu-latest"

sezero commented 1 month ago

OK, title renamed as suggested.

sezero commented 1 month ago

That ubuntu being a debian derivative, maybe @smcv has an idea about python packaging things?

madebr commented 1 month ago

I think this is an issue with Ubuntu's python3-selenium because of these bug reports:

https://bugs.launchpad.net/ubuntu/+source/python-selenium/+bug/2032687 https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1051368

sezero commented 1 month ago

Curiously though, the emscripten builder hasn't failed today my fork of SDL after several syncs with mainstream...

smcv commented 1 month ago

It seems that the python3-selenium in recent Debian and Ubuntu needs an external component (selenium-manager), which is not at all straightforward to package in a way that meets Debian's standards for preventing supply chain attacks, reproducibility, ensuring the presence of complete corresponding source and so on. See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1052460.

If this CI is being run in a throwaway container with no privileged access to SDL stuff (no ability to push commits, tag releases, etc.), then the concern about supply chain attacks etc. isn't relevant, and it would be OK to get Selenium or selenium-manager some other way.

madebr commented 1 month ago

Thanks for the explanation! It looks like it is a rust tool. That won't make it easier to add.

@sezero Can you try this commit? https://github.com/madebr/SDL/commit/0de078b0c7ff5c63c1eac614ee8dfd3a949d4644

ci on my fork (still on 22.04) https://github.com/madebr/SDL/actions/runs/11372722038/job/31637799783

sezero commented 1 month ago

@sezero Can you try this commit? madebr@0de078b

https://github.com/sezero/SDL/actions/runs/11373028367/job/31638801915

Seems to be running or 22.04, no failures so far:

Current runner version: '2.320.0'
Operating System
  Ubuntu
  22.04.5
  LTS
sezero commented 1 month ago

How should I make it to run under 24.04 to test ?

madebr commented 1 month ago

How should I make it to run under 24.04 to test ?

--- a/.github/workflows/create-test-plan.py
+++ b/.github/workflows/create-test-plan.py
@@ -125,7 +125,7 @@ JOB_SPECS = {
     "android-cmake-lean": JobSpec(name="Android (CMake, lean)",             os=JobOs.UbuntuLatest,  platform=SdlPlatform.Android,     artifact="SDL-lean-android-arm64", android_abi="arm64-v8a", android_arch="aarch64", android_platform=23, lean=True, ),
     "android-mk": JobSpec(name="Android (Android.mk)",                      os=JobOs.UbuntuLatest,  platform=SdlPlatform.Android,     artifact=None,                     no_cmake=True, android_mk=True, ),
     "android-gradle": JobSpec(name="Android (Gradle)",                      os=JobOs.UbuntuLatest,  platform=SdlPlatform.Android,     artifact=None,                     no_cmake=True, android_gradle=True, ),
-    "emscripten": JobSpec(name="Emscripten",                                os=JobOs.UbuntuLatest,  platform=SdlPlatform.Emscripten,  artifact="SDL-emscripten", ),
+    "emscripten": JobSpec(name="Emscripten",                                os=JobOs.Ubuntu24_04,   platform=SdlPlatform.Emscripten,  artifact="SDL-emscripten", ),
     "haiku": JobSpec(name="Haiku",                                          os=JobOs.UbuntuLatest,  platform=SdlPlatform.Haiku,       artifact="SDL-haiku-x64",          container="ghcr.io/haiku/cross-compiler:x86_64-r1beta5", ),
     "loongarch64": JobSpec(name="LoongArch64",                              os=JobOs.UbuntuLatest,  platform=SdlPlatform.LoongArch64, artifact="SDL-loongarch64", ),
     "n3ds": JobSpec(name="Nintendo 3DS",                                    os=JobOs.UbuntuLatest,  platform=SdlPlatform.N3ds,        artifact="SDL-n3ds",               container="devkitpro/devkitarm:latest", ),
sezero commented 1 month ago

https://github.com/sezero/SDL/actions/runs/11373966518/job/31641785710

Seems to have passed the 'Install PyPI packages' step. (Still running.)

sezero commented 1 month ago

Running tests fails: https://github.com/sezero/SDL/actions/runs/11373966518/job/31641785710#step:27:49 E.g.:

test 2
      Start  2: testautomation

2: Test command: /opt/hostedtoolcache/Python/3.12.7/x64/bin/python3 "/home/runner/work/SDL/SDL/test/emscripten/driver.py" "--server" "http://localhost:8080" "--browser" "chrome" "--chrome-binary" "/opt/hostedtoolcache/setup-chrome/chromium/1369562/x64/chrome" "--" "testautomation" "--trackmem"
2: Working Directory: /home/runner/work/SDL/SDL/build/test
2: Environment variables: 
2:  SDL_AUDIO_DRIVER=emscripten
2:  SDL_VIDEO_DRIVER=emscripten
2:  SDL_ASSERT=abort
2: Test timeout computed to be: 480
1: Traceback (most recent call last):
1:   File "/home/runner/work/SDL/SDL/test/emscripten/driver.py", line 183, in <module>
1:     raise SystemExit(main())
1:                      ^^^^^^
1:   File "/home/runner/work/SDL/SDL/test/emscripten/driver.py", line 160, in main
1:     sdl_test_driver = SDLSeleniumTestDriver(
1:                       ^^^^^^^^^^^^^^^^^^^^^^
1:   File "/home/runner/work/SDL/SDL/test/emscripten/driver.py", line 56, in __init__
1:     self.driver = driver_contructor(options=driver_options)
1:                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1:   File "/home/runner/.local/lib/python3.12/site-packages/selenium/webdriver/chrome/webdriver.py", line 45, in __init__
1:     super().__init__(
1:   File "/home/runner/.local/lib/python3.12/site-packages/selenium/webdriver/chromium/webdriver.py", line 66, in __init__
1:     super().__init__(command_executor=executor, options=options)
1:   File "/home/runner/.local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 212, in __init__
1:     self.start_session(capabilities)
1:   File "/home/runner/.local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 299, in start_session
1:     response = self.execute(Command.NEW_SESSION, caps)["value"]
1:                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1:   File "/home/runner/.local/lib/python3.12/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
1:     self.error_handler.check_response(response)
1:   File "/home/runner/.local/lib/python3.12/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
1:     raise exception_class(message, screen, stacktrace)
1: selenium.common.exceptions.SessionNotCreatedException: Message: session not created: Chrome failed to start: exited normally.
1:   (session not created: DevToolsActivePort file doesn't exist)
1:   (The process started from chrome location /opt/hostedtoolcache/setup-chrome/chromium/1369562/x64/chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
1: Stacktrace:
1: #0 0x55775f96acd2 <unknown>
1: #1 0x55775f95ca5e <unknown>
1: #2 0x55775f408f27 <unknown>
1: #3 0x55775f43eda4 <unknown>
1: #4 0x55775f4391a6 <unknown>
1: #5 0x55775f48435d <unknown>
1: #6 0x55775f483ad6 <unknown>
1: #7 0x55775f476fe3 <unknown>
1: #8 0x55775f446c41 <unknown>
1: #9 0x55775f445d39 <unknown>
1: #10 0x55775f446a1c <unknown>
1: #11 0x55775f91829f <unknown>
1: #12 0x55775f9333d3 <unknown>
1: #13 0x55775f932e3b <unknown>
1: #14 0x55775f933845 <unknown>
1: #15 0x55775f922ab3 <unknown>
1: #16 0x55775f933be0 <unknown>
1: #17 0x55775f908ee1 <unknown>
1: #18 0x55775f94d248 <unknown>
1: #19 0x55775f94d3d9 <unknown>
1: #20 0x55775f95bd65 <unknown>
1: #21 0x7fb40dc9ca94 <unknown>
1: #22 0x7fb40dd29c3c <unknown>
1: 
madebr commented 1 month ago

I can reproduce. It works on 22.04, but doesn't at 24.04. I reported this upstream at https://github.com/SeleniumHQ/selenium/issues/14609