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

Re-add actions to build xmake with cosmocc #6010

Open
A2va opened this issue Dec 26, 2024 · 2 comments
Open

Re-add actions to build xmake with cosmocc #6010

A2va opened this issue Dec 26, 2024 · 2 comments

Comments

@A2va
Copy link
Contributor

A2va commented Dec 26, 2024

Is your feature request related to a problem? Please describe.

Previously, a workflow was created to build xmake with cosmocc
https://github.com/xmake-io/xmake/blob/b657911e2b0c34674570368c73c5025eff9d7649/.github/workflows/cosmocc.yml
However, this was not successful as it didn't run, but I noticed that this build was made using macos, so I tried to build it on linux.

First, I just tested that a normal xmake build (without embed) would work

a2va:~/xmake/core$ xmake f -p linux --cosmocc=y

The executable runs fine, then I enabled embed

a2va:~/xmake/core$ xmake f -p linux --cosmocc=y

Again, no problem with the executable, then I copied the file to Windows (the build was done in WSL Ubuntu). And it starts, but with this error:

PS D:\\xm-tt> .\\xmake-tt.exe --version
Error: @programdir/core/base/task.lua:398: @programdir/core/base/winos.lua:238: Field '_registry_query' is not accessible (a null value)
Stack traceback:
    [@programdir/core/base/winos.lua:238]: in function 'registry_query'.
    [@programdir/core/base/cpu.lua:222]: in function '_info'.
    [@programdir/core/base/cpu.lua:286]: in function 'Vendor'
    [@programdir/core/base/cpu.lua:352]:
    [@programdir/core/base/os.lua:1443]: in function 'default_njob'.
    [@programdir/plugins/pack/xmake.lua:31]: in main chunk

I suspect this is because Cosmopolitan doesn't implement the Windows API for editing the registry, but those can added if needed (eg: jart/cosmopolitan#1318), or the other solution would be to completely disable this functionality.

Describe the solution you'd like

With this feature the xmake bundle executable which is for now windows only could be extended to other platforms.

Describe alternatives you've considered

No response

Additional context

No response

@waruqi
Copy link
Member

waruqi commented Dec 27, 2024

I tried it before, but it still has many problems, such as it will stuck on macos ci and some windows api problems.

But I don't have time to solve them recently, so I can only delete it temporarily. If you can solve these problems, you can submit a PR.

@A2va
Copy link
Contributor Author

A2va commented Dec 27, 2024

I managed to built xmake in the CI but one of the test fails, I don't know if this is due to cmake or not.

> /usr/bin/gcc -c -m64 -DAL_LIBTYPE_STATIC -isystem /home/runner/.xmake/packages/o/openal-soft/1.23.1/ac313711f22a45f2a1a2f9b24f64d1d1/include -isystem /home/runner/.xmake/packages/l/libsndio/1.9.0/aa973ae5d04a4f53a02cf28d02c69457/include -isystem /home/runner/.xmake/packages/a/alsa-lib/1.2.10/60f829908b344b8193f7d458e8a93b5a/include -o /tmp/.xmake1001/241227/_B5599DC13D654B00859AC66A1E9E1B10.o /tmp/.xmake1001/241227/_76360DFFA3454E3488F03C9FE8D87B65.c
> /usr/bin/g++ -o /tmp/.xmake1001/241227/_B5599DC13D654B00859AC66A1E9E1B10.b /tmp/.xmake1001/241227/_B5599DC13D654B00859AC66A1E9E1B10.o -m64 -L/home/runner/.xmake/packages/o/openal-soft/1.23.1/ac313711f22a45f2a1a2f9b24f64d1d1/lib -L/home/runner/.xmake/packages/l/libsndio/1.9.0/aa973ae5d04a4f53a02cf28d02c69457/lib -L/home/runner/.xmake/packages/a/alsa-lib/1.2.10/60f829908b344b8193f7d458e8a93b5a/lib -lopenal -lsndio -latopology -lasound -lpthread -ldl
> checking for c includes(AL/al.h)
> checking for c funcs(alGetProcAddress)
> checking for c links(openal, sndio, atopology, asound, pthread, dl)
> checking for c snippet(has_cfuncs)
  => install openal-soft 1.23.1 .. ok
  => download https://www.sfml-dev.org/files/SFML-2.5.1-sources.zip .. ok
error: @programdir/core/sandbox/modules/os.lua:273: -- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - donCMake Error at /usr/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find OpenGL (missing: OPENGL_opengl_LIBRARY OPENGL_glx_LIBRARY
  OPENGL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/local/share/cmake-3.31/Modules/FindPackageHandleStandardArgs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
  /usr/local/share/cmake-3.31/Modules/FindOpenGL.cmake:579 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  cmake/Macros.cmake:279 (find_package)
  src/SFML/Window/CMakeLists.txt:257 (sfml_find_package)


r remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Configuring incomplete, errors occurred!

stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [@programdir/core/sandbox/modules/os.lua:273]:
    [@programdir/core/sandbox/modules/os.lua:291]: in function 'vrunv'
    [@programdir/modules/package/tools/cmake.lua:1317]: in function 'configure'
    [@programdir/modules/package/tools/cmake.lua:1359]: in function 'install'
    [./xmake.lua:192]: in function 'script'
    [...dir/modules/private/action/require/impl/utils/filter.lua:114]: in function 'call'
    [.../modules/private/action/require/impl/actions/install.lua:452]:

  => install sfml 2.5.1 .. failed
error: @programdir/core/main.lua:329: @programdir/modules/async/runjobs.lua:325: .../modules/private/action/require/impl/actions/install.lua:561: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [.../modules/private/action/require/impl/actions/install.lua:561]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [.../modules/private/action/require/impl/actions/install.lua:419]:
    [...modules/private/action/require/impl/install_packages.lua:510]: in function 'jobfunc'
    [@programdir/modules/async/runjobs.lua:241]:

stack traceback:
	[C]: in function 'error'
	@programdir/core/base/os.lua:1075: in function 'os.raiselevel'
	(...tail calls...)
	@programdir/core/main.lua:329: in upvalue 'cotask'
	@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>
>>     test failed: @programdir/core/sandbox/modules/os.lua:337: exec(xmake f -c -D -y) failed(255)
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [@programdir/core/sandbox/modules/os.lua:337]: in function 'exec'
    [./tests/test_utils/test_build.lua:4]: in function 'build'
    [./tests/projects/package/components/test.lua:10]:

>>       function test_main tests/projects/package/components/test.lua:1
error: @programdir/core/main.lua:329: ./tests/test_utils/print_error.lua:46: aborting because of unhandled error ...
stack traceback:
    [C]: in function 'error'
    [@programdir/core/base/os.lua:1075]:
    [./tests/test_utils/print_error.lua:46]: in function 'print_error'
    [./tests/runner.lua:58]: in function 'catch'
    [@programdir/core/sandbox/modules/try.lua:123]: in function 'try'
    [./tests/runner.lua:45]:
    [./tests/run.lua:7]: in function '_run_test'
    [./tests/run.lua:42]:
    [@programdir/plugins/lua/main.lua:124]:
    [C]: in function 'xpcall'
    [@programdir/core/base/utils.lua:244]:
    [@programdir/core/base/task.lua:491]: in function 'run'
    [@programdir/core/main.lua:327]: in function 'cotask'
    [@programdir/core/base/scheduler.lua:406]:

stack traceback:
	[C]: in function 'error'
	@programdir/core/base/os.lua:1075: in function 'os.raiselevel'
	(...tail calls...)
	@programdir/core/main.lua:329: in upvalue 'cotask'
	@programdir/core/base/scheduler.lua:406: in function <@programdir/core/base/scheduler.lua:399>
Error: Process completed with exit code 255.

https://github.com/A2va/xmake/blob/cosmocc-ci/.github/workflows/cosmocc.yml
https://github.com/A2va/xmake/actions/runs/12518925059/job/34922147269#step:7:2163

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants