Create .arc files in the build system#673
Create .arc files in the build system#673BlueishSapphire wants to merge 6 commits intosmartcmd:mainfrom
Conversation
|
switched this to a draft for now due to ongoing discussion of this implementation on Discord |
|
Tested, I will admit I was very wrong Fixes #588 and i'd argue is better than how robocopy and rsync did it |
8d79905 to
bbdb173
Compare
|
Removed the old arc files and rebased off of |
|
Ready to merge? |
|
Forewarning, file globbing issues will persist with the |
|
Do you have any information about the file globbing issues? I'd like to reproduce the issue so I can try to fix it using this implementation |
|
Could it have been this issue? https://stackoverflow.com/a/32412044 |
|
https://cmake.org/cmake/help/latest/command/file.html Comes from: https://discourse.cmake.org/t/is-glob-still-considered-harmful-with-configure-depends/808 CMake globbing behaves differently from system to system. On my personal rig, globbing doesn't even work on any drive other than my C dive at all. Evidently, it isn't just my machine either. I've had at least 3 different machines running varying CMake version with no drives able to globbed. I am assuming it has something to do with path sensitivity, as certain characters like braces or parentheses also cause globbing to fail, but I'm not entirely sure. Even switching between 4.3.0-rc2, 3.31.11, and 3.24 versions didn't fix anything. Considering other issues provided in the links above as well, I believe it is safe to say file globbing in CMake is considered bad practice for good reason. |
|
I’m a little scared of potential regressions this could cause if the new .arc files have different assets than they did before. Has this been fully tested with
|
|
Maybe instead of replacing the asset copy system, this could be a separate target that regenerates the .arc files when needed. Standard builds would be glob free and compiling .arc files optional and only if necessary. |
Description
This change causes CMake to build .arc files from the asset files in
Minecraft.Client/Common/MediaChanges
Previous Behavior
CMake copied the existing
MediaWindows64.arcfromMinecraft.Client/Common/Mediainto the build directoryNew Behavior
CMake builds
MediaWindows64.arcfrom the asset files inMinecraft.Client/Common/Media(e.g.MainMenu1080.swf,languages.loc, etc)Implementation
arcconv.pyscript was written to convert between .arc and .zip. It was inspired by https://github.com/NessieHax/mc-arc-util.cmake/AssetSources.cmakefile was created to list the assets belonging to each platform's arc bundle.cmake/CopyAssets.cmakedefines targets (throughconfigure_file,add_custom_command,add_custom_target) instead of just copying files every time a build happens. It also defines amake_media_archivefunction that zips the specified files and converts the zip into an arc bundle.Minecraft.Client/Common/Mediaso that the build system could find them.AI Use Disclosure
No LLMs were used in the writing of this code.