Skip to content

Create .arc files in the build system#673

Open
BlueishSapphire wants to merge 6 commits intosmartcmd:mainfrom
BlueishSapphire:feat/arc-build-system
Open

Create .arc files in the build system#673
BlueishSapphire wants to merge 6 commits intosmartcmd:mainfrom
BlueishSapphire:feat/arc-build-system

Conversation

@BlueishSapphire
Copy link

@BlueishSapphire BlueishSapphire commented Mar 6, 2026

Description

This change causes CMake to build .arc files from the asset files in Minecraft.Client/Common/Media

Changes

Previous Behavior

CMake copied the existing MediaWindows64.arc from Minecraft.Client/Common/Media into the build directory

New Behavior

CMake builds MediaWindows64.arc from the asset files in Minecraft.Client/Common/Media (e.g. MainMenu1080.swf, languages.loc, etc)

Implementation

  • An arcconv.py script was written to convert between .arc and .zip. It was inspired by https://github.com/NessieHax/mc-arc-util.
  • A cmake/AssetSources.cmake file was created to list the assets belonging to each platform's arc bundle.
  • All platforms (PS3, PSVita, Orbis, Durango, Windows64) produce (roughly) identical files to the ones included in the original arc bundles.
  • cmake/CopyAssets.cmake defines targets (through configure_file, add_custom_command, add_custom_target) instead of just copying files every time a build happens. It also defines a make_media_archive function that zips the specified files and converts the zip into an arc bundle.
  • Some files from the original arc bundles were extracted into Minecraft.Client/Common/Media so that the build system could find them.

AI Use Disclosure

No LLMs were used in the writing of this code.

@codeHusky codeHusky marked this pull request as draft March 6, 2026 06:06
@codeHusky
Copy link
Collaborator

switched this to a draft for now due to ongoing discussion of this implementation on Discord

@GuglioIsStupid
Copy link
Contributor

Tested, I will admit I was very wrong

Fixes #588 and i'd argue is better than how robocopy and rsync did it

@codeHusky codeHusky marked this pull request as ready for review March 6, 2026 06:18
@BlueishSapphire BlueishSapphire force-pushed the feat/arc-build-system branch from 8d79905 to bbdb173 Compare March 6, 2026 07:09
@BlueishSapphire
Copy link
Author

Removed the old arc files and rebased off of 0469e982

@void2012
Copy link
Collaborator

void2012 commented Mar 6, 2026

Ready to merge?

@PortalG
Copy link
Contributor

PortalG commented Mar 6, 2026

Forewarning, file globbing issues will persist with the copy_tree_if_exists(...) current implementation. That was the main reason why Robocopy and rsync were used in the first place.

@BlueishSapphire
Copy link
Author

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

@BlueishSapphire
Copy link
Author

Could it have been this issue? https://stackoverflow.com/a/32412044

@PortalG
Copy link
Contributor

PortalG commented Mar 6, 2026

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.

@codeHusky
Copy link
Collaborator

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

  • Playing and loading unloading singleplayer
  • Playing and loading unloading in creative
  • Testing inside of dlc
  • Checking all of the menus for functionality
  • Make sure the title graphic changes haven’t been removed

@PortalG
Copy link
Contributor

PortalG commented Mar 6, 2026

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.

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.

5 participants