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

CI + codegen improvements; header update #48

Merged
merged 16 commits into from
Dec 12, 2022
Merged

Conversation

Bromeon
Copy link
Member

@Bromeon Bromeon commented Dec 12, 2022

This mega-PR improves the project setup across several domains:

  1. Enable CI for macOS integration tests
  2. Enable CI for rustfmt
  3. Enable unit tests for 3 platforms, through mocking Godot
    This was unnecessarily hard due to incomplete/unintuitive implementation of #[cfg(test)] and #[cfg(doctest)]. These issues are not solved despite closed.
  4. Update to newer Godot API header (not yet latest...)
  5. Change the location where code is generated
  6. Fix Godot regex version parsing
  7. Fix Dodge-the-Creeps example, by re-opening and re-saving it in newer editor

@Bromeon Bromeon added quality-of-life No new functionality, but improves ergonomics/internals c: tooling CI, automation, tools c: ffi Low-level components and interaction with GDExtension API labels Dec 12, 2022
…rget and include!

This means that JSON parsing efforts are duplicated, but we crates are more self-contained now.
Each crate now has the source code it needs to process in its own directory, also confusing IDEs less.
Move conditionally-compiled symbols from unit test into own file.

Also disable recursive dev-dependency, which causes following dev-dependency cycle during cargo test.
Note that #[cfg(test)] is not carried along dependencies.

  godot-core [dev]
  -> godot [non-dev]
  -> godot-core [non-dev]

So, we get a Heisenberg situation where both #[cfg(test)] and #[cfg(not(test))] are simultaneously true.
This also happens without any dependencies, just thanks to doctest enabling #[cfg(doctest)] but not #[cfg(test)].

The following code prints *both* errors!

  #[cfg(test)]
  compile_error!("test");

  #[cfg(not(test))]
  compile_error!("not(test)");

See comments in godot-core/lib.rs for more horror stories.
@Bromeon
Copy link
Member Author

Bromeon commented Dec 12, 2022

Linux integration test currently failing because latest header change is not yet incorporated.

@Bromeon Bromeon merged commit 5513c00 into master Dec 12, 2022
@Bromeon Bromeon deleted the qol/ci-and-codegen branch December 12, 2022 22:05
@Bromeon Bromeon mentioned this pull request Dec 12, 2022
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: ffi Low-level components and interaction with GDExtension API c: tooling CI, automation, tools quality-of-life No new functionality, but improves ergonomics/internals
Projects
None yet
1 participant