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

Add poco msys and mingw version #4390

Merged
merged 26 commits into from
Jul 4, 2024
Merged

Add poco msys and mingw version #4390

merged 26 commits into from
Jul 4, 2024

Conversation

TabNahida
Copy link
Contributor

  • Before adding new features and new modules, please go to issues to submit the relevant feature description first.
  • Write good commit messages and use the same coding conventions as the rest of the project.
  • Please commit code to dev branch and we will merge into master branch in feature
  • Ensure your edited codes with four spaces instead of TAB.

  • 增加新特性和新模块之前,请先到issues提交相关特性说明,经过讨论评估确认后,再进行相应的代码提交,避免做无用工作。
  • 编写友好可读的提交信息,并使用与工程代码相同的代码规范,代码请用4个空格字符代替tab缩进。
  • 请提交代码到dev分支,如果通过,我们会在特定时间合并到master分支上。
  • 为了规范化提交日志的格式,commit消息,不要用中文,请用英文描述。

@@ -21,7 +21,7 @@ package("poco")
end
add_configs("mysql", {description = "Enable mysql support.", default = false, type = "boolean"})
add_configs("postgresql", {description = "Enable postgresql support.", default = false, type = "boolean"})
add_configs("odbc", {description = "Enable odbc support.", default = is_plat("windows"), type = "boolean"})
add_configs("odbc", {description = "Enable odbc support.", default = is_plat("windows") or not is_plat("mingw"), type = "boolean"})
Copy link
Member

Choose a reason for hiding this comment

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

why? or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Odbc support must on mingw platform

Copy link
Member

Choose a reason for hiding this comment

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

why not is_plat("windows", "mingw")?

is_plat("windows") or not is_plat("mingw")

is_plat("windows") It is a redundant condition, becasee windows always satisfy or not is_plat("mingw")

@@ -21,7 +21,7 @@ package("poco")
end
add_configs("mysql", {description = "Enable mysql support.", default = false, type = "boolean"})
add_configs("postgresql", {description = "Enable postgresql support.", default = false, type = "boolean"})
add_configs("odbc", {description = "Enable odbc support.", default = is_plat("windows") or not is_plat("mingw"), type = "boolean"})
add_configs("odbc", {description = "Enable odbc support.", default = is_plat("windows") and not is_plat("mingw", "msys"), type = "boolean"})
Copy link
Member

Choose a reason for hiding this comment

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

? windows -> true, other -> always false

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the original setting for other platform is false. And MingW and msys platform need this be false to pass the compile.

Copy link
Member

Choose a reason for hiding this comment

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

the original settings: windows-> true, other -> false
the current settings: windows -> true, other -> false

I don't see any difference.

@TabNahida
Copy link
Contributor Author

@waruqi I cannot actually fix the bug of the building. Msys x64 platform on my computer cannot be compiled successfully but it passed on github action.

end)

on_install("windows", "linux", "macosx", function (package)
on_install("windows", "linux", "macosx", "mingw@!macosx|x86_64", "msys|x86_64", function (package)
Copy link
Member

Choose a reason for hiding this comment

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

没这种写法

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i686和i386架构跑不了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

我要禁这个两个架构

Copy link
Member

Choose a reason for hiding this comment

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

那你直接填 mingw|x86_64 不就好了么。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

那你直接填 mingw|x86_64 不就好了么。

我之前试过了啊,macosx mingw的x86_64过不了

Copy link
Member

Choose a reason for hiding this comment

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

那你直接填 mingw|x86_64 不就好了么。

我之前试过了啊,macosx mingw的x86_64过不了

那你到底要干啥。。凡事一次性说完整,你刚只说了要禁 i686/i386 没说要禁 x86_64 。。

i686和i386架构跑不了
我要禁这个两个架构

Copy link
Member

Choose a reason for hiding this comment

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

另外,mingw 都禁的差不多了,那还不如不启用 mingw 了,,要么就把过不了的 error 全修了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

另外,mingw 都禁的差不多了,那还不如不启用 mingw 了,,要么就把过不了的 error 全修了

本来就是仿照msys的包,它只给了三个架构
image
这个是msys的包构建策略
https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-poco/PKGBUILD

Copy link
Contributor Author

Choose a reason for hiding this comment

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

另外,mingw 都禁的差不多了,那还不如不启用 mingw 了,,要么就把过不了的 error 全修了

我查了,应该在mac上是cmake没有识别成mingw而是识别到macos了,然后就是在i686架构下,limits头文件未添加

Copy link
Member

Choose a reason for hiding this comment

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

不是,是它压根没考虑到 mac mingw 的情况,仅支持 windows 上的 mingw

https://github.com/pocoproject/poco/blob/2442c66f84616b05e072fa49e77c15d0d5ab08cc/cmake/PocoMacros.cmake#L43

@@ -44,7 +45,7 @@ package("poco")
end
end)

on_install("windows", "linux", "macosx", function (package)
on_install("windows", "linux", "macosx", "mingw", "msys", function (package)
Copy link
Member

Choose a reason for hiding this comment

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

msys 平台不是 mingw ,是指的 msys2 下 gcc.exe toolchain,你确定这个包支持?

Copy link
Member

Choose a reason for hiding this comment

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

这个库,估计顶多也就支持 mingw@msys ,除非你加 patch 给它强行支持上

Copy link
Contributor Author

Choose a reason for hiding this comment

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

msys 平台不是 mingw ,是指的 msys2 下 gcc.exe toolchain,你确定这个包支持?

msys2 的pacman上有

Copy link
Member

Choose a reason for hiding this comment

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

msys 平台不是 mingw ,是指的 msys2 下 gcc.exe toolchain,你确定这个包支持?

msys2 的pacman上有

你还是没明白我说的。。就你上面那个 pacman 图给的包,就是 msys2 上 pacman 提供的 mingw 包。。也就是 mingw@msys ,意思就是 msys2 下的 mingw 编译平台。。

msys 平台用的是 msys2 下原始 gcc.exe 工具链,不是 mingw toolchain 。。

mingw 平台,包含 mingw@msys2 + mingw@macosx ,也就是 msys2/macos 下的 mingw 工具链。。

Copy link
Contributor Author

@TabNahida TabNahida Jul 3, 2024

Choose a reason for hiding this comment

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

msys 平台不是 mingw ,是指的 msys2 下 gcc.exe toolchain,你确定这个包支持?

msys2 的pacman上有

你还是没明白我说的。。就你上面那个 pacman 图给的包,就是 msys2 上 pacman 提供的 mingw 包。。也就是 mingw@msys ,意思就是 msys2 下的 mingw 编译平台。。

msys 平台用的是 msys2 下原始 gcc.exe 工具链,不是 mingw toolchain 。。

mingw 平台,包含 mingw@msys2 + mingw@macosx ,也就是 msys2/macos 下的 mingw 工具链。。

所以其实这个就只支持mingw@msys平台,而且是只有x86_64架构

Copy link
Member

Choose a reason for hiding this comment

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

对啊,所以 msys 平台加来干嘛。。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

对啊,所以 msys 平台加来干嘛。。

那就开一个mingw@msys吧,mac那个我搞不定

table.insert(configs, "-DENABLE_DATA_" .. lib:upper() .. "=" .. (package:config(lib) and "ON" or "OFF"))
end


if is_subhost("msys") and is_arch("x86_64") then
Copy link
Member

Choose a reason for hiding this comment

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

还有这。用 package:is_arch ,另外为啥要用 is_subhost ? 不应该判断 mingw platform 么

Copy link
Contributor Author

Choose a reason for hiding this comment

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

还有这。用 package:is_arch ,另外为啥要用 is_subhost ? 不应该判断 mingw platform 么

好的我已经改了一次了

table.insert(configs, "-DENABLE_DATA_" .. lib:upper() .. "=" .. (package:config(lib) and "ON" or "OFF"))
end


if is_host("mingw") then
Copy link
Member

Choose a reason for hiding this comment

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

没有 mingw 这个 host ,只有平台



if is_host("mingw") then
table.insert(configs, "-DPOCO_DATA_NO_SQL_PARSER=ON")
Copy link
Member

Choose a reason for hiding this comment

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

另外,这个应该做成 sql_parser 的 config

table.insert(configs, "-DENABLE_DATA_" .. lib:upper() .. "=" .. (package:config(lib) and "ON" or "OFF"))
end


if is_plat("mingw") then
Copy link
Member

Choose a reason for hiding this comment

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

用 package:is_plat



if package:is_plat("mingw") then
table.insert(configs, "-DPOCO_DATA_NO_SQL_PARSER=" .. (package:config("sql_parser") and "OFF" or "ON"))
Copy link
Member

Choose a reason for hiding this comment

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

不对啊,应该根据 config 去 enable/disable 。。。平台判断设置 default value,哪有倒过来的。。其他平台这个 config 不等于还是没用上

Copy link
Member

Choose a reason for hiding this comment

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

另外,没有 ENABLE_DATA_SQL_PARSER 么。。上面 mysql 上的都有这些配置

Copy link
Contributor Author

Choose a reason for hiding this comment

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

另外,没有 ENABLE_DATA_SQL_PARSER 么。。上面 mysql 上的都有这些配置

好像没有

@TabNahida
Copy link
Contributor Author

@waruqi 如果你觉得现在可以合并就合并吧,我不想再折腾了。虽然现在其实就增加了一个平台但是应该够了,我后面再来看吧

@Issues-translate-bot
Copy link

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


@waruqi If you think it can be merged now, just merge it. I don’t want to bother anymore. Although it’s actually just one more platform now, it should be enough. I’ll look at it later.

@waruqi waruqi merged commit a627341 into xmake-io:dev Jul 4, 2024
65 checks passed
@zeroxer
Copy link
Contributor

zeroxer commented Jul 7, 2024

  • mark: windows poco install failed.
  • xrepo install poco
    • get error about msys, my toolchain is msvc
-- Detecting C compile features - done
-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) 
-- Found ZLIB: D:/Apps/ScoopHome/App/apps/msys2/current/mingw64/lib/libz.dll.a (found version "1.2.13")  
-- Could not find OPTIONAL package Readline
-- Could not find OPTIONAL package Editline
.......

D:\Apps\ScoopHome\App\apps\msys2\current\mingw64\include\stdlib.h(389,32): error C2085: '_exit': not in formal parameter list [C:\Users\Dev\AppData\Local\.xmake\cache\packages\2407\p\pcre2\10. 
       42\source\build_9524e0ca\pcre2-8-static.vcxproj]
         D:\Apps\ScoopHome\App\apps\msys2\current\mingw64\include\stdlib.h(389,49): error C2143: syntax error: missing ';' before 'type' [C:\Users\Dev\AppData\Local\.xmake\cache\packages\2407\p\pcre2\1 
       0.42\source\build_9524e0ca\pcre2-8-static.vcxproj]
         D:\Apps\ScoopHome\App\apps\msys2\current\mingw64\include\stdlib.h(396,16): error C2085: '_Exit': not in formal parameter list [C:\Users\Dev\AppData\Local\.xmake\cache\packages\2407\p\pcre2\10. 
       42\source\build_9524e0ca\pcre2-8-static.vcxproj]
         D:\Apps\ScoopHome\App\apps\msys2\current\mingw64\include\stdlib.h(396,27): error C2143: syntax error: missing ';' before 'type' [C:\Users\Dev\AppData\Local\.xmake\cache\packages\2407\p\pcre2\1 
       0.42\source\build_9524e0ca\pcre2-8-static.vcxproj]

it seems that pcre2 used some include in my msys env which is wrong.

@TabNahida
Copy link
Contributor Author

  • mark: windows poco install failed.

  • xrepo install poco

    • get error about msys, my toolchain is msvc
-- Detecting C compile features - done
-- Could NOT find BZip2 (missing: BZIP2_LIBRARIES BZIP2_INCLUDE_DIR) 
-- Found ZLIB: D:/Apps/ScoopHome/App/apps/msys2/current/mingw64/lib/libz.dll.a (found version "1.2.13")  
-- Could not find OPTIONAL package Readline
-- Could not find OPTIONAL package Editline
.......

D:\Apps\ScoopHome\App\apps\msys2\current\mingw64\include\stdlib.h(389,32): error C2085: '_exit': not in formal parameter list [C:\Users\Dev\AppData\Local\.xmake\cache\packages\2407\p\pcre2\10. 
       42\source\build_9524e0ca\pcre2-8-static.vcxproj]
         D:\Apps\ScoopHome\App\apps\msys2\current\mingw64\include\stdlib.h(389,49): error C2143: syntax error: missing ';' before 'type' [C:\Users\Dev\AppData\Local\.xmake\cache\packages\2407\p\pcre2\1 
       0.42\source\build_9524e0ca\pcre2-8-static.vcxproj]
         D:\Apps\ScoopHome\App\apps\msys2\current\mingw64\include\stdlib.h(396,16): error C2085: '_Exit': not in formal parameter list [C:\Users\Dev\AppData\Local\.xmake\cache\packages\2407\p\pcre2\10. 
       42\source\build_9524e0ca\pcre2-8-static.vcxproj]
         D:\Apps\ScoopHome\App\apps\msys2\current\mingw64\include\stdlib.h(396,27): error C2143: syntax error: missing ';' before 'type' [C:\Users\Dev\AppData\Local\.xmake\cache\packages\2407\p\pcre2\1 
       0.42\source\build_9524e0ca\pcre2-8-static.vcxproj]

it seems that pcre2 used some include in my msys env which is wrong.

Full log is needed to fix your problem.

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.

4 participants