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

SCons: Ensure *all* generated files can be cleaned #90270

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Apr 5, 2024

Supercedes #90117, albeit through the exact opposite approach: ensuring all generated files are removed during cleanup. This was achieved by extending the write_file_if_needed function that already attached itself to all generic generation methods (ie: not tied to SCons) with a dedicated SCons environment. The only purpose of this environment is to declare the files as cleanable & to skip any file comparison/creation logic during cleanup.

Below compares behavior for an SCons clean followed by git clean. The difference between the two is exclusively the generated files not being present in the PR, having already been successfully cleaned out by SCons.

Live
Would remove .sconf_temp/
Would remove .scons_env.json
Would remove .scons_node_count
Would remove .sconsign5.dblite
Would remove __pycache__/
Would remove config.log
Would remove core/__pycache__/
Would remove core/disabled_classes.gen.h
Would remove core/extension/__pycache__/
Would remove core/input/__pycache__/
Would remove core/object/__pycache__/
Would remove core/script_encryption_key.gen.cpp
Would remove core/version_generated.gen.h
Would remove core/version_hash.gen.cpp
Would remove editor/__pycache__/
Would remove editor/doc_data_class_path.gen.h
Would remove editor/icons/__pycache__/
Would remove editor/register_exporters.gen.cpp
Would remove editor/themes/__pycache__/
Would remove main/__pycache__/
Would remove modules/__pycache__/
Would remove modules/astcenc/__pycache__/
Would remove modules/basis_universal/__pycache__/
Would remove modules/bmp/__pycache__/
Would remove modules/camera/__pycache__/
Would remove modules/csg/__pycache__/
Would remove modules/cvtt/__pycache__/
Would remove modules/dds/__pycache__/
Would remove modules/enet/__pycache__/
Would remove modules/etcpak/__pycache__/
Would remove modules/fbx/__pycache__/
Would remove modules/freetype/__pycache__/
Would remove modules/gdscript/__pycache__/
Would remove modules/glslang/__pycache__/
Would remove modules/gltf/__pycache__/
Would remove modules/gridmap/__pycache__/
Would remove modules/hdr/__pycache__/
Would remove modules/interactive_music/__pycache__/
Would remove modules/jpg/__pycache__/
Would remove modules/jsonrpc/__pycache__/
Would remove modules/ktx/__pycache__/
Would remove modules/lightmapper_rd/__pycache__/
Would remove modules/mbedtls/__pycache__/
Would remove modules/meshoptimizer/__pycache__/
Would remove modules/minimp3/__pycache__/
Would remove modules/mobile_vr/__pycache__/
Would remove modules/mono/__pycache__/
Would remove modules/msdfgen/__pycache__/
Would remove modules/multiplayer/__pycache__/
Would remove modules/navigation/__pycache__/
Would remove modules/noise/__pycache__/
Would remove modules/ogg/__pycache__/
Would remove modules/openxr/__pycache__/
Would remove modules/raycast/__pycache__/
Would remove modules/regex/__pycache__/
Would remove modules/register_module_types.gen.cpp
Would remove modules/squish/__pycache__/
Would remove modules/svg/__pycache__/
Would remove modules/text_server_adv/__pycache__/
Would remove modules/text_server_fb/__pycache__/
Would remove modules/tga/__pycache__/
Would remove modules/theora/__pycache__/
Would remove modules/tinyexr/__pycache__/
Would remove modules/upnp/__pycache__/
Would remove modules/vhacd/__pycache__/
Would remove modules/vorbis/__pycache__/
Would remove modules/webp/__pycache__/
Would remove modules/webrtc/__pycache__/
Would remove modules/websocket/__pycache__/
Would remove modules/webxr/__pycache__/
Would remove modules/xatlas_unwrap/__pycache__/
Would remove modules/zip/__pycache__/
Would remove platform/android/__pycache__/
Would remove platform/android/export/logo_svg.gen.h
Would remove platform/android/export/run_icon_svg.gen.h
Would remove platform/ios/__pycache__/
Would remove platform/ios/export/logo_svg.gen.h
Would remove platform/ios/export/run_icon_svg.gen.h
Would remove platform/linuxbsd/__pycache__/
Would remove platform/linuxbsd/export/logo_svg.gen.h
Would remove platform/linuxbsd/export/run_icon_svg.gen.h
Would remove platform/macos/__pycache__/
Would remove platform/macos/export/logo_svg.gen.h
Would remove platform/macos/export/run_icon_svg.gen.h
Would remove platform/register_platform_apis.gen.cpp
Would remove platform/web/__pycache__/
Would remove platform/web/export/logo_svg.gen.h
Would remove platform/web/export/run_icon_svg.gen.h
Would remove platform/windows/__pycache__/
Would remove platform/windows/export/logo_svg.gen.h
Would remove platform/windows/export/run_icon_svg.gen.h
Would remove scene/theme/__pycache__/
Would remove scene/theme/icons/__pycache__/
PR
Would remove .sconf_temp/
Would remove .scons_env.json
Would remove .sconsign5.dblite
Would remove __pycache__/
Would remove config.log
Would remove core/__pycache__/
Would remove core/extension/__pycache__/
Would remove core/input/__pycache__/
Would remove core/object/__pycache__/
Would remove editor/__pycache__/
Would remove editor/icons/__pycache__/
Would remove editor/themes/__pycache__/
Would remove main/__pycache__/
Would remove modules/__pycache__/
Would remove modules/astcenc/__pycache__/
Would remove modules/basis_universal/__pycache__/
Would remove modules/bmp/__pycache__/
Would remove modules/camera/__pycache__/
Would remove modules/csg/__pycache__/
Would remove modules/cvtt/__pycache__/
Would remove modules/dds/__pycache__/
Would remove modules/enet/__pycache__/
Would remove modules/etcpak/__pycache__/
Would remove modules/fbx/__pycache__/
Would remove modules/freetype/__pycache__/
Would remove modules/gdscript/__pycache__/
Would remove modules/glslang/__pycache__/
Would remove modules/gltf/__pycache__/
Would remove modules/gridmap/__pycache__/
Would remove modules/hdr/__pycache__/
Would remove modules/interactive_music/__pycache__/
Would remove modules/jpg/__pycache__/
Would remove modules/jsonrpc/__pycache__/
Would remove modules/ktx/__pycache__/
Would remove modules/lightmapper_rd/__pycache__/
Would remove modules/mbedtls/__pycache__/
Would remove modules/meshoptimizer/__pycache__/
Would remove modules/minimp3/__pycache__/
Would remove modules/mobile_vr/__pycache__/
Would remove modules/mono/__pycache__/
Would remove modules/msdfgen/__pycache__/
Would remove modules/multiplayer/__pycache__/
Would remove modules/navigation/__pycache__/
Would remove modules/noise/__pycache__/
Would remove modules/ogg/__pycache__/
Would remove modules/openxr/__pycache__/
Would remove modules/raycast/__pycache__/
Would remove modules/regex/__pycache__/
Would remove modules/squish/__pycache__/
Would remove modules/svg/__pycache__/
Would remove modules/text_server_adv/__pycache__/
Would remove modules/text_server_fb/__pycache__/
Would remove modules/tga/__pycache__/
Would remove modules/theora/__pycache__/
Would remove modules/tinyexr/__pycache__/
Would remove modules/upnp/__pycache__/
Would remove modules/vhacd/__pycache__/
Would remove modules/vorbis/__pycache__/
Would remove modules/webp/__pycache__/
Would remove modules/webrtc/__pycache__/
Would remove modules/websocket/__pycache__/
Would remove modules/webxr/__pycache__/
Would remove modules/xatlas_unwrap/__pycache__/
Would remove modules/zip/__pycache__/
Would remove platform/android/__pycache__/
Would remove platform/ios/__pycache__/
Would remove platform/linuxbsd/__pycache__/
Would remove platform/macos/__pycache__/
Would remove platform/web/__pycache__/
Would remove platform/windows/__pycache__/
Would remove scene/theme/__pycache__/
Would remove scene/theme/icons/__pycache__/

@fire
Copy link
Member

fire commented Apr 6, 2024

I endorse this but I wasn't able to test it.

Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Looks great!

@akien-mga akien-mga modified the milestones: 4.x, 4.3 Apr 6, 2024
@akien-mga akien-mga merged commit c10f934 into godotengine:master Apr 6, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants