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

Fix crash on GDNative API json generator exit. #48081

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

bruvzg
Copy link
Member

@bruvzg bruvzg commented Apr 22, 2021

Fixes #48020

Relevant for 3.x (3.x code have only the first if with exit(0);, but it is exactly same).

Bugsquad edit: Fixes #36582.

@bruvzg bruvzg added bug topic:gdextension crash cherrypick:3.x Considered for cherry-picking into a future 3.x release labels Apr 22, 2021
@bruvzg bruvzg added this to the 4.0 milestone Apr 22, 2021
@bruvzg bruvzg requested a review from a team as a code owner April 22, 2021 07:26
@bruvzg
Copy link
Member Author

bruvzg commented Apr 22, 2021

For the reference it's an identical fix to the one done for the Mono API generator (see #46307, also macOS crash, caused by multi-threading rewrite).

@akien-mga akien-mga merged commit 77a876c into godotengine:master Apr 22, 2021
@akien-mga
Copy link
Member

Thanks!

@bruvzg bruvzg deleted the fix_api_gen_crash branch April 22, 2021 07:49
@akien-mga
Copy link
Member

Cherry-picked for 3.4.

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Apr 22, 2021
@akien-mga
Copy link
Member

Cherry-picked for 3.3.1.

@Bromeon
Copy link
Contributor

Bromeon commented Dec 21, 2021

@akien-mga: Thanks for the clarification!
Your edit in the initial post accidentally has a link to this PR, you probably meant to refer to issue 36582.

bors bot added a commit to godot-rust/gdnative that referenced this pull request Jan 8, 2022
838: Godot version check + workaround for API generation bug r=Bromeon a=Bromeon

As mentioned in #833, Godot versions < 3.3.1 were subject to [a bug](godotengine/godot#48081) that caused non-deterministic crashes during the command:
```
godot --gdnative-generate-json-api api.json
```

For users working with affected Godot versions (e.g. 3.2), this makes the feature flag `custom-godot` annoying to use, since they can't rely on the API generation to succeed -- let alone use it for automation/CI. This PR works around that by retrying the command up to 10 times (magic number). I changed the minimum supported Godot version in our own CI again to 3.2, meaning that if it _doesn't_ work, we have to suffer, too 😬

Additionally, this PR parses the Godot version and emits a meaningful error message if an unsupported version is detected (3.1 or 4.0).

Co-authored-by: Jan Haller <bromeon@gmail.com>
bors bot added a commit to godot-rust/gdnative that referenced this pull request Jan 8, 2022
838: Godot version check + workaround for API generation bug r=Bromeon a=Bromeon

As mentioned in #833, Godot versions < 3.3.1 were subject to [a bug](godotengine/godot#48081) that caused non-deterministic crashes during the command:
```
godot --gdnative-generate-json-api api.json
```

For users working with affected Godot versions (e.g. 3.2), this makes the feature flag `custom-godot` annoying to use, since they can't rely on the API generation to succeed -- let alone use it for automation/CI. This PR works around that by retrying the command up to 10 times (magic number). I changed the minimum supported Godot version in our own CI again to 3.2, meaning that if it _doesn't_ work, we have to suffer, too 😬

Additionally, this PR parses the Godot version and emits a meaningful error message if an unsupported version is detected (3.1 or 4.0).

Co-authored-by: Jan Haller <bromeon@gmail.com>
KarimHamidou added a commit to KarimHamidou/godot-rust that referenced this pull request Feb 6, 2023
838: Godot version check + workaround for API generation bug r=Bromeon a=Bromeon

As mentioned in #833, Godot versions < 3.3.1 were subject to [a bug](godotengine/godot#48081) that caused non-deterministic crashes during the command:
```
godot --gdnative-generate-json-api api.json
```

For users working with affected Godot versions (e.g. 3.2), this makes the feature flag `custom-godot` annoying to use, since they can't rely on the API generation to succeed -- let alone use it for automation/CI. This PR works around that by retrying the command up to 10 times (magic number). I changed the minimum supported Godot version in our own CI again to 3.2, meaning that if it _doesn't_ work, we have to suffer, too 😬

Additionally, this PR parses the Godot version and emits a meaningful error message if an unsupported version is detected (3.1 or 4.0).

Co-authored-by: Jan Haller <bromeon@gmail.com>
GuilhermeOrceziae added a commit to GuilhermeOrceziae/godot-rust that referenced this pull request Feb 9, 2023
838: Godot version check + workaround for API generation bug r=Bromeon a=Bromeon

As mentioned in #833, Godot versions < 3.3.1 were subject to [a bug](godotengine/godot#48081) that caused non-deterministic crashes during the command:
```
godot --gdnative-generate-json-api api.json
```

For users working with affected Godot versions (e.g. 3.2), this makes the feature flag `custom-godot` annoying to use, since they can't rely on the API generation to succeed -- let alone use it for automation/CI. This PR works around that by retrying the command up to 10 times (magic number). I changed the minimum supported Godot version in our own CI again to 3.2, meaning that if it _doesn't_ work, we have to suffer, too 😬

Additionally, this PR parses the Godot version and emits a meaningful error message if an unsupported version is detected (3.1 or 4.0).

Co-authored-by: Jan Haller <bromeon@gmail.com>
hesuteia added a commit to hesuteia/godot-rust that referenced this pull request Feb 11, 2023
838: Godot version check + workaround for API generation bug r=Bromeon a=Bromeon

As mentioned in #833, Godot versions < 3.3.1 were subject to [a bug](godotengine/godot#48081) that caused non-deterministic crashes during the command:
```
godot --gdnative-generate-json-api api.json
```

For users working with affected Godot versions (e.g. 3.2), this makes the feature flag `custom-godot` annoying to use, since they can't rely on the API generation to succeed -- let alone use it for automation/CI. This PR works around that by retrying the command up to 10 times (magic number). I changed the minimum supported Godot version in our own CI again to 3.2, meaning that if it _doesn't_ work, we have to suffer, too 😬

Additionally, this PR parses the Godot version and emits a meaningful error message if an unsupported version is detected (3.1 or 4.0).

Co-authored-by: Jan Haller <bromeon@gmail.com>
ecobiubiu added a commit to ecobiubiu/open-rust that referenced this pull request Mar 30, 2023
838: Godot version check + workaround for API generation bug r=Bromeon a=Bromeon

As mentioned in #833, Godot versions < 3.3.1 were subject to [a bug](godotengine/godot#48081) that caused non-deterministic crashes during the command:
```
godot --gdnative-generate-json-api api.json
```

For users working with affected Godot versions (e.g. 3.2), this makes the feature flag `custom-godot` annoying to use, since they can't rely on the API generation to succeed -- let alone use it for automation/CI. This PR works around that by retrying the command up to 10 times (magic number). I changed the minimum supported Godot version in our own CI again to 3.2, meaning that if it _doesn't_ work, we have to suffer, too 😬

Additionally, this PR parses the Godot version and emits a meaningful error message if an unsupported version is detected (3.1 or 4.0).

Co-authored-by: Jan Haller <bromeon@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants