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

Display the build date in the editor and when starting the engine #59247

Merged
merged 1 commit into from
Feb 27, 2024

Conversation

Calinou
Copy link
Member

@Calinou Calinou commented Mar 17, 2022

This can be used to quickly see how recent a development build is, without having to look up the commit date manually. When juggling around with various builds (e.g. for benchmarking), this can also be used to ensure that you're actually running the binary you intended to run.

The date stored is the date of the Git commit that is built, not the current date at the time of building the binary. This ensures binaries can remain reproducible.

The version timestamp can be accessed using the timestamp key of the Engine.get_version_info() return value.

I've tested all possible scenarios and they all build successfully:

  • git in PATH, .git/ folder present (the only scenario in which VERSION_TIMESTAMP is not 0).
  • git not in PATH, git/ folder present.
  • git in PATH, .git/ folder not present.
  • git not in PATH, git/ folder not present.

Preview

$ godot --quit
Godot Engine v4.0.alpha.custom_build.f78de4d1a (2022-03-12 02:35:20 UTC) - https://godotengine.org
Vulkan API 1.2.189 - Using Vulkan Device #0: NVIDIA - NVIDIA GeForce GTX 1080

core/version.h Outdated Show resolved Hide resolved
doc/classes/Engine.xml Outdated Show resolved Hide resolved
editor/project_manager.cpp Show resolved Hide resolved
@Calinou Calinou force-pushed the editor-display-build-date branch 2 times, most recently from 5b718ac to 082dad5 Compare March 17, 2022 23:27
@YuriSizov YuriSizov modified the milestones: 4.0, 4.1 Feb 9, 2023
@YuriSizov YuriSizov modified the milestones: 4.1, 4.2 Jun 14, 2023
@AThousandShips AThousandShips modified the milestones: 4.2, 4.3 Oct 26, 2023
@Calinou Calinou force-pushed the editor-display-build-date branch 2 times, most recently from 34a6b50 to 945b26d Compare January 11, 2024 00:30
Copy link
Contributor

@Mickeon Mickeon left a comment

Choose a reason for hiding this comment

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

This could use a rebase, somehow. It's a shame it has to be on the backburner and be rebased for so long. Perhaps it's just... no interest at all?

@Calinou Calinou requested review from a team as code owners February 26, 2024 22:53
Comment on lines +2488 to +2489
// Don't use rich formatting to prevent ANSI escape codes from being written to log files.
print_header(false);
Copy link
Member Author

Choose a reason for hiding this comment

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

This is a workaround for #36252 (comment), which we could remove once we have support for stripping ANSI escape codes in RotatedFileLogger.

@Calinou
Copy link
Member Author

Calinou commented Feb 26, 2024

Rebased and tested again, it works as expected.

editor/editor_about.cpp Outdated Show resolved Hide resolved
Copy link
Member

@KoBeWi KoBeWi left a comment

Choose a reason for hiding this comment

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

The implementation looks ok.

@Mickeon
Copy link
Contributor

Mickeon commented Feb 27, 2024

Needs to be rebased once more for the Engine docs rework on that part specifically.

doc/classes/Engine.xml Outdated Show resolved Hide resolved
This can be used to quickly see how recent a development build is,
without having to look up the commit date manually.
When juggling around with various builds (e.g. for benchmarking),
this can also be used to ensure that you're actually running the
binary you intended to run.

The date stored is the date of the Git commit that is built, not
the current date at the time of building the binary. This ensures
binaries can remain reproducible.

The version timestamp can be accessed using the `timestamp` key
of the `Engine.get_version_info()` return value.
@akien-mga akien-mga merged commit 1aa8e91 into godotengine:master Feb 27, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@Calinou Calinou deleted the editor-display-build-date branch March 12, 2024 16:31
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.

7 participants