Skip to content

Commit

Permalink
Fix: task_deps parsing on newer Yocto versions
Browse files Browse the repository at this point in the history
Two months ago, a commit was introduced that adds tasks with special
characters which broke our JSON parsing.

Since this variable is not extended, we might miss some tasks, but at
least we keep providing the feature. I could not identify a replacement
variable that would contained the expanded list of tasks.

We would need to run a `bitbake list-tasks` but it would be slower.
  • Loading branch information
deribaucourt committed Sep 18, 2024
1 parent 69db471 commit 2c31952
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion client/src/ui/BitbakeCommands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ async function selectTask (client: LanguageClient, recipe: string): Promise<stri
const taskDeps = await getVariableValue(client, '_task_deps', recipe)
let chosenTask: string | undefined
if (taskDeps !== undefined) {
const parsedTaskDeps = JSON.parse(taskDeps.replace(/'/g, '"'))
let sanitizedTaskDeps = taskDeps.replace(/'/g, '"')
// Remove expressions with special characters like \${create_spdx_source_deps(d)}
sanitizedTaskDeps = sanitizedTaskDeps.replace(/, "\\\${.*?}"/g, '')
const parsedTaskDeps = JSON.parse(sanitizedTaskDeps)
/**
* _task_deps="{'tasks': ['do_patch', ...], 'depends': {...}, ...}"
*/
Expand Down

0 comments on commit 2c31952

Please sign in to comment.