All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
To: openembedded-core@lists.openembedded.org
Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	 Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Subject: [PATCH v2 0/4] devtool: standard: Fix file copy on finish --force
Date: Sun, 16 Aug 2026 13:12:00 +0200	[thread overview]
Message-ID: <20260816-mathieu-devtool-v2-0-13c943abf48e@bootlin.com> (raw)

Fix "devtool finish --force" command, by allowing to copy folders that
were not previously existing but also by preventing it from trying to
remove non-existent files. Devtool was particularly confused when using
the finish subcommand on a recipe that was just added.

Reproducer:

devtool add --version 2.10 https://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
...
devtool build hello
...
devtool finish hello -f ../openembedded-core/meta/
...
Traceback (most recent call last):
  File "/home/mathieu/projects/swat/gits/openembedded-core/scripts/devtool", line 352, in <module>
    ret = main()
  File "/home/mathieu/projects/swat/gits/openembedded-core/scripts/devtool", line 338, in main
    ret = args.func(args, config, basepath, workspace)
  File "/home/mathieu/projects/swat/gits/openembedded-core/scripts/lib/devtool/standard.py", line 2214, in finish
    updated, appendfile, removed = _update_recipe(args.recipename, workspace, rd, args.mode, appendlayerdir, wildcard_version=True, no_remove=False, no_report_remove=removing_original, initial_rev=args.initial_rev, dry_run_outdir=dry_run_outdir, no_overrides=args.no_overrides, force_patch_refresh=args.force_patch_refresh)
                                   ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mathieu/projects/swat/gits/openembedded-core/scripts/lib/devtool/standard.py", line 1903, in _update_recipe
    updated, appendf, removed = _update_recipe_patch(recipename, workspace, srctree, crd, appendlayerdir, wildcard_version, no_remove, no_report_remove, initial_rev, dry_run_outdir, force_patch_refresh)
                                ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mathieu/projects/swat/gits/openembedded-core/scripts/lib/devtool/standard.py", line 1675, in _update_recipe_patch
    upd_f, new_f, del_f = _export_local_files(srctree, rd, local_files_dir, srctreebase)
                          ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mathieu/projects/swat/gits/openembedded-core/scripts/lib/devtool/standard.py", line 1469, in _export_local_files
    shutil.copy2(fullfile, os.path.join(destdir, f))
    ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/shutil.py", line 468, in copy2
    copyfile(src, dst, follow_symlinks=follow_symlinks)
    ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.13/shutil.py", line 262, in copyfile
    with open(dst, 'wb') as fdst:
         ~~~~^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/devtool77jejua2/tmpyuo3c_ay/build-aux/compile'

Using --force is arguably a bad idea here, but as we do provide this
possibility, we should make sure the code does not crash.

Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
---
Changes in v2:
- Use RecipetoolTransient instead of Proprietary.
- Link to v1: https://lore.kernel.org/r/20260814-mathieu-devtool-v1-0-985e81a17bb3@bootlin.com

---
Mathieu Dubois-Briand (4):
      scripts: scriptutils: Use LicenseRef-RecipetoolTransient LICENSE while fetching
      devtool: standard: Fix file copy on finish --force
      devtool: standard: Remove unused variable
      oe-selftest: devtool: Add test for add/finish workflow

 meta/files/common-licenses/RecipetoolTransient |  1 +
 meta/lib/oeqa/selftest/cases/devtool.py        | 58 ++++++++++++++++++++++++++
 scripts/lib/devtool/standard.py                |  9 ++--
 scripts/lib/scriptutils.py                     |  2 +-
 4 files changed, 66 insertions(+), 4 deletions(-)
---
base-commit: 07a342aa80c7349dd014f743a695a5e006add8df
change-id: 20260813-mathieu-devtool-9b0b2768098f

Best regards,
-- 
Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>



             reply	other threads:[~2026-08-16 11:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-16 11:12 Mathieu Dubois-Briand [this message]
2026-08-16 11:12 ` [PATCH v2 1/4] scripts: scriptutils: Use LicenseRef-RecipetoolTransient LICENSE while fetching Mathieu Dubois-Briand
2026-08-16 11:12 ` [PATCH v2 2/4] devtool: standard: Fix file copy on finish --force Mathieu Dubois-Briand
2026-08-16 11:12 ` [PATCH v2 3/4] devtool: standard: Remove unused variable Mathieu Dubois-Briand
2026-08-16 11:17   ` Patchtest results for " patchtest
2026-08-16 11:12 ` [PATCH v2 4/4] oe-selftest: devtool: Add test for add/finish workflow Mathieu Dubois-Briand

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=20260816-mathieu-devtool-v2-0-13c943abf48e@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=thomas.petazzoni@bootlin.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.