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

[tinyorm] added initial port TinyORM v0.36.5 #34640

Merged
merged 2 commits into from
Nov 5, 2023

Conversation

silverqx
Copy link
Contributor

@silverqx silverqx commented Oct 20, 2023

Add the TinyORM v0.36.5 port www.tinyorm.org.

  • Changes comply with the maintainer guide
  • The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines.
  • Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all find_package calls are REQUIRED, are satisfied by vcpkg.json's declared dependencies, or disabled with CMAKE_DISABLE_FIND_PACKAGE_Xxx
  • The versioning scheme in vcpkg.json matches what upstream says.
  • The license declaration in vcpkg.json matches what upstream says.
  • The installed as the "copyright" file matches what upstream says.
  • The source code of the component installed comes from an authoritative source.
  • The generated "usage text" is accurate. See adding-usage for context.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is in the new port's versions file.
  • Only one version is added to each modified port's versions file.

Fixes #31087

@silverqx
Copy link
Contributor Author

Ping @SchaichAlonso

@silverqx silverqx marked this pull request as ready for review October 20, 2023 20:35
@silverqx silverqx changed the title [tinyorm] added initial port TinyORM v0.36.2 [tinyorm] added initial port TinyORM v0.36.3 Oct 20, 2023
SchaichAlonso added a commit to PurpleFlowerGarden/TinyORMOnboarding that referenced this pull request Oct 21, 2023
SchaichAlonso added a commit to PurpleFlowerGarden/TinyORMOnboarding that referenced this pull request Oct 21, 2023
* Rebase vcpkg submodule on microsoft/vcpkg#34640

* Whitelist all unsuported targets
@LilyWangLL LilyWangLL added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Oct 23, 2023
@LilyWangLL
Copy link
Contributor

Thanks for your PR. Please add install copyright in portfile.cmake.

Feature tinyorm[core,disable-thread-local,inline-constants,mysql-ping,orm,sql-mysql,sql-psql,sql-sqlite,strict-mode,tom,tom-example]:x64-windows-static build failed with the following error:

LINK Pass 1: command "C:\PROGRA~1\MICROS~3\2022\ENTERP~1\VC\Tools\MSVC\1437~1.328\bin\Hostx64\x64\link.exe examples\tom\CMakeFiles\tom.dir\main.cpp.obj examples\tom\CMakeFiles\tom.dir\TinyOrm_generated\tmp\tom-Debug.rc.res /out:examples\tom\tom.exe /implib:examples\tom\tom.lib /pdb:examples\tom\tom.pdb /version:0.7 /machine:x64 /nologo /debug /INCREMENTAL /subsystem:console /guard:cf /WX F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\objects-Debug\QMYSQLDriverPlugin_init\QMYSQLDriverPlugin_init.cpp.obj F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\objects-Debug\QPSQLDriverPlugin_init\QPSQLDriverPlugin_init.cpp.obj F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\objects-Debug\QSQLiteDriverPlugin_init\QSQLiteDriverPlugin_init.cpp.obj TinyOrm0d.lib F:\tiny\installed\x64-windows-static\debug\lib\Qt6Sqld.lib F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\qsqlmysqld.lib F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\qsqlpsqld.lib F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\qsqlited.lib F:\tiny\installed\x64-windows-static\debug\lib\Qt6Sqld.lib F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\qsqlmysqld.lib F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\qsqlpsqld.lib F:\tiny\installed\x64-windows-static\debug\Qt6\plugins\sqldrivers\qsqlited.lib F:\tiny\installed\x64-windows-static\debug\lib\libpq.lib F:\tiny\installed\x64-windows-static\debug\lib\libpgport.lib F:\tiny\installed\x64-windows-static\debug\lib\libpgcommon.lib Secur32.lib Wldap32.lib F:\tiny\installed\x64-windows-static\debug\lib\sqlite3.lib F:\tiny\installed\x64-windows-static\debug\lib\Qt6Cored.lib F:\tiny\installed\x64-windows-static\debug\lib\zlibd.lib synchronization.lib mpr.lib userenv.lib advapi32.lib authz.lib kernel32.lib netapi32.lib ole32.lib shell32.lib user32.lib uuid.lib version.lib winmm.lib F:\tiny\installed\x64-windows-static\debug\lib\double-conversion.lib runtimeobject.lib F:\tiny\installed\x64-windows-static\debug\lib\icuind.lib F:\tiny\installed\x64-windows-static\debug\lib\icuucd.lib F:\tiny\installed\x64-windows-static\debug\lib\icudtd.lib F:\tiny\installed\x64-windows-static\debug\lib\pcre2-16d.lib F:\tiny\installed\x64-windows-static\debug\lib\libssl.lib F:\tiny\installed\x64-windows-static\debug\lib\libcrypto.lib crypt32.lib ws2_32.lib F:\tiny\installed\x64-windows-static\debug\lib\zstd.lib F:\tiny\installed\x64-windows-static\debug\lib\mysqlclient.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST /MANIFESTFILE:examples\tom\CMakeFiles\tom.dir/intermediate.manifest examples\tom\CMakeFiles\tom.dir/manifest.res" failed (exit code 1169) with the following output:
mysqlclient.lib(zstd_common.c.obj) : error LNK2005: ZSTD_getErrorCode already defined in zstd.lib(zstd_common.c.obj)
mysqlclient.lib(zstd_common.c.obj) : error LNK2005: ZSTD_getErrorString already defined in zstd.lib(zstd_common.c.obj)
mysqlclient.lib(zstd_common.c.obj) : error LNK2005: ZSTD_versionNumber already defined in zstd.lib(zstd_common.c.obj)
mysqlclient.lib(zstd_common.c.obj) : error LNK2005: ZSTD_versionString already defined in zstd.lib(zstd_common.c.obj)
mysqlclient.lib(zstd_common.c.obj) : error LNK2005: ZSTD_isError already defined in zstd.lib(zstd_common.c.obj)
mysqlclient.lib(zstd_common.c.obj) : error LNK2005: ZSTD_getErrorName already defined in zstd.lib(zstd_common.c.obj)

   Creating library examples\tom\tom.lib and object examples\tom\tom.exp

examples\tom\tom.exe : fatal error LNK1169: one or more multiply defined symbols found

ninja: build stopped: subcommand failed.

@LilyWangLL LilyWangLL marked this pull request as draft October 23, 2023 10:09
@silverqx
Copy link
Contributor Author

Please add install copyright in portfile.cmake.

I'm installing copyright here, I'm generating folder structure specifically for the vcpkg during cmake install and that's why the portfile is so empty and clean.

Is this ok? Or do I have to move this cmake install(FILES LICENSE) command physically into the portfile?

Feature tinyorm[core,disable-thread-local,inline-constants,mysql-ping,orm,sql-mysql,sql-psql,sql-sqlite,strict-mode,tom,tom-example]:x64-windows-static build failed with the following error:

Creating library examples\tom\tom.lib and object examples\tom\tom.exp

examples\tom\tom.exe : fatal error LNK1169: one or more multiply defined symbols found

This is weird I never saw a linking error like this, but I also never enabled all features at once 😄 Of course I revisit it or fix it and let know.

I will not have a lot of time this week so it will not be asap. Thx for review @LilyWangLL

@LilyWangLL
Copy link
Contributor

LilyWangLL commented Oct 24, 2023

Please add install copyright in portfile.cmake.

I'm installing copyright here, I'm generating folder structure specifically for the vcpkg during cmake install and that's why the portfile is so empty and clean.

Is this ok? Or do I have to move this cmake install(FILES LICENSE) command physically into the portfile?

Sorry for I missed it. That is so great, thumbs up for you.👍

Feature tinyorm[core,disable-thread-local,inline-constants,mysql-ping,orm,sql-mysql,sql-psql,sql-sqlite,strict-mode,tom,tom-example]:x64-windows-static build failed with the following error:
Creating library examples\tom\tom.lib and object examples\tom\tom.exp
examples\tom\tom.exe : fatal error LNK1169: one or more multiply defined symbols found

This is weird I never saw a linking error like this, but I also never enabled all features at once 😄 Of course I revisit it or fix it and let know.

I installed each feature individually and they all installed successfully, but when I installed all features at the same time, it failed.

BTW, all features passed with following triplets:

x86-windows
x64-windows

I will not have a lot of time this week so it will not be asap. Thx for review @LilyWangLL

That's ok. Please ping us if this PR is ready for review again.

@silverqx
Copy link
Contributor Author

Sorry for I missed it. That is so great, thumbs up for you.👍

Thx

but when I installed all features at the same time, it failed.

I will fix it

BTW, all features passed with following triplets:

I have also tested these triplets but only tinyorm[core,sql-sqlite,tom-example]:

x64-window-static
x64-window-static-md
x64-linux
x64-linux-dynamic
x64-mingw-dynamic
x64-mingw-static

@silverqx
Copy link
Contributor Author

I have also CI for some of these triplets vcpkg-windows.yml and vcpkg-linux.yml, but this is only for basic triplets x64-windows and x64-linux.

@silverqx
Copy link
Contributor Author

If I'm looking at the linking error message in more detail, I believe that the problem will not be in the tom, the error says that there are multiple defined symbols ZSTD_getErrorString, ZSTD_getErrorString, ... in the mysqlclient.lib, also I don't use any of these function in my code.

The tom.exe or TinyOrm.dll doesn't depend on libzstd I don't use this library in my code. TinyOrm.dll links against the mysqlclient library (if the option MYSQL_PING is ON) and it calls only one function from this library and that is the mysql_ping(). That is all.

Can you try to rebuild it with the mysql_ping disabled?

@silverqx
Copy link
Contributor Author

Static builds are always trash 🙃

@silverqx
Copy link
Contributor Author

silverqx commented Oct 27, 2023

This is how the patch should look like, I was able to successfully build it after this: @dg0yt

diff --git a/ports/libmysql/portfile.cmake b/ports/libmysql/portfile.cmake
index 3a08e3a25..6dc61aaf1 100644
--- a/ports/libmysql/portfile.cmake
+++ b/ports/libmysql/portfile.cmake
@@ -58,6 +58,7 @@ vcpkg_cmake_configure(
         -DWITH_LIBEVENT=system
         -DWITH_LZ4=system
         -DWITH_ZLIB=system
+        -DWITH_ZSTD=system
         -DFORCE_UNSUPPORTED_COMPILER=${FORCE_UNSUPPORTED_COMPILER}
         -DINSTALL_STATIC_LIBRARIES=${BUILD_STATIC_LIBS}
         -DLINK_STATIC_RUNTIME_LIBRARIES=${STATIC_CRT_LINKAGE}
diff --git a/ports/libmysql/vcpkg.json b/ports/libmysql/vcpkg.json
index d8995dbc1..c0449ab16 100644
--- a/ports/libmysql/vcpkg.json
+++ b/ports/libmysql/vcpkg.json
@@ -1,7 +1,7 @@
 {
   "name": "libmysql",
   "version": "8.0.32",
-  "port-version": 6,
+  "port-version": 7,
   "description": "A MySQL client library for C development",
   "homepage": "https://github.com/mysql/mysql-server",
   "license": "GPL-2.0-or-later",

Problem is that libmysql use it's own bundled zstd v1.5.0 and vcpkg has installed zstd v1.5.5, even if I don't use zstd in my code it is the transient dependency of the qtbase.

@silverqx
Copy link
Contributor Author

@dg0yt I see that you added the -DWITH_ZSTD=system in the #34736 should it be fixed?

@silverqx
Copy link
Contributor Author

I tried to build with dg0yt/libmysql branch and it built fine with the x64-windows-static triplet so the latest patches in the #34736 solved it.

I'm changing the draft state to Ready to review as there is no bug or problem in the tinyorm port.

@silverqx silverqx marked this pull request as ready for review October 27, 2023 17:23
@LilyWangLL LilyWangLL added the depends:different-pr This PR or Issue depends on a PR which has been filed label Oct 31, 2023
@LilyWangLL
Copy link
Contributor

Waiting for #34736 merged.

ports/tinyorm/portfile.cmake Outdated Show resolved Hide resolved
@LilyWangLL LilyWangLL removed the depends:different-pr This PR or Issue depends on a PR which has been filed label Nov 2, 2023
LilyWangLL
LilyWangLL previously approved these changes Nov 2, 2023
@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label Nov 2, 2023
Updated version database for TinyORM v0.36.5.
@LilyWangLL LilyWangLL added the info:reviewed Pull Request changes follow basic guidelines label Nov 3, 2023
@silverqx silverqx changed the title [tinyorm] added initial port TinyORM v0.36.3 [tinyorm] added initial port TinyORM v0.36.5 Nov 3, 2023
@JavierMatosD JavierMatosD merged commit a85d307 into microsoft:master Nov 5, 2023
15 checks passed
@silverqx
Copy link
Contributor Author

silverqx commented Nov 5, 2023

Thx @JavierMatosD and @LilyWangLL for review 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR! info:reviewed Pull Request changes follow basic guidelines
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Port Request] TinyOrm
4 participants