question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[bug] Catkin build tasks not working

See original GitHub issue

general information Ubuntu 18.04; using catkin tools, vscode 1.37.1.

what is the bug When running Configure Default Build Task and then selecting catkin: make, a new entry is added to tasks.json:

{
    "type": "catkin",
    "problemMatcher": [
        "$catkin-gcc"
    ],
    "group": {
        "kind": "build",
        "isDefault": true
    }
}

For the type, vscode complains about “Value is not accepted”. For "problemMatcher: “Incorrect type. Expected object”.

expected behavior The creation of a valid and working catkin build task

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
orzechowcommented, Jan 8, 2021

With VSCode 1.52.1 and vscode-ros v0.6.5, this is still an issue.

When creating a build task for a catkin tools workspace using the plugin (CTRL+SHIFT+PTasks: Configure Default Build Task), this tasks.json is created:

{
	"version": "2.0.0",
	"tasks": [
		{
			"type": "catkin",
			"args": [
				"--workspace",
				"/path/to/my/catkin_ws"
			],
			"problemMatcher": [
				"$catkin-gcc"
			],
			"group": {
				"kind": "build",
				"isDefault": true
			},
			"label": "catkin: build"
		}
	]
}

As a result triggering a build fails:

> Executing task: catkin --workspace /path/to/my/catkin_ws <

usage: catkin [-h] [-a] [--test-colors] [--version]
              [--force-color | --no-color]
              [build | clean | config | create | env | init | list | locate | profile]
              ...

Error: Unknown verb '/path/to/my/catkin_ws' provided.
The terminal process "/bin/bash '-c', 'catkin --workspace /path/to/my/catkin_ws'" terminated with exit code: 1.

Clearly, it should have called catkin build. These changes in tasks.json fix the problem (and nicely set the working directory, to support stuff like catkin build --this --no-deps as mentioned by @beetleskin ):

{
	"version": "2.0.0",
	"tasks": [
		{
			"label": "catkin: build all",
			"type": "catkin",
			"args": [
				"build",
				"--continue"
			],
			"problemMatcher": [
				"$catkin-gcc"
			],
			"group": "build",
			"options": {"cwd": "${fileDirname}"}
		}
	]
}
1reaction
beetleskincommented, Aug 29, 2019

Alright. With the original plugin, I’ve been using those:

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "catkin all default",
            "type": "shell",
            "command": "catkin build --profile default --continue",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": [
                    "absolute"
                ]
            },
            "group": "build"
        },
        {
            "label": "catkin all debug",
            "type": "shell",
            "command": "catkin build --profile debug --continue",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": [
                    "absolute"
                ]
            },
            "group": "build"
        },
        {
            "label": "catkin this default",
            "type": "shell",
            "command": "cd ${fileDirname} && catkin build --profile default --this --no-deps",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": [
                    "absolute"
                ]
            },
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },
        {
            "label": "catkin this debug",
            "type": "shell",
            "command": "cd ${fileDirname} && catkin build --profile debug --this --no-deps",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": [
                    "absolute"
                ]
            },
            "group": "build"
        },
        {
            "label": "catkin this test default",
            "type": "shell",
            "command": "cd ${fileDirname} && catkin run_tests --profile default --this --no-deps",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": [
                    "absolute"
                ]
            },
            "group": "build"
        },
        {
            "label": "catkin this test debug",
            "type": "shell",
            "command": "cd ${fileDirname} && catkin run_tests --profile debug --this --no-deps",
            "problemMatcher": {
                "base": "$gcc",
                "fileLocation": [
                    "absolute"
                ]
            }
        },
        {
            "label": "catkin clean",
            
            "type": "shell",
            "command": "catkin clean --all-profiles"
        }
    ]
}

Do you mean those type of tasks? Or how do I compile with the plugin?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Build Packages — catkin_tools 0.0.0 documentation
If a workspace is not yet initialized, build can initialize it with the default configuration, but only if it is called from the...
Read more >
ubuntu 16.04 - Issues with Catkin Build - Stack Overflow
the root Folder of build, install, log, devel and src space should be your catkin root where you can call to catkin build...
Read more >
Error with catkin build - Ros melodic
I have an error while catkin build I never had before, ... exc_tb) File "/usr/local/lib/python2.7/dist-packages/trollius/tasks.py", ...
Read more >
A universal build tool - ROS 2 Design
catkin_make_isolated is provided by the ROS package catkin which contains the build system for ROS 1. It was developed after catkin_make to address...
Read more >
catkin_tools command man page - ManKier
Most problems users will encounter when migrating from catkin_make to catkin build are due to hidden bugs in packages which previously relied on ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found