Skip to contentSkip to conversation

kbuild: rust: make `*.long-type-*.txt` a target for cleanup

PATCH Applied Joel Kamminga 3 participants 8 messages May 30 – Jun 2

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 kbuild: rust: make `*.long-type-*.txt` a target for cleanup

This cleans up files generated by rustc compiler in the case of an error containing an excessively long type name that doesn't fit in a single line. Such types appear relatively frequently so the risk of generating these files certainly exists. These files are purely compiler artifacts and are not created intentionally by the build system. They should be added to the clean target to stop from cluttering up the source tree.

---
 Makefile | 1 +
 1 file changed, 1 insertion(+)
Makefile +1 -0
index 9f59598d3a08..3a265e7e3347 100644
@@ -2164,6 +2164,7 @@ clean: $(clean-dirs)
 		-o -name '*.c.[012]*.*' \
 		-o -name '*.ll' \
 		-o -name '*.gcno' \
+		-o -name '*.long-type-*.txt' \
 		\) -type f -print \
 		-o -name '.tmp_*' -print \
 		| xargs rm -rf
Signature · 1 line
2.54.0
#1 lore raw
Quoted 9 lines · Joel Kamminga

This cleans up files generated by rustc compiler in the case of an error containing an excessively long type name that doesn't fit in a single line. Such types appear relatively frequently so the risk of generating these files certainly exists. These files are purely compiler artifacts and are not created intentionally by the build system. They should be added to the clean target to stop from cluttering up the source tree.

Quoted 4 lines

---

In general, please add a changelog after the --- line. Otherwise, reviewers need to manually inspect the patch to see what has changed, if anything.

For instance, I see you changed the title, but the commit message seems identical. Was there a reason to not change it?

Thanks!

Cheers,
Miguel

#2 lore raw
Quoted 6 lines · Miguel Ojeda

In general, please add a changelog after the --- line. Otherwise, reviewers need to manually inspect the patch to see what has changed, if anything.

For instance, I see you changed the title, but the commit message seems identical. Was there a reason to not change it?

Hi!

Thanks for the comments and tips. Just for future reference for myself, in regards to applying changes strictly to the metadata of the patch (i.e. adding a changelog but leaving the actual code unchanged), is it preferred to just resend the same version of the patch with the changelog added instead of creating a whole new version? That was the impression I got reading through some earlier patches, but seeing as I've been creating new patch versions and haven't been told to do otherwise, I figured I'd double check.

Thanks,

Joel

#3 lore raw
Quoted 9 lines · Joel Kamminga

Thanks for the comments and tips. Just for future reference for myself, in regards to applying changes strictly to the metadata of the patch (i.e. adding a changelog but leaving the actual code unchanged), is it preferred to just resend the same version of the patch with the changelog added instead of creating a whole new version? That was the impression I got reading through some earlier patches, but seeing as I've been creating new patch versions and haven't been told to do otherwise, I figured I'd double check.

Good question!

If you forgot something small in the patch, especially if it is something like a typo or a missed changelog or similar, it is usually simpler to just reply to your patch and mention/quote the place to be fixed.

That avoids a whole new version for very small changes, while making everyone aware of the correction. So if a maintainer applies the patch earlier than the next version is sent, they can fix it on the fly.

Now, of course, sending a new version can make life simpler for maintainers, because they can just apply the new version without having to manually handle those bits (which can introduce mistakes on their own). This applies to things that end up in the commit, so it doesn't matter for e.g. the changelog.

However, sending too many versions also has overhead for everyone (the emails on their own, the tracking of each version, possible parallel discussions in different versions, possible feedback on the previous version...), which is why it is all a balance, and it is usually recommended to wait about a week or two before resends.

I hope that helps!

Cheers,
Miguel

#4 lore raw
In reply to Joel Kamminga
Quoted 8 lines · Joel Kamminga

This cleans up files generated by rustc compiler in the case of an error containing an excessively long type name that doesn't fit in a single line. Such types appear relatively frequently so the risk of generating these files certainly exists. These files are purely compiler artifacts and are not created intentionally by the build system. They should be added to the clean target to stop from cluttering up the source tree.

Quoted 4 lines

---

CHANGELOG:

Changes since v2 (https://lore.kernel.org/linux-kbuild/[email protected]/):
- Change commit title to be more imperative and more heavily scoped
'kbuild: clean *.long-type-*.txt files' -> 'kbuild: rust: make *.long-type-*.txt a target for cleanup'

Changes since v1 (https://lore.kernel.org/linux-kbuild/[email protected]/):
- Replace Reported-by tag with a Suggested-by and Link tag to reference back to the related GitHub issue

maintainer Acked-by
#5 lore raw
Quoted 14 lines · Joel Kamminga
Quoted 8 lines · Joel Kamminga

This cleans up files generated by rustc compiler in the case of an error containing an excessively long type name that doesn't fit in a single line. Such types appear relatively frequently so the risk of generating these files certainly exists. These files are purely compiler artifacts and are not created intentionally by the build system. They should be added to the clean target to stop from cluttering up the source tree.

Quoted 4 lines

---

Quoted 6 lines

CHANGELOG:

Changes since v2 (https://lore.kernel.org/linux-kbuild/[email protected]/):
- Change commit title to be more imperative and more heavily scoped
'kbuild: clean *.long-type-*.txt files' -> 'kbuild: rust: make *.long-type-*.txt a target for cleanup'

Not that I think it is worth resending over but I personally find the "clean '...' files" title easier to understand than the "make '...' a target for cleanup".

If Miguel wants to take this via the Rust tree:

Otherwise, I can take it for Kbuild. I don't have a preference and I doubt there will be a conflict in this area in the next couple of weeks.

Quoted 3 lines

Changes since v1 (https://lore.kernel.org/linux-kbuild/[email protected]/):
- Replace Reported-by tag with a Suggested-by and Link tag to reference back to the related GitHub issue

Signature · 2 lines
Cheers,
Nathan
#6 lore raw
Quoted 4 lines · Nathan Chancellor

Not that I think it is worth resending over but I personally find the "clean '...' files" title easier to understand than the "make '...' a target for cleanup".

Agreed, I can take it and use that title (with the kbuild: rust: prefix mentioned in v2).

Thanks for the tag!

Cheers,
Miguel

Applied
#7 lore raw
In reply to Joel Kamminga
Quoted 9 lines · Joel Kamminga

This cleans up files generated by rustc compiler in the case of an error containing an excessively long type name that doesn't fit in a single line. Such types appear relatively frequently so the risk of generating these files certainly exists. These files are purely compiler artifacts and are not created intentionally by the build system. They should be added to the clean target to stop from cluttering up the source tree.

Quoted 3 lines

Applied to rust-next -- thanks everyone!

[ Reworded and linked to the previous related commit. - Miguel ]

Joel: please check the rewording.

Cheers,
Miguel