xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
9.82k stars 774 forks source link

checking for mingw directory ... no #5496

Closed yybbwc closed 2 weeks ago

yybbwc commented 3 weeks ago

Xmake Version

2.9.4

Operating System Version and Architecture

win10 ltsc21

Describe Bug

好像没找到mingw目录

Expected Behavior

切换到mingw

Project Configuration

一大堆

Additional Information and Error Logs

checking for architecture ... x86_64 checking for mingw directory ... no error: @programdir\core\main.lua:329: @programdir\actions\config\main.lua:157: target(scite): toolchain not found! stack traceback: [C]: in function 'error' [@programdir\core\base\os.lua:973]: in function 'raiselevel' [@programdir\core\sandbox\modules\utils.lua:143]: in function 'assert' [@programdir\actions\config\main.lua:157]: in function '_check_target_toolchains' [@programdir\actions\config\main.lua:403]: [C]: in function 'xpcall' [@programdir\core\base\utils.lua:275]: [@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: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>

yybbwc commented 3 weeks ago

我用的是草莓perl中附带的mingw

yybbwc commented 3 weeks ago

https://strawberryperl.com/ 这是草莓perl的官网

Issues-translate-bot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


I am using mingw that comes with strawberry perl

Issues-translate-bot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


https://strawberryperl.com/ This is the official website of strawberryperl

star-hengxing commented 3 weeks ago

用 scoop 装一个正常的 mingw,或者用 scoop 装 msys 再装 mingw 也行。。

Issues-translate-bot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


Use scoop to install a normal mingw, or use scoop to install msys and then mingw. .

yybbwc commented 3 weeks ago

我搞定了

Issues-translate-bot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


I got it

yybbwc commented 3 weeks ago

在find_mingw.lua的大概59行加这个条件 or p:find(string.ipattern("strawberry%-perl[^\/]*[\/]c[\/]bin$"))

yybbwc commented 3 weeks ago
        if not sdkdir then
            local pathenv = os.getenv("PATH")
            if pathenv then
                local buildhash_pattern = string.rep('%x', 32)
                local match_pattern = "[\\/]packages[\\/]%w[\\/].*mingw.*[\\/][^\\/]+[\\/]" .. buildhash_pattern .. "[\\/]bin"
                for _, p in ipairs(path.splitenv(pathenv)) do
                    print(p)
                    if (p:find(match_pattern) or p:find(string.ipattern("mingw[%w%-%_%+]*[\\/]bin")) or p:find(string.ipattern("strawberry%-perl[^\\/]*[\\/]c[\\/]bin$")))
                    and path.filename(p) == "bin" 
                    and os.isdir(p) then
                        sdkdir = path.directory(p)
                        break
                    end
                end
            end
        end
waruqi commented 3 weeks ago

指定下 --mingw=/xxxx/mingw 就行了,自动找,只能找常规位置。不保证一定能找到

Issues-translate-bot commented 3 weeks ago

Bot detected the issue body's language is not English, translate it automatically.


Just specify --mingw=/xxxx/mingw, it will automatically find and intelligently find the regular location. There is no guarantee that you will find it