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

Running broken build Syntax error: ")" unexpected #8182

Closed
ralpha opened this issue Apr 29, 2020 · 2 comments
Closed

Running broken build Syntax error: ")" unexpected #8182

ralpha opened this issue Apr 29, 2020 · 2 comments
Labels
C-bug Category: bug

Comments

@ralpha
Copy link

ralpha commented Apr 29, 2020

I got the error:

target/debug/myproject: 1: target/debug/myproject: Syntax error: ")" unexpected

When building one of my projects.
This error was very likely caused by me canceling the build process at just the right moment.

This is not even really a bug. But made me to force a clean build, so might be something that could be fixed. If not this might help people in the future.
(If you get this problem run cargo clean and build again.)

Problem
Canceled build process and broke executable in later builds.
This is a copy of my terminal when while I got this error (cleaned up a bit).

user@My-PC:/Path_to_Project/myproject$ cargo build
   Compiling df_st_db v0.1.0 (/Path_to_Project/myproject/df_st_db)
   Compiling myproject v0.1.0 (/Path_to_Project/myproject)
    Finished dev [unoptimized + debuginfo] target(s) in 20.72s

------Made minor code changes here...should still compile...and does later on.-----

user@My-PC:/Path_to_Project/myproject$ cargo run
   Compiling df_st_db v0.1.0 (/Path_to_Project/myproject/df_st_db)
   Compiling myproject v0.1.0 (/Path_to_Project/myproject)
^C  Building [=====================================================> ] 203/204: myproject(bin)                 
--- I canceled the build here (see the ^C, for ctrl+c ) ----

user@My-PC:/Path_to_Project/myproject$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.20s
     Running `target/debug/myproject`
target/debug/myproject: 1: target/debug/myproject: Syntax error: ")" unexpected

user@My-PC:/Path_to_Project/myproject$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.21s
     Running `target/debug/myproject`
target/debug/myproject: 1: target/debug/myproject: Syntax error: ")" unexpected

user@My-PC:/Path_to_Project/myproject$ cargo build
    Finished dev [unoptimized + debuginfo] target(s) in 0.21s

user@My-PC:/Path_to_Project/myproject$ cargo run
    Finished dev [unoptimized + debuginfo] target(s) in 0.21s
     Running `target/debug/myproject`
target/debug/myproject: 1: target/debug/myproject: Syntax error: ")" unexpected

user@My-PC:/Path_to_Project/myproject$ cargo clean
... Some errors that files could not be deleted, but this is irrelevant to this...

user@My-PC:/Path_to_Project/myproject$ cargo run
   Compiling proc-macro2 v1.0.10
   Compiling unicode-xid v0.2.0
... Compiled and runs perfect ....

Steps
See commands above.

Possible Solution(s)
Run cargo clean and cargo build or cargo run. It is now fixed.
(you can probably delete the executable as well and build it again)

In cargo it might be able to detect this? And just build the executable again? (so it is not broken)

Notes
This is not really a bug and might only happen in very infrequently. But it is here if it is useful.
If not just close this issue and it is all good for me.

Output of cargo version:
cargo 1.43.0 (3532cf7 2020-03-17)
rustc 1.43.0 (4fb7144ed 2020-04-20)

@ralpha ralpha added the C-bug Category: bug label Apr 29, 2020
@ehuss
Copy link
Contributor

ehuss commented Apr 29, 2020

I think this has been recently addressed via #8087, which should be in 1.44 (currently in beta).

@ralpha
Copy link
Author

ralpha commented Apr 29, 2020

Looks indeed like that is the issue.
I will just close this issue then and if it ever happens again after 1.44 I'll reopen it or make a new issue.

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

No branches or pull requests

2 participants