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

cpp build task does not work #6204

Closed
simark opened this issue Sep 17, 2019 · 3 comments · Fixed by #6419
Closed

cpp build task does not work #6204

simark opened this issue Sep 17, 2019 · 3 comments · Fixed by #6419
Assignees
Labels
bug bugs found in the application cpp issues related to the C/C++ language tasks issues related to the task system

Comments

@simark
Copy link
Contributor

simark commented Sep 17, 2019

Description

I have this in my workspace preferences:

{
   "cpp.buildConfigurations": [
      {
         "name": "/home/smarchi/build/babeltrace",
         "directory": "/home/smarchi/build/babeltrace",
         "commands": {
             "build": "make"
         }
      }
   ]
}

This generates a task in the task runner:

bug

First, notice the undefined, I don't think it's intended for it to be there. Then, when I try to run it, nothing happens and I get this in the console:

task ERROR Can't get task launch configuration for label: C/C++ Build - /home/smarchi/build/babeltrace

I am at the following commit:

commit 1808d782a947a52fbeeb900bb83b190cd578420c (HEAD -> master, origin/master, origin/HEAD)
Author: Miro Spönemann <[email protected]>
Date:   Fri Sep 13 08:00:07 2019 +0000
@vince-fugnitto vince-fugnitto added bug bugs found in the application cpp issues related to the C/C++ language tasks issues related to the task system labels Sep 17, 2019
@elaihau
Copy link
Contributor

elaihau commented Sep 24, 2019

I made this change elaihau@d080d6a which fixed the display issue (i.e., undefined: C/C++ in task label). Also the Can't get task launch configuration for label: C/C++ Build error that Simon mentioned above was gone.

Instead I was getting this error

task INFO Created new task, id: 4, process id: 13, OS PID: 15131, context: file:///home/elaihau/dev/test-dir
terminal ERROR Couldn't attach - can't find terminal with id: 13 
root ERROR Couldn't resize terminal -1, because it doesn't exist.
terminal ERROR Error attaching to terminal id 13, the terminal is most likely gone. Starting up a new terminal instead.

I know this looks like the problem of "the command finishes (too quickly) before it gets attached to the terminal", but my task was defined like this in the pref:

   "cpp.buildConfigurations": [{
     "name": "Simon task runs",
     "directory": "/home/elaihau/dev",
     "commands": {
       "build": "bash -c 'sleep 5 && ls'"
     }
   }]

"sleep 5" should be more than enough ... do you have any ideas of what could go wrong ? @vince-fugnitto @marechal-p

@simark
Copy link
Contributor Author

simark commented Sep 24, 2019

I don't really know, but I just wanted to mention that you could just use:

"build": "sleep 5 && ls"

That command is already interpreted by a shell.

@elaihau
Copy link
Contributor

elaihau commented Sep 25, 2019

I don't really know, but I just wanted to mention that you could just use:

"build": "sleep 5 && ls"

That command is already interpreted by a shell.

i got exactly the same error if i use sleep 5 && ls

i used bash -c because i wasn't sure if the error was caused by the command not interpreted properly :)

@elaihau elaihau self-assigned this Oct 18, 2019
elaihau pushed a commit that referenced this issue Oct 20, 2019
This pull request fixes the following problems:
- cpp task labels are displayed as "undefined: xxxx" and it is wrong
- Theia always fails to run tasks defined in cpp extension. When they are started from the "Run Task", users either get "launch config not found" error, or an exception that says "Error attaching to terminal".

fixed #6204
elaihau pushed a commit that referenced this issue Oct 20, 2019
This pull request fixes the following problems:
- cpp task labels are displayed as "undefined: xxxx" and it is wrong
- Theia always fails to run tasks defined in cpp extension. When they are started from the "Run Task", users either get "launch config not found" error, or an exception that says "Error attaching to terminal".

fixed #6204
elaihau pushed a commit that referenced this issue Oct 24, 2019
This pull request fixes the following problems:
- cpp task labels are displayed as "undefined: xxxx" and it is wrong
- Theia always fails to run tasks defined in cpp extension. When they are started from the "Run Task", users either get "launch config not found" error, or an exception that says "Error attaching to terminal".

fixed #6204
akosyakov pushed a commit to akosyakov/theia that referenced this issue Feb 24, 2020
This pull request fixes the following problems:
- cpp task labels are displayed as "undefined: xxxx" and it is wrong
- Theia always fails to run tasks defined in cpp extension. When they are started from the "Run Task", users either get "launch config not found" error, or an exception that says "Error attaching to terminal".

fixed eclipse-theia#6204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs found in the application cpp issues related to the C/C++ language tasks issues related to the task system
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants