-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Conversation
*.gen.*
files during cleanup*.gen.[h|cpp|inc]
files during cleanup
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 |
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. |
Because the source files are targets of generation they won't be, but I can sense the appeal of working for the common case. |
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.
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
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? |
@Calinou Live
PR
From these, we can gather a few things: firstly, which specific generated files were already not getting cleaned:
Second, that I cannot replicate the issue of
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
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. |
I personally tend to use From what I read this was already not fully effective? The alternative is |
The reason |
Closed in favor of #90270 |
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 withNoClean
, ensuring the generated files will persist after a cleanup while otherwise behaving identically.