Skip to content

Conversation

@lgirdwood
Copy link
Member

vscode tasks can execute multiple commands easily so wrap the necessary commands to use the SOF convenience script with a small script that enables the python virtual environment.

# Current vscode tasks have difficulty executing multiple commands.

# setup environment
source ~/zephyrproject/.venv/bin/activate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as for #9878 - too many hard-coded assumptions. Let's not do this

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about make this conditional, if test -e ~/zephyrproject/.venv/bin/activate handling the default config?

I don't really mind for vscode-task.sh -- this can make the default scase easier and non-default setups can use a symlink or something like that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to check for environment variable then default to "getting started" directories if not found.

# Current vscode tasks have difficulty executing multiple commands.

# setup environment
source ~/zephyrproject/.venv/bin/activate
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about make this conditional, if test -e ~/zephyrproject/.venv/bin/activate handling the default config?

I don't really mind for vscode-task.sh -- this can make the default scase easier and non-default setups can use a symlink or something like that.

Copy link
Contributor

@tmleman tmleman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have nothing against adding this script, but it seems to me its usefulness may be negligible. After all, every development environment can be different. I have two such scripts that I call from vscode as a task, one written in bash and the other in PowerShell.
Will this be an example for others?

@lgirdwood
Copy link
Member Author

I have nothing against adding this script, but it seems to me its usefulness may be negligible. After all, every development environment can be different. I have two such scripts that I call from vscode as a task, one written in bash and the other in PowerShell. Will this be an example for others?

This script allows vscode to parse the build output and ctrl-click on the warnings/errors so it is quite useful. Fwiw, if your scripts are generic then I would recommend upstreaming too.

Fwiw, vscode has all the tooling for all languages/tools we use in SOF today and is cross platform (it can be our IADK UI), I think its great for increasing everyone's velocity. Its not mandatory, but if developers do use it we should make it as smooth as possible.

@lgirdwood
Copy link
Member Author

Changes for V2:

  1. Check for Zephyr/SOF environment variables before using default paths for venv.

vscode tasks can execute multiple commands easily so wrap the necessary
commands to use the SOF convenience script with a small script that
enables the python virtual environment.

Signed-off-by: Liam Girdwood <liam.r.girdwood@intel.com>
Copy link
Contributor

@jsarha jsarha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seeems like quite harmless script and if it helps building sof in vscode, then that should be good enough reason to get this merged. Then again I for one have so far installed all required python stuff in my ~/.local . So is it a correct assumption that a virtual environment is always needed?

@lgirdwood
Copy link
Member Author

So is it a correct assumption that a virtual environment is always needed?

Yes - always needed for west and Zephyr tooling.

@lgirdwood lgirdwood merged commit f58e079 into thesofproject:main Apr 8, 2025
43 of 49 checks passed
@lgirdwood lgirdwood deleted the lrg/topic/vscode branch April 8, 2025 17:52
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

Successfully merging this pull request may close these issues.

5 participants