-
-
Notifications
You must be signed in to change notification settings - Fork 224
Can't build because version number has no commit hash #118
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
Comments
Thinking about it some more:
|
The problem is really that There is no reason per se to exclude such Godot versions, but as part of #107, I would like to provide a better story to match godot-rust versions to Godot ones. This will likely based on (pre-)release versions (
This is a nightmare for multiple reasons:
In my opinion, an ideal solution would include this information already in the original Nix package for Godot. There is a lot of value in providing the traceability where a build comes from. If no Git repository is used, they could store the meta-information in a separate file. Are you in contact with maintainers and could possibly report this? Unfortunately I don't use Nix myself. If we don't find a way, one thing I could do is allow such version strings, but always print a warning that the user themselves is responsible for ensuring compatibility. This is somewhat important because at the current phase, Godot includes breaking changes almost every week. There are a lot of compatibility problems being reported on the tracker, as such I'd like to reduce the surface for errors -- which is unfortunately infinite in the case that nothing is known about a Godot version. By the way, Beta 16 is outdated and will almost certainly not work with latest godot-rust |
Looking through the Godot repo, it might be sufficient to set the My suggestions were bad because I thought this was mostly about cache invalidation, sorry. I totally forgot about compatibility between library and godot versions. However, wouldn't it still make sense to separate version compatibility checks from cache invalidation? By this I mean rebuilding whenever the binary changes (relying on |
That's a good idea 👍 |
I've managed to patch the nixpkgs Godot 4 build to output a sensible version (Edit: NixOS/nixpkgs#215829):
With this and the current gdextension master, I managed to successfully set up a small test project. Regarding the suggestion to warn if no hash is present but continuing the build:
At this point, it would probably make sense if I open a PR for further discussion. |
Stumbled upon the same issue. The nix patch is looking good. Thanks for tackling this @Garmelon! |
Let me document here how the version string is built up.
Putting it all together, the full string is:
|
Works fine for me now when using the undtable nix channel. Thanks everyone! @Garmelon does it solve your issue aswell? |
193: Rerun codegen if GODOT4_BIN changed r=Bromeon a=ttencate Brought up by `@Garmelon` on #118. Co-authored-by: Thomas ten Cate <[email protected]>
I'm trying to use the Godot 4 beta 16 that's currently in nixpkgs. Its
godot --version
is4.0.beta.custom_build
. However, the version regex ingodot-codegen
expects a commit hash(?) following the last element if it is notofficial
:https://github.com/godot-rust/gdextension/blob/b2f75f8c4b6725c77eccbb7fb637d4570562ed63/godot-codegen/src/godot_version.rs#L33
https://github.com/godot-rust/gdextension/blob/b2f75f8c4b6725c77eccbb7fb637d4570562ed63/godot-codegen/src/godot_version.rs#L80
My guess is that the nixpkgs godot version is not built within its git repo, but instead just within a directory containing all the source files, so there's no commit hash to embed in the version number.
From what I can tell, this is used to determine whether the godot version changed and things need to be regenerated because its API may have changed. While an occasional
cargo clean
isn't that bad, allowing custom_build without commit hash may cause hard-to-track-down bugs for people unaware of this mechanic. On the other hand, even checking the commit hash is not sufficient if godot was built from a dirty working tree, though this is probably a fairly rare situation.One possible solution might be to check a hash of the godot binary instead of or in addition to the version number? The version number would no longer require a commit hash to ensur proper rebuilding. I assume this hash would only be checked when cargo detects that the godot binary has changed thanks to
cargo:rerun-if-changed
? This should also work for a custom godot compiled from a dirty working tree.Another solution would be to somehow patch the nixpkgs godot build to include the commit hash.
The text was updated successfully, but these errors were encountered: