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: Ignore *.gen.[h|cpp|inc] files during cleanup #90117

Closed
wants to merge 1 commit into from

Conversation

Repiteo
Copy link
Contributor

@Repiteo Repiteo commented Apr 1, 2024

When using --clean in a local repo, it's done with the intent of clearing out stray object files; so it can be annoying for build-agnostic generated files to also be removed in the process. Some of these files are already skipped during cleanup because they don't invoke SCons directly, but otherwise they will always be removed. This PR addresses this mild annoyance by wrapping any relevant *.gen.* SCons actions with NoClean, ensuring the generated files will persist after a cleanup while otherwise behaving identically.

@Repiteo Repiteo requested review from a team as code owners April 1, 2024 20:53
@Repiteo Repiteo changed the title SCons: Ignore *.gen.* files during cleanup SCons: Ignore *.gen.[h|cpp|inc] files during cleanup Apr 1, 2024
@Calinou Calinou added this to the 4.x milestone Apr 1, 2024
@fire
Copy link
Member

fire commented Apr 1, 2024

Seems like documentation will need to be amended in the case where .gen.cpp files are outdated in major version releases to use git clean -fxd

@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 1, 2024

Wouldn't be necessary; the files are still rebuilt like normal if their dependencies change. The only thing this PR would change is making it so they don't get removed during cleanup.

@fire
Copy link
Member

fire commented Apr 2, 2024

Because the source files are targets of generation they won't be, but I can sense the appeal of working for the common case.

Copy link
Member

@Calinou Calinou left a comment

Choose a reason for hiding this comment

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

Tested locally, it mostly works as expected.

Some object files remain after using scons --clean target=<target> (with <target> being editor, template_debug or template_release):

$ git clean -dfXi | grep "\.o"
  drivers/vulkan/vulkan_context.linuxbsd.editor.x86_64.o
  modules/openxr/extensions/openxr_fb_passthrough_extension_wrapper.linuxbsd.editor.x86_64.o
  modules/openxr/extensions/openxr_opengl_extension.linuxbsd.editor.x86_64.o
  modules/openxr/extensions/openxr_vulkan_extension.linuxbsd.editor.x86_64.o
  platform/linuxbsd/x11/vulkan_context_x11.linuxbsd.editor.x86_64.o
  servers/native_menu.linuxbsd.editor.x86_64.o
  servers/native_menu.linuxbsd.template_release.x86_64.o
  thirdparty/basis_universal/encoder/jpgd.linuxbsd.editor.x86_64.o
  thirdparty/etcpak/ProcessRgtc.linuxbsd.editor.x86_64.o
  thirdparty/msdfgen/core/SignedDistance.linuxbsd.editor.x86_64.o
  thirdparty/msdfgen/core/Vector2.linuxbsd.editor.x86_64.o

Complete list of remaining files:

$ git clean -dfXi
  .sconf_temp/
  .scons_env.json
  .scons_node_count
  .sconsign5.dblite
  __pycache__/
  bin/
  config.log
  core/__pycache__/
  core/authors.gen.h
  core/crypto/scu/
  core/debugger/scu/
  core/disabled_classes.gen.h
  core/donors.gen.h
  core/extension/__pycache__/
  core/extension/ext_wrappers.gen.inc
  core/extension/gdextension_interface_dump.gen.h
  core/extension/scu/
  core/input/__pycache__/
  core/input/default_controller_mappings.gen.cpp
  core/input/scu/
  core/io/certs_compressed.gen.h
  core/io/scu/
  core/license.gen.h
  core/math/scu/
  core/object/__pycache__/
  core/object/gdvirtual.gen.inc
  core/object/scu/
  core/os/scu/
  core/script_encryption_key.gen.cpp
  core/scu/
  core/string/scu/
  core/variant/scu/
  core/version_generated.gen.h
  core/version_hash.gen.cpp
  drivers/gles3/shaders/canvas.glsl.gen.h
  drivers/gles3/shaders/canvas_occlusion.glsl.gen.h
  drivers/gles3/shaders/canvas_sdf.glsl.gen.h
  drivers/gles3/shaders/copy.glsl.gen.h
  drivers/gles3/shaders/cubemap_filter.glsl.gen.h
  drivers/gles3/shaders/effects/copy.glsl.gen.h
  drivers/gles3/shaders/effects/glow.glsl.gen.h
  drivers/gles3/shaders/effects/post.glsl.gen.h
  drivers/gles3/shaders/particles.glsl.gen.h
  drivers/gles3/shaders/particles_copy.glsl.gen.h
  drivers/gles3/shaders/scene.glsl.gen.h
  drivers/gles3/shaders/skeleton.glsl.gen.h
  drivers/gles3/shaders/sky.glsl.gen.h
  drivers/png/scu/
  drivers/unix/scu/
  drivers/vulkan/vulkan_context.linuxbsd.editor.x86_64.o
  editor/__pycache__/
  editor/builtin_fonts.gen.h
  editor/debugger/debug_adapter/scu/
  editor/debugger/scu/
  editor/doc_data_class_path.gen.h
  editor/doc_data_compressed.gen.h
  editor/doc_translations.gen.h
  editor/editor_icons.gen.h
  editor/editor_translations.gen.h
  editor/export/scu/
  editor/extractable_translations.gen.h
  editor/gui/scu/
  editor/icons/__pycache__/
  editor/import/3d/scu/
  editor/import/scu/
  editor/plugins/gizmos/scu/
  editor/plugins/scu/
  editor/plugins/tiles/scu/
  editor/property_translations.gen.h
  editor/register_exporters.gen.cpp
  editor/scu/
  editor/themes/__pycache__/
  editor/themes/builtin_fonts.gen.h
  editor/themes/editor_icons.gen.h
  main/__pycache__/
  main/app_icon.gen.h
  main/splash.gen.h
  modules/__pycache__/
  modules/astcenc/__pycache__/
  modules/basis_universal/__pycache__/
  modules/bmp/__pycache__/
  modules/camera/__pycache__/
  modules/csg/__pycache__/
  modules/csg/scu/
  modules/cvtt/__pycache__/
  modules/dds/__pycache__/
  modules/enet/__pycache__/
  modules/etcpak/__pycache__/
  modules/fbx/__pycache__/
  modules/freetype/__pycache__/
  modules/gdscript/__pycache__/
  modules/gdscript/editor/script_templates/templates.gen.h
  modules/gdscript/editor/scu/
  modules/gdscript/language_server/scu/
  modules/gdscript/scu/
  modules/glslang/__pycache__/
  modules/gltf/__pycache__/
  modules/gltf/editor/scu/
  modules/gltf/extensions/physics/scu/
  modules/gltf/extensions/scu/
  modules/gltf/scu/
  modules/gltf/structures/scu/
  modules/gridmap/__pycache__/
  modules/gridmap/scu/
  modules/hdr/__pycache__/
  modules/interactive_music/__pycache__/
  modules/jpg/__pycache__/
  modules/jsonrpc/__pycache__/
  modules/ktx/__pycache__/
  modules/lightmapper_rd/__pycache__/
  modules/lightmapper_rd/lm_blendseams.glsl.gen.h
  modules/lightmapper_rd/lm_compute.glsl.gen.h
  modules/lightmapper_rd/lm_raster.glsl.gen.h
  modules/mbedtls/__pycache__/
  modules/meshoptimizer/__pycache__/
  modules/minimp3/__pycache__/
  modules/mobile_vr/__pycache__/
  modules/modules_enabled.gen.h
  modules/mono/__pycache__/
  modules/msdfgen/__pycache__/
  modules/multiplayer/__pycache__/
  modules/multiplayer/editor/scu/
  modules/multiplayer/scu/
  modules/navigation/__pycache__/
  modules/navigation/scu/
  modules/noise/__pycache__/
  modules/ogg/__pycache__/
  modules/openxr/__pycache__/
  modules/openxr/action_map/scu/
  modules/openxr/editor/scu/
  modules/openxr/extensions/openxr_fb_passthrough_extension_wrapper.linuxbsd.editor.x86_64.o
  modules/openxr/extensions/openxr_opengl_extension.linuxbsd.editor.x86_64.o
  modules/openxr/extensions/openxr_vulkan_extension.linuxbsd.editor.x86_64.o
  modules/openxr/scu/
  modules/raycast/__pycache__/
  modules/regex/__pycache__/
  modules/register_module_types.gen.cpp
  modules/squish/__pycache__/
  modules/stgS2kzX
  modules/svg/__pycache__/
  modules/text_server_adv/__pycache__/
  modules/text_server_fb/__pycache__/
  modules/tga/__pycache__/
  modules/theora/__pycache__/
  modules/tinyexr/__pycache__/
  modules/upnp/__pycache__/
  modules/vhacd/__pycache__/
  modules/vorbis/__pycache__/
  modules/webp/__pycache__/
  modules/webrtc/__pycache__/
  modules/webrtc/scu/
  modules/websocket/__pycache__/
  modules/websocket/scu/
  modules/webxr/__pycache__/
  modules/xatlas_unwrap/__pycache__/
  modules/zip/__pycache__/
  platform/android/__pycache__/
  platform/android/export/logo_svg.gen.h
  platform/android/export/run_icon_svg.gen.h
  platform/android/export/scu/
  platform/ios/__pycache__/
  platform/ios/export/logo_svg.gen.h
  platform/ios/export/run_icon_svg.gen.h
  platform/ios/export/scu/
  platform/linuxbsd/__pycache__/
  platform/linuxbsd/export/logo_svg.gen.h
  platform/linuxbsd/export/run_icon_svg.gen.h
  platform/linuxbsd/export/scu/
  platform/linuxbsd/x11/vulkan_context_x11.linuxbsd.editor.x86_64.o
  platform/macos/__pycache__/
  platform/macos/export/logo_svg.gen.h
  platform/macos/export/run_icon_svg.gen.h
  platform/macos/export/scu/
  platform/register_platform_apis.gen.cpp
  platform/web/__pycache__/
  platform/web/export/logo_svg.gen.h
  platform/web/export/run_icon_svg.gen.h
  platform/web/export/scu/
  platform/windows/__pycache__/
  platform/windows/export/logo_svg.gen.h
  platform/windows/export/run_icon_svg.gen.h
  platform/windows/export/scu/
  scene/2d/physics/joints/scu/
  scene/2d/physics/scu/
  scene/2d/scu/
  scene/3d/physics/joints/scu/
  scene/3d/physics/scu/
  scene/3d/scu/
  scene/animation/scu/
  scene/gui/scu/
  scene/main/scu/
  scene/resources/2d/scu/
  scene/resources/3d/scu/
  scene/resources/scu/
  scene/theme/__pycache__/
  scene/theme/default_font.gen.h
  scene/theme/default_theme_icons.gen.h
  scene/theme/icons/__pycache__/
  servers/audio/effects/scu/
  servers/audio/scu/
  servers/native_menu.linuxbsd.editor.x86_64.o
  servers/native_menu.linuxbsd.template_release.x86_64.o
  servers/physics_2d/scu/
  servers/physics_3d/joints/scu/
  servers/physics_3d/scu/
  servers/rendering/renderer_rd/effects/scu/
  servers/rendering/renderer_rd/environment/scu/
  servers/rendering/renderer_rd/scu/
  servers/rendering/renderer_rd/shaders/blit.glsl.gen.h
  servers/rendering/renderer_rd/shaders/canvas.glsl.gen.h
  servers/rendering/renderer_rd/shaders/canvas_occlusion.glsl.gen.h
  servers/rendering/renderer_rd/shaders/canvas_sdf.glsl.gen.h
  servers/rendering/renderer_rd/shaders/cluster_debug.glsl.gen.h
  servers/rendering/renderer_rd/shaders/cluster_render.glsl.gen.h
  servers/rendering/renderer_rd/shaders/cluster_store.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/blur_raster.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/copy.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/copy_to_fb.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/cube_to_dp.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler_raster.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/cubemap_filter.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/cubemap_filter_raster.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/cubemap_roughness.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/cubemap_roughness_raster.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_accumulate_pass.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_autogen_reactive_pass.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_compute_luminance_pyramid_pass.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_depth_clip_pass.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_lock_pass.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_rcas_pass.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_reconstruct_previous_depth_pass.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_tcr_autogen_pass.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/fsr_upscale.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/luminance_reduce.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/luminance_reduce_raster.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/motion_vectors.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/resolve.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/roughness_limiter.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/screen_space_reflection.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_filter.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_scale.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/shadow_frustum.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/sort.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/specular_merge.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ss_effects_downsample.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ssao.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ssao_blur.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ssao_importance_map.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ssao_interleave.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ssil.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ssil_blur.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ssil_importance_map.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/ssil_interleave.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/subsurface_scattering.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/taa_resolve.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/tonemap.glsl.gen.h
  servers/rendering/renderer_rd/shaders/effects/vrs.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/gi.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/sdfgi_debug.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/sdfgi_debug_probes.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/sdfgi_direct_light.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/sdfgi_integrate.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/sdfgi_preprocess.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/sky.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/voxel_gi.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/voxel_gi_debug.glsl.gen.h
  servers/rendering/renderer_rd/shaders/environment/voxel_gi_sdf.glsl.gen.h
  servers/rendering/renderer_rd/shaders/forward_clustered/best_fit_normal.glsl.gen.h
  servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl.gen.h
  servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl.gen.h
  servers/rendering/renderer_rd/shaders/giprobe_write.glsl.gen.h
  servers/rendering/renderer_rd/shaders/particles.glsl.gen.h
  servers/rendering/renderer_rd/shaders/particles_copy.glsl.gen.h
  servers/rendering/renderer_rd/shaders/skeleton.glsl.gen.h
  servers/rendering/renderer_rd/storage_rd/scu/
  servers/rendering/scu/
  servers/rendering/storage/scu/
  servers/scu/
  thirdparty/basis_universal/encoder/jpgd.linuxbsd.editor.x86_64.o
  thirdparty/etcpak/ProcessRgtc.linuxbsd.editor.x86_64.o
  thirdparty/glslang/OGLCompilersDLL/
  thirdparty/icu4c/icudata.gen.h
  thirdparty/msdfgen/core/SignedDistance.linuxbsd.editor.x86_64.o
  thirdparty/msdfgen/core/Vector2.linuxbsd.editor.x86_64.o

@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 2, 2024

Interesting that some object files are persisting, this shouldn't have done anything to affect that. I was testing on Windows though, so it's possibly Linux-specific somehow?

@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 2, 2024

@Calinou
Did some Linux tests to see if anything is actually awry there; here's the two different outcomes from fresh builds/cleans of both:

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 .scons_node_count
Would remove .sconsign5.dblite
Would remove __pycache__/
Would remove config.log
Would remove core/__pycache__/
Would remove core/authors.gen.h
Would remove core/disabled_classes.gen.h
Would remove core/donors.gen.h
Would remove core/extension/__pycache__/
Would remove core/extension/ext_wrappers.gen.inc
Would remove core/extension/gdextension_interface_dump.gen.h
Would remove core/input/__pycache__/
Would remove core/input/default_controller_mappings.gen.cpp
Would remove core/io/certs_compressed.gen.h
Would remove core/license.gen.h
Would remove core/object/__pycache__/
Would remove core/object/gdvirtual.gen.inc
Would remove core/script_encryption_key.gen.cpp
Would remove core/version_generated.gen.h
Would remove core/version_hash.gen.cpp
Would remove drivers/gles3/shaders/canvas.glsl.gen.h
Would remove drivers/gles3/shaders/canvas_occlusion.glsl.gen.h
Would remove drivers/gles3/shaders/canvas_sdf.glsl.gen.h
Would remove drivers/gles3/shaders/cubemap_filter.glsl.gen.h
Would remove drivers/gles3/shaders/effects/copy.glsl.gen.h
Would remove drivers/gles3/shaders/effects/glow.glsl.gen.h
Would remove drivers/gles3/shaders/effects/post.glsl.gen.h
Would remove drivers/gles3/shaders/particles.glsl.gen.h
Would remove drivers/gles3/shaders/particles_copy.glsl.gen.h
Would remove drivers/gles3/shaders/scene.glsl.gen.h
Would remove drivers/gles3/shaders/skeleton.glsl.gen.h
Would remove drivers/gles3/shaders/sky.glsl.gen.h
Would remove editor/__pycache__/
Would remove editor/doc_data_class_path.gen.h
Would remove editor/doc_data_compressed.gen.h
Would remove editor/doc_translations.gen.h
Would remove editor/editor_translations.gen.h
Would remove editor/extractable_translations.gen.h
Would remove editor/icons/__pycache__/
Would remove editor/property_translations.gen.h
Would remove editor/register_exporters.gen.cpp
Would remove editor/themes/__pycache__/
Would remove editor/themes/builtin_fonts.gen.h
Would remove editor/themes/editor_icons.gen.h
Would remove main/__pycache__/
Would remove main/app_icon.gen.h
Would remove main/splash.gen.h
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/gdscript/editor/script_templates/templates.gen.h
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/lightmapper_rd/lm_blendseams.glsl.gen.h
Would remove modules/lightmapper_rd/lm_compute.glsl.gen.h
Would remove modules/lightmapper_rd/lm_raster.glsl.gen.h
Would remove modules/mbedtls/__pycache__/
Would remove modules/meshoptimizer/__pycache__/
Would remove modules/minimp3/__pycache__/
Would remove modules/mobile_vr/__pycache__/
Would remove modules/modules_enabled.gen.h
Would remove modules/modules_tests.gen.h
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/default_font.gen.h
Would remove scene/theme/default_theme_icons.gen.h
Would remove scene/theme/icons/__pycache__/
Would remove servers/rendering/renderer_rd/shaders/blit.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/canvas.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/canvas_occlusion.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/canvas_sdf.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/cluster_debug.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/cluster_render.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/cluster_store.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/blur_raster.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/bokeh_dof.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/bokeh_dof_raster.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/copy.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/copy_to_fb.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/cube_to_dp.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/cubemap_downsampler_raster.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/cubemap_filter.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/cubemap_filter_raster.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/cubemap_roughness.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/cubemap_roughness_raster.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_accumulate_pass.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_autogen_reactive_pass.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_compute_luminance_pyramid_pass.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_depth_clip_pass.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_lock_pass.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_rcas_pass.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_reconstruct_previous_depth_pass.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr2/fsr2_tcr_autogen_pass.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/fsr_upscale.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/luminance_reduce.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/luminance_reduce_raster.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/motion_vectors.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/resolve.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/roughness_limiter.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/screen_space_reflection.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_filter.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/screen_space_reflection_scale.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/shadow_frustum.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/sort.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/specular_merge.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ss_effects_downsample.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ssao.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ssao_blur.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ssao_importance_map.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ssao_interleave.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ssil.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ssil_blur.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ssil_importance_map.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/ssil_interleave.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/subsurface_scattering.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/taa_resolve.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/tonemap.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/effects/vrs.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/gi.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/sdfgi_debug.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/sdfgi_debug_probes.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/sdfgi_direct_light.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/sdfgi_integrate.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/sdfgi_preprocess.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/sky.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/volumetric_fog.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/voxel_gi.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/voxel_gi_debug.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/environment/voxel_gi_sdf.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/forward_clustered/best_fit_normal.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/giprobe_write.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/particles.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/particles_copy.glsl.gen.h
Would remove servers/rendering/renderer_rd/shaders/skeleton.glsl.gen.h
Would remove thirdparty/icu4c/icudata.gen.h

From these, we can gather a few things: firstly, which specific generated files were already not getting cleaned:

core/disabled_classes.gen.h
core/script_encryption_key.gen.cpp
core/version_generated.gen.h
core/version_hash.gen.cpp
editor/doc_data_class_path.gen.h
editor/register_exporters.gen.cpp
modules/register_module_types.gen.cpp
platform/android/export/logo_svg.gen.h
platform/android/export/run_icon_svg.gen.h
platform/ios/export/logo_svg.gen.h
platform/ios/export/run_icon_svg.gen.h
platform/linuxbsd/export/logo_svg.gen.h
platform/linuxbsd/export/run_icon_svg.gen.h
platform/macos/export/logo_svg.gen.h
platform/macos/export/run_icon_svg.gen.h
platform/register_platform_apis.gen.cpp
platform/web/export/logo_svg.gen.h
platform/web/export/run_icon_svg.gen.h
platform/windows/export/logo_svg.gen.h
platform/windows/export/run_icon_svg.gen.h

Second, that I cannot replicate the issue of .o files persisting. I think it's much more likely that those files were already persisting in that repo, as SCons seriously struggles to remove files it no longer is "aware" of.

@fire

Because the source files are targets of generation they won't be

I must be missing something, because this doesn't seem true at all. If I change any of the file dependencies for a generated file, the generated file will be rebuilt like normal. Neither setting the file to not be cleaned nor the fact that it compiles an object changes this. I verified this by tweaking gamecontrollerdb.txt, a dependency of default_controller_mappings.gen.cpp, and had this output:

...
scons: Building targets ...
[ 79%] Generating core\input\default_controller_mappings.gen.cpp ...
[ 79%] Compiling core\input\default_controller_mappings.gen.cpp ...
[ 80%] default_controller_mappings.gen.cpp
[ 83%] Linking Static Library core\core.windows.editor.dev.x86_64.lib ...
[ 86%] Linking Program bin\godot.windows.editor.dev.x86_64.exe ...
[ 97%] Building compilation database compile_commands.json
[ 99%] progress_finish(["progress_finish"], [])
[100%]    Creating library bin\godot.windows.editor.dev.x86_64.lib and object bin\godot.windows.editor.dev.x86_64.exp
[100%] Linking Program bin\godot.windows.editor.dev.x86_64.console.exe ...
[100%] scons: done building targets.

Anything outdated gets rebuilt as needed. Again, could just be totally misunderstanding the situation, but I can't see any reason that documentation would need to be updated, as this doesn't seem to actually be an issue in the first place.

@akien-mga
Copy link
Member

I personally tend to use --clean not just to remove object files, but to remove everything that was generated by SCons. Notably this is needed when optimizing the build system itself to see how long it takes to generate files, etc.

From what I read this was already not fully effective? The alternative is git clean -fxd but the main issue with that it that it removes everything, including IDE configuration files present in the local clone.

@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 4, 2024

The reason --clean doesn't remove everything is because of the way some files are currently generated; namely, they don't call to SCons directly. While I like keeping build-agnostic generated files, having them cleaned in a consistent manner makes sense. It'd be nice if SCons supported a way to force-clean files marked as "NoClean", but I don't believe such an option exists atm. I can setup an alternative PR that achieves exactly that, being an antithesis to this preserve-all implementation.

@Repiteo
Copy link
Contributor Author

Repiteo commented Apr 5, 2024

Closed in favor of #90270

@Repiteo Repiteo closed this Apr 5, 2024
@AThousandShips AThousandShips removed this from the 4.x milestone Apr 5, 2024
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.

5 participants