Bug 9209 - The unique name validation for custom images happens across projects
Summary: The unique name validation for custom images happens across projects
Status: ACCEPTED
Alias: None
Product: Toaster
Classification: Build System, Metadata & Runtime
Component: toaster (show other bugs)
Version: 2.0
Hardware: x86 Multiple
: Low normal
Target Milestone: Future
Assignee: Toaster default assignee
QA Contact:
URL:
Whiteboard:
Depends on: 7880
Blocks:
  Show dependency tree
 
Reported: 2016-03-03 19:22 UTC by Belen Barros Pena
Modified: 2023-12-14 04:19 UTC (History)
6 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments
this zip holds two snapshots of customize image goo in different projects (91.93 KB, application/zip)
2016-07-14 19:30 UTC, Libertad
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Belen Barros Pena 2016-03-03 19:22:33 UTC
Steps to reproduce:

1. Create a Toaster project. 
2. Create a custom image
3. Create a second Toaster project
4. Create a custom image and try to give it the same name you used for the custom image you created in step 2

Toaster will complain that a custom image with that name already exists. 

Custom image names must be unique within a project: I should be able to reuse names in different projects.
Comment 1 Elliot Smith 2016-03-23 13:28:19 UTC
Note that this is because all custom images go into the same folder, with filenames matching the custom image name (e.g. if I create the custom image "mycim", the recipe file would be /home/ell/dev/toaster/poky/build/toaster-custom-images/recipes/mycim.bb).

To change this, it would be necessary to include and additional identifier in the path, e.g. the project:

/home/ell/dev/toaster/poky/build/toaster-custom-images/recipes/project-1/mycim.bb

or an increment on the recipe file basename:

/home/ell/dev/toaster/poky/build/toaster-custom-images/recipes/mycim-1.bb

or similar.
Comment 2 Belen Barros Pena 2016-03-23 13:31:43 UTC
The plan is moving toaster-custom-images inside the project specific build directory, so that you have a toaster-custom-images folder per project. Would that solve the problem without further changes?

If yes, that means this bug depends on bug 7880
Comment 3 Elliot Smith 2016-03-24 13:40:03 UTC
Yes, that should fix it, as you would have a project-specific directory which is part of the recipe path.
Comment 4 Elliot Smith 2016-04-08 09:57:41 UTC
While you no longer get an error about duplicate custom image names, all recipe files for all projects still go into build/toaster-custom-images. This may mean that custom image recipe files from different projects are overwriting each other if they have the same name.

I also noticed bug 9425 while checking this, which may be a related issue (the downloadable file is expected to be in one location but is actually in a different location).
Comment 5 Elliot Smith 2016-04-08 11:16:33 UTC
You do see error messages about duplicate custom image names still; not sure what I did earlier when I didn't see the error when I used the same recipe name in two different projects.
Comment 6 Elliot Smith 2016-04-11 11:28:53 UTC
Posted to Toaster mailing list for review 2016-04-11:
https://lists.yoctoproject.org/pipermail/toaster/2016-April/004425.html
Comment 7 Elliot Smith 2016-04-14 07:20:00 UTC
Leaving until after Bootstrap 3 migration, as it touches the UI code.
Comment 8 Elliot Smith 2016-04-19 11:11:21 UTC
Now that the Bootstrap 3 work has been put aside momentarily, I sent a reminder to review this:
https://lists.yoctoproject.org/pipermail/toaster/2016-April/004468.html
Comment 9 Libertad 2016-07-14 19:30:50 UTC
Created attachment 3285 [details]
this zip holds two snapshots of customize image goo in different projects
Comment 10 Libertad 2016-07-14 19:31:56 UTC
This was verified in commit 6f0c5537e02c59e1c8f3b08f598dc049ff8ee098


To verify I took the following steps:

1. Create a project.
2. Create a custom image with name 'goo' in this project; it should work.
3. Try to create another custom image called 'goo' in this project; it should fail.
4. Try to create a custom image called 'core-image-minimal' in this project; it should fail.
5. Create another project.
6. Create a custom image called 'goo' in the second project; it should work.
Comment 11 Belen Barros Pena 2016-07-15 11:10:53 UTC
I've just reproduced this on master (627d01997fcf6a0581d88047735769ffb2592b82) and toaster-next (2a127b1a6cd3df47879bda5e0d7bb123484013cb), so reopening
Comment 12 Elliot Smith 2016-07-15 13:04:52 UTC
Belen, can you verify that you have reproduced the bug using the steps in the original bug report? Or were you doing something else?
Comment 13 Belen Barros Pena 2016-07-15 13:08:22 UTC
(In reply to comment #12)
> Belen, can you verify that you have reproduced the bug using the steps in
> the original bug report? Or were you doing something else?

Exactly the same steps as in 

https://bugzilla.yoctoproject.org/show_bug.cgi?id=9209#c0