Skip to content

Conversation

@TimJentzsch
Copy link
Collaborator

@TimJentzsch TimJentzsch commented Jan 11, 2025

Objective

Closes #218.

For some reason, the profile dev has a target folder named debug instead of dev.
This caused a compile error on native dev builds.

Solution

  • Extract the artifact folder path logic into a separate function
  • Add a special case for the dev profile
  • Add some unit tests

Testing

Run bevy build on a Bevy project, using this branch for the Bevy CLI.
It shouldn't fail with an error.

Future work

We should probably set up some more tests for the CLI, testing all the build and run commands and potentially different targets and profiles.
But that would require non-trivial setup work, so I will defer it for a future task.

@TimJentzsch TimJentzsch added C-Bug A bug in the program A-Run Related to the bevy run command A-Build Related to the bevy build command D-Straightforward Simple bug fixes and API improvements, docs, test and examples P-High This is particularly urgent, and deserves immediate attention labels Jan 11, 2025
Copy link
Collaborator

@DaAlbrecht DaAlbrecht left a comment

Choose a reason for hiding this comment

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

Nice work! bevy build runs for my test project successfully too.

@DaAlbrecht
Copy link
Collaborator

DaAlbrecht commented Jan 11, 2025

Clippy: We could also unwrap this else block: https://github.com/TheBevyFlock/bevy_cli/blob/main/src/run/mod.rs#L191

Copy link
Member

@BD103 BD103 left a comment

Choose a reason for hiding this comment

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

Works locally! Merge this when you're ready :)

@TimJentzsch
Copy link
Collaborator Author

Clippy: We could also unwrap this else block: https://github.com/TheBevyFlock/bevy_cli/blob/main/src/run/mod.rs#L191

What do you mean by unwrap here?

@DaAlbrecht
Copy link
Collaborator

Clippy: We could also unwrap this else block: https://github.com/TheBevyFlock/bevy_cli/blob/main/src/run/mod.rs#L191

What do you mean by unwrap here?

In the if and elseif branch we early return. Therefore the else statement is redundant. (If we don't return we will hit the else anyway). I think the lsp code action is called "unwrap else block" iirc.

@TimJentzsch
Copy link
Collaborator Author

Clippy: We could also unwrap this else block: https://github.com/TheBevyFlock/bevy_cli/blob/main/src/run/mod.rs#L191

What do you mean by unwrap here?

In the if and elseif branch we early return. Therefore the else statement is redundant. (If we don't return we will hit the else anyway). I think the lsp code action is called "unwrap else block" iirc.

Ah right, because bail! returns. Makes sense!

@TimJentzsch TimJentzsch enabled auto-merge (squash) January 12, 2025 12:02
@TimJentzsch TimJentzsch merged commit 0558371 into main Jan 12, 2025
8 checks passed
@TimJentzsch TimJentzsch deleted the 218-fix-debug-builds-on-native branch January 12, 2025 12:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Build Related to the bevy build command A-Run Related to the bevy run command C-Bug A bug in the program D-Straightforward Simple bug fixes and API improvements, docs, test and examples P-High This is particularly urgent, and deserves immediate attention

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix bevy build compile error on native debug builds

4 participants