public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: adrian.freihofer@gmail.com
To: Enguerrand de Ribaucourt
	<enguerrand.de-ribaucourt@savoirfairelinux.com>,
	 openembedded-core@lists.openembedded.org
Subject: Re: [PATCH v2 3/5] devtool: ide: vscode: Configure read-only files
Date: Tue, 20 Feb 2024 10:05:12 +0100	[thread overview]
Message-ID: <724ff9e40a756684fb62f228d9cfcdf5a27256fb.camel@gmail.com> (raw)
In-Reply-To: <20240219165525.714512-4-enguerrand.de-ribaucourt@savoirfairelinux.com>

On Mon, 2024-02-19 at 17:55 +0100, Enguerrand de Ribaucourt wrote:
> When debugging or browsing files, the user may fall into external
> sources from other packages in the sysroot or dbg-rootfs. Modifying
> them
> will only lead to confusion since they will be overwritten by Yocto.
> The
> user should open them in a separate devtool modify session if they
> want
> to make changes. Meanwhile, we should prevent write access to them.
> 
> Signed-off-by: Enguerrand de Ribaucourt
> <enguerrand.de-ribaucourt@savoirfairelinux.com>
> ---
>  scripts/lib/devtool/ide_plugins/ide_code.py | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
> 
> diff --git a/scripts/lib/devtool/ide_plugins/ide_code.py
> b/scripts/lib/devtool/ide_plugins/ide_code.py
> index c063b7d0590..7b683c74086 100644
> --- a/scripts/lib/devtool/ide_plugins/ide_code.py
> +++ b/scripts/lib/devtool/ide_plugins/ide_code.py
> @@ -125,7 +125,7 @@ class IdeVSCode(IdeBase):
>          settings_dict["cmake.configureOnOpen"] = True
>          settings_dict["cmake.sourceDirectory"] =
> modified_recipe.real_srctree
>  
> -    def vscode_settings(self, modified_recipe):
> +    def vscode_settings(self, modified_recipe, image_recipe):
>          files_excludes = {
>              "**/.git/**": True,
>              "**/oe-logs/**": True,
> @@ -138,9 +138,16 @@ class IdeVSCode(IdeBase):
>              "**/oe-workdir/**",
>              "**/source-date-epoch/**"
>          ]
> +        files_readonly = {
> +            modified_recipe.recipe_sysroot + '/**': True,
> +            modified_recipe.recipe_sysroot_native + '/**': True,
> +        }
> +        if image_recipe.rootfs_dbg is not None:
> +            files_readonly[image_recipe.rootfs_dbg + '/**'] = True
>          settings_dict = {
>              "files.watcherExclude": files_excludes,
>              "files.exclude": files_excludes,
> +            "files.readonlyInclude": files_readonly,
>              "python.analysis.exclude": python_exclude
>          }
>          self.__vscode_settings_cmake(settings_dict, modified_recipe)
> @@ -425,7 +432,7 @@ class IdeVSCode(IdeBase):
>              self.vscode_tasks_fallback(args, modified_recipe)
>  
>      def setup_modified_recipe(self, args, image_recipe,
> modified_recipe):
> -        self.vscode_settings(modified_recipe)
> +        self.vscode_settings(modified_recipe, image_recipe)
>          self.vscode_extensions(modified_recipe)
>          self.vscode_c_cpp_properties(modified_recipe)
>          if args.target:

LGTM.
Adrian


  reply	other threads:[~2024-02-20  9:05 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-19 16:55 [PATCH v2 0/5] devtool: ide: Improve VSCode support Enguerrand de Ribaucourt
2024-02-19 16:55 ` [PATCH v2 1/5] devtool: ide_sdk: Use bitbake's python3 for generated scripts Enguerrand de Ribaucourt
2024-02-20  9:03   ` adrian.freihofer
2024-02-19 16:55 ` [PATCH v2 2/5] devtool: code: Add source mapping for debug source files Enguerrand de Ribaucourt
2024-02-20  9:01   ` adrian.freihofer
2024-02-21 14:12     ` Enguerrand de Ribaucourt
2024-02-21 14:56       ` Enguerrand de Ribaucourt
2024-02-22 13:00         ` adrian.freihofer
2024-02-22 15:51           ` Enguerrand de Ribaucourt
2024-02-25 20:52             ` adrian.freihofer
2024-02-19 16:55 ` [PATCH v2 3/5] devtool: ide: vscode: Configure read-only files Enguerrand de Ribaucourt
2024-02-20  9:05   ` adrian.freihofer [this message]
2024-02-19 16:55 ` [PATCH v2 4/5] meson: use absolute cross-compiler paths Enguerrand de Ribaucourt
2024-02-20 12:54   ` [OE-core] " Richard Purdie
2024-02-19 16:55 ` [PATCH v2 5/5] devtool: code: Provide a generic C++ configuration Enguerrand de Ribaucourt
2024-02-20  9:20   ` adrian.freihofer
2024-02-20  9:27     ` Enguerrand de Ribaucourt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=724ff9e40a756684fb62f228d9cfcdf5a27256fb.camel@gmail.com \
    --to=adrian.freihofer@gmail.com \
    --cc=enguerrand.de-ribaucourt@savoirfairelinux.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox