-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Builtin: Print warnings if SHA256 of files does not match with build #16553
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
base: master
Are you sure you want to change the base?
Conversation
TODOs: * move it somewhere else * abs path * mod security off codepath * exception instead of returning false * fallback mainmenu
(a bunch of `ls -1`)
(should maybe not use add_custom_command then?)
(Should make shebangs work in CPCSM. (Though it looks like luajit already ignores shebangs. 🤷))
this should make GenerateBuiltinFilesCpp a common dependency of EngineCommon, I think, so fix this: > The custom command generating > > /Users/runner/work/luanti/luanti/build_xcode/src/builtin_files.cpp > > is attached to multiple targets: > > GenerateBuiltinFilesCpp > EngineCommon > > but none of these is a common dependency of the other(s). This is not > allowed by the Xcode "new build system".
944417f to
f0c5835
Compare
|
Things I don't like about this concept:
My approach would be to write a small C++ program that traverses the directory and generates the source file required by the main |
I hate cmake.
also makes GenerateBuiltinFilesList.cmake simpler
it generates a cpp file, so no src file will include it. hence clang tidy *should* not need it, right?
|
|
||
|
|
||
| # Command for builtin_files.cpp | ||
| add_custom_command( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For clarity, this is not the same as for GenerateVersion, because GenerateVersion rebuilds every time.
(I hope the comments and DEPENDS make this obvious enough for future readers.)
CMake has a glob feature, no need to reimplement it in C++. It was already discussed here: #16553 (comment)
Sounds like premature optimization to me. |
This reverts commit ef6bc53. the clang tidy ci does need it
| -DENABLE_GETTEXT=FALSE \ | ||
| -DBUILD_SERVER=TRUE | ||
| cmake --build build --target GenerateVersion | ||
| cmake --build build --target GenerateVersion GenerateBuiltinFilesCpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might also work to pass build/src/builtin_files.cpp here. One should be able to get rid of GenerateBuiltinFilesCpp then. But this seemed cleaner for me.
loadfile(ordofile) a path in builtin (with abs path) if either the file is not in the cmake list or if the hash mismatches.Fixes Make builtin check for expected engine version #16318.
ScriptApiSecurity::safeLoadFile.(And CPCSM files will now have the shebang ignored (but it looks like luajit already does that).)
dofile()andloadfile()(without args) is removed.(ContendDB grep had no true positive results.)
To do
This PR is Ready for Review.
TODO:
"is in a path, it might split the list. (see github review comment below)How to test
/lua dofile()