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

Add more verbose logging when tauri fails to parse a Cargo.toml in a parent workspace #2515

Closed
edgex004 opened this issue Aug 23, 2021 · 1 comment

Comments

@edgex004
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Split from #2508. I had to pull the tauri source and debug re.cli in order to determine why my build was failing. If there logging was a bit more verbose, the problem with my project files might have been made clear without ever touching the rs.cli code.

Error currently looks like:

Error: failed to rename `/Users/edgex004/Code/test-tauri-app/src-tauri/target/release/app` to `/Users/edgex004/Code/test-tauri-app/src-tauri/target/release/test-tauri-app`

Caused by:
    No such file or directory (os error 2)

Describe the solution you'd like
Adding a warning printout to cli.rs for when get_workspace_dir finds a Cargo.toml in a parent directory, but fails to parse it for some reason. Print the parser error context here.

I have done this on a branch. Error now looks like:

[tauri:build] Found `/Users/edgex004/Code/test-tauri-app`, which may define a parent workspace, but failed to parse it. If this is indeed a parent workspace, undefined behavior may occur: 
    failed to parse Cargo.toml: missing field `description` for key `package` at line 18 column 1
Error: failed to rename `/Users/edgex004/Code/test-tauri-app/src-tauri/target/release/app` to `/Users/edgex004/Code/test-tauri-app/src-tauri/target/release/test-tauri-app`

Caused by:
    No such file or directory (os error 2)

Describe alternatives you've considered
Alternatives I thought of are:

  • to error out in this case instead.
  • make the Cargo.toml parser more lax.

Additional context
None

@edgex004
Copy link
Contributor Author

My suggested fix is here.

It is probably not the best solution, but perhaps it can give someone else a better idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant