Skip to content

Refactor premake dependency handling#3099

Open
mercury233 wants to merge 24 commits into
Fluorohydride:masterfrom
mercury233:patch-premake-deps
Open

Refactor premake dependency handling#3099
mercury233 wants to merge 24 commits into
Fluorohydride:masterfrom
mercury233:patch-premake-deps

Conversation

@mercury233

@mercury233 mercury233 commented May 29, 2026

Copy link
Copy Markdown
Collaborator
  • Introduce metadata tables and loops to eliminate repeated per-library option declarations and processing code
  • Add --build-all as a convenience option to build all dependencies from source at once
  • Remove long-deprecated --use-miniaudio and --no-use-miniaudio options
  • Rename the sqlite subproject from sqlite3 to sqlite
  • Show a warning when a dependency include or lib directory is not found
  • Make Premake warnings appear in the GitHub Actions annotations
  • Update comments

Bug fixes:

  • *_INCLUDE_DIR variables were not converted to absolute paths before being used in gframe/premake5.lua, causing relative paths supplied on the command line to be resolved relative to gframe instead of the project root
  • no-build-* flags were checked after build-*, allowing an environment variable (e.g. BUILD_FOO=1) to silently override an explicit --no-build-foo CLI flag
  • GetParam used Lua's or instead of a nil check, causing a falsy _OPTIONS value to incorrectly fall back to the environment variable

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Refactors the Premake-based dependency configuration to reduce duplication and improve ergonomics/CI integration, including a new convenience flag to build all dependencies from source and a rename of the sqlite subproject/directory.

Changes:

  • Replaced per-dependency option/processing blocks with metadata tables + loops, and added --build-all.
  • Renamed the sqlite dependency/subproject from sqlite3 to sqlite (including CI + ignore rules).
  • Improved warning emission (GitHub Actions annotation format) and normalized some option/flag handling.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
premake5.lua Centralizes dependency metadata/options/processing, adds --build-all, and emits GHA-style warnings.
premake/sqlite/premake5.lua Renames sqlite Premake project to sqlite.
gframe/premake5.lua Switches dependency include/link handling to metadata-driven loop and updates Opus/Vorbis link naming.
.gitignore Updates ignored dependency folder from sqlite3/ to sqlite/.
.github/workflows/build.yml Updates CI extraction paths and switches static builds to --build-all.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread premake5.lua Outdated
Comment thread gframe/premake5.lua Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@purerosefallen purerosefallen mentioned this pull request May 31, 2026
@salix5 salix5 requested a review from purerosefallen May 31, 2026 09:47
@purerosefallen

purerosefallen commented Jun 1, 2026

Copy link
Copy Markdown
Collaborator

Not suggesting to rename sqlite3 => sqlite

  • it's still the sqlite-3
  • the Linux package name still being sqlite3

@mercury233 mercury233 marked this pull request as draft June 2, 2026 01:08
@mercury233 mercury233 marked this pull request as ready for review June 30, 2026 02:48
@mercury233

mercury233 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator Author

Not suggesting to rename sqlite3 => sqlite

Reasons for using sqlite3 as the project and directory name:

  • Most package managers provide it as libsqlite3.
  • The upstream source code and API use the sqlite3.* naming convention.

Reasons for using sqlite as the project and directory name:

  • The names of other projects don't include version numbers.
  • If we follow the package managers' naming conventions consistently, the names of other libraries (including, but not limited to, zlib) could end up looking odd. After applying this PR, various parameter names would also need to be changed, for example, SQLITE_INCLUDE_DIRSQLITE3_INCLUDE_DIR.

I think using sqlite is better. @salix5 what do you think?

@mercury233 mercury233 requested a review from salix5 June 30, 2026 03:01
@salix5

salix5 commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

https://packages.debian.org/sid/libsqlite3-dev
Debian package: libsqlite3-dev

https://vcpkg.io/en/package/sqlite3.html
vcpkg: sqlite3

https://github.com/actions/runner-images/blob/main/images/ubuntu/Ubuntu2404-Readme.md
Installed Software of Github runner
Databases

  • sqlite3 3.45.1

https://sqlite.org/cintro.html
The prefixs of the API are sqlite3_

sqlite3 is actually a part of its name, and the variable should be SQLITE3_INCLUDE_DIR.
I think keep using sqlite3 is better.

@mercury233

Copy link
Copy Markdown
Collaborator Author

SQLite is a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine. SQLite is the most used database engine in the world. SQLite is built into all mobile phones and most computers and comes bundled inside countless other applications that people use every day. More Information...
https://www.sqlite.org/

It don't say any 3.

@salix5

salix5 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

The prefixs of the API are sqlite3_*
The prefix is like namespace in C++.
I guess this is why it is called sqlite3 in many package managers.

@mercury233

Copy link
Copy Markdown
Collaborator Author

The name of this subproject is SQLite. Since our project will never have multiple versions such as SQLite 2, SQLite 3, or SQLite 4 coexisting, including the version number in the subproject name serves no purpose. This is fundamentally different from how package managers handle versioning.

@salix5

salix5 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

The name of this subproject is SQLite.

Why do you think so?
Even the module name in ygopro is sqlite3 from the beginning.

Just in case that you didn't notice:
sqlite 3.0.0 is released in 2004.
After 20 years, many people treat sqlite3 as its name, not a name + version number.

@mercury233

Copy link
Copy Markdown
Collaborator Author

The name of this subproject is SQLite.

Why do you think so? Even the module name in ygopro is sqlite3 from the beginning.

#3099 (comment)

Just in case that you didn't notice: sqlite 3.0.0 is released in 2004. After 20 years, many people treat sqlite3 as its name, not a name + version number.

so those people are wrong

@salix5

salix5 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

I really don't want to say that if possible.

You have said that I was "forcibly pushing my opinions to ygopro".
Are you trying to do the same thing now?

@salix5

salix5 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

so those people are wrong

By the way, it sounds like:
Everyone on the highway is driving in the wrong direction.

@mercury233

Copy link
Copy Markdown
Collaborator Author

I really don't want to say that if possible.

You have said that I was "forcibly pushing my opinions to ygopro". Are you trying to do the same thing now?

如果你说的是“我觉得SQLite的实际名称是SQLite3,所以我们应该用SQLite3命名”,我当然会指正你的错误。这不是观点(opinions)而是对错。SQLite项目的官方名称是SQLite而不是SQLite3,这不是以我们中任何人的观点为转移的。而观点是指我们是应该用官方名称还是用什么其他的名字来命名这个子项目(的目录名和相关配置选项名)。

如果你说的是“我觉得不一定用官方项目名,应该用lib的名字”或者“应该用带版本号的名字”,我会不赞同但尊重你的观点。

@salix5

salix5 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

以防萬一你誤會
我不同意"用sqlite3 稱呼他是錯的"這種理論
那是可能的名稱之一
所以在我看來這不是對錯的問題
只是觀點的問題

如果你真的很排斥sqlite3 這個名字
要改成sqlite 亦無不可
但是標準要一致
全部的函式庫都用他們的專案名稱
按照這個標準:
event也是錯的
名字是libevent

jpg也是錯的
名字是libjpg

png也是錯的
名字是libpng

ocgcore 也是錯的
他現在是獨立的專案ygopro-core

這些目錄的名稱也應該改掉才對

@mercury233

mercury233 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

sqlite3 is actually a part of its name

treat sqlite3 as its name, not a name + version number

我也同意可以不用名字去称呼一个东西,用sqlite3称呼sqlite库当然是没有问题的,但说sqlite3是 its name 我觉得不成立

@mercury233

mercury233 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

我建议跳过咬文嚼字环节,关于实际的取舍:

  • 放弃对于依赖项的统一,继续手写premake变量名和文件夹名:一切不用动
  • 使用sqlite:需要部分下游开发者改一次文件夹名
  • 使用sqlite3:需要部分下游开发者改参数名(虽然win和linux在大多数情况下不用动这个参数,只有macos有理由去动)
  • 使用其中任意一个,并设法兼容另一个:徒增复杂度
  • 同时使用:一切不用动

我希望2或4中选一个

@salix5

salix5 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

如果你覺得目錄名稱全部改掉非常麻煩
只改sqlite3 的名稱本質上是一樣的意思
只是麻煩程度稍微降低而已
我是建議這些函式庫的目錄名稱都維持原狀
premake 裡面要怎麼稱呼他們都無所謂

@mercury233

Copy link
Copy Markdown
Collaborator Author

目录名使用sqlite3的话,开发者编译时还要把解压的 sqlite-amalgamation-3530300 多加一个3改成 sqlite3
我觉得目录名应该首选sqlite,保持sqlite3目录名兼容性没有必要

@salix5

salix5 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

libevent
解壓縮的時候名字還要去掉lib改成event
目錄名稱應該首選libevent

@mercury233

Copy link
Copy Markdown
Collaborator Author

libevent 解壓縮的時候名字還要去掉lib改成event 目錄名稱應該首選libevent

问题是需要增加异类还是减少异类。libevent 目录名带lib需要删除是1个异类,zlib目录名带lib不删除也许算一个,sqlite目录名不带3需要增加又是1个。我感觉还是减少了好。

@salix5

salix5 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

減少異類最快也最有效的方法
全部按照相同標準重新命名
全部按照函式庫名稱重新命名就能確保一致性

@mercury233

Copy link
Copy Markdown
Collaborator Author

減少異類最快也最有效的方法 全部按照相同標準重新命名 全部按照函式庫名稱重新命名就能確保一致性

问题是官方名称本身不够一致,也不是都能直接用于link

@salix5

salix5 commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

如果你真的很排斥sqlite3 這個名字
要改成sqlite 亦無不可
但是標準要一致
全部的函式庫都用他們的專案名稱

目錄名稱改成libevent, libjpeg, libpng, core
看起來沒有任何問題

@purerosefallen

Copy link
Copy Markdown
Collaborator

I prefer against changing the lib name to sqlite because it requires too much work for server and CI migrations.

@purerosefallen

Copy link
Copy Markdown
Collaborator

and it requires an adaption to https://github.com/mycard/ygopro/tree/server

@purerosefallen

Copy link
Copy Markdown
Collaborator

我建议跳过咬文嚼字环节,关于实际的取舍:

  • 放弃对于依赖项的统一,继续手写premake变量名和文件夹名:一切不用动
  • 使用sqlite:需要部分下游开发者改一次文件夹名
  • 使用sqlite3:需要部分下游开发者改参数名(虽然win和linux在大多数情况下不用动这个参数,只有macos有理由去动)
  • 使用其中任意一个,并设法兼容另一个:徒增复杂度

我希望2或4中选一个

I prefer 3

@purerosefallen

Copy link
Copy Markdown
Collaborator

and I prefer another way:

  • make a deps.json or something like that, and also put download links there
  • and the CI could go through this file and auto-download those deps

@mercury233

Copy link
Copy Markdown
Collaborator Author

我建议跳过咬文嚼字环节,关于实际的取舍:

  • 放弃对于依赖项的统一,继续手写premake变量名和文件夹名:一切不用动
  • 使用sqlite:需要部分下游开发者改一次文件夹名
  • 使用sqlite3:需要部分下游开发者改参数名(虽然win和linux在大多数情况下不用动这个参数,只有macos有理由去动)
  • 使用其中任意一个,并设法兼容另一个:徒增复杂度
  • 同时使用:一切不用动

我希望2或4中选一个

增加了5。继续使用sqlite3作为目录名和SQLITE*作为参数名。只有子项目名由sqlite3变成了sqlite,对外基本不可见。

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