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

fix windows wasm compilation with packages #5534

Merged
merged 9 commits into from
Aug 29, 2024
Merged

Conversation

Chi-EEE
Copy link
Contributor

@Chi-EEE Chi-EEE commented Aug 29, 2024

No description provided.

@Chi-EEE
Copy link
Contributor Author

Chi-EEE commented Aug 29, 2024

cmake.lua error: couldn't find CMAKE_MAKE_PROGRAM
platform.lua error: toolchains was empty with wasm selected

wasm-test.zip

@@ -151,7 +151,7 @@ end
-- get the toolchains
function _instance:toolchains(opt)
local toolchains = self:_memcache():get("toolchains")
if not toolchains then
if not toolchains or #toolchains == 0 then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

@Chi-EEE Chi-EEE Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I selected wasm as the platform, the toolchains list was empty but not nil, which did not allow me to install headeronly packages, but with this change, it allowed the code to find the toolchain for wasm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should not be empty.

Copy link
Member

@waruqi waruqi Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't reproduce this. You can print debug.traceback() when its empty.

or revert it and open an issue first. I will merge other patches.

Copy link
Contributor Author

@Chi-EEE Chi-EEE Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got these errors before adding the line:

checking for em++.bat ... C:\Users\admin\AppData\Local\.xmake\packages\e\emscripten\3.1.55\e632956fdb43439b94196f0dfdac70b7\upstream\emscripten\em++.bat
checking for the linker (ld) ... em++.bat
error: @programdir\core\package\package.lua:2364: cannot get program for ld
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [@programdir\core\package\package.lua:2364]: in function '_generate_build_configs'
    [@programdir\core\package\package.lua:2589]: in function 'check_cxxsnippets'
    [....xmake\repositories\xmake-repo\packages\a\asap\xmake.lua:15]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...dir\modules\private\action\require\impl\actions\test.lua:41]:
    [...\modules\private\action\require\impl\actions\install.lua:432]:

  => install asap-fork 2023.04.21 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:325: ...\modules\private\action\require\impl\actions\install.lua:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [...\modules\private\action\require\impl\actions\install.lua:494]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:973: 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: ...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37: cannot get program for cc
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:37]: in function 'load'
    [...amdir\core\sandbox\modules\import\core\tool\compiler.lua:316]:
    [@programdir\modules\package\tools\cmake.lua:886]: in function '_get_envs_for_runtime_flags'
    [@programdir\modules\package\tools\cmake.lua:928]: in function '_get_configs'
    [@programdir\modules\package\tools\cmake.lua:1234]: in function 'install'
    [...\.xmake\repositories\xmake-repo\packages\f\fmt\xmake.lua:70]: in function 'script'
    [...dir\modules\private\action\require\impl\utils\filter.lua:114]: in function 'call'
    [...\modules\private\action\require\impl\actions\install.lua:392]:

  => install fmt 11.0.2 .. failed
error: @programdir\core\main.lua:329: @programdir\modules\async\runjobs.lua:325: ...\modules\private\action\require\impl\actions\install.lua:494: install failed!
stack traceback:
    [C]: in function 'error'
    [@programdir\core\base\os.lua:973]:
    [...\modules\private\action\require\impl\actions\install.lua:494]: in function 'catch'
    [@programdir\core\sandbox\modules\try.lua:123]: in function 'try'
    [...\modules\private\action\require\impl\actions\install.lua:361]:
    [...modules\private\action\require\impl\install_packages.lua:496]: in function 'jobfunc'
    [@programdir\modules\async\runjobs.lua:241]:

stack traceback:
        [C]: in function 'error'
        @programdir\core\base\os.lua:973: in function 'base/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>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can open an issue.

@waruqi waruqi merged commit 7336c8a into xmake-io:dev Aug 29, 2024
20 checks passed
@waruqi waruqi added this to the v2.9.5 milestone Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants