The manifest entry for requirement is sequence sensitive

Bug #1444242 reported by Po-Hsu Lin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PlainBox (Toolkit)
Fix Released
Critical
Zygmunt Krynicki

Bug Description

For a job with multi-requirements, if the manifest was not placed at the first line of those requirements, for example:

id: audio/playback_thunderbolt
estimated_duration: 30.0
imports: from 2013.com.canonical.plainbox import manifest
requires:
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'
 manifest.has_thunderbolt == 'True'

run it with plainbox with the following command (with manifest file created):
$ plainbox run -i "2013.com.canonical.certification::audio/playback_thunderbolt"

plainbox will complain about:
 * missing dependency: '2013.com.canonical.certification::manifest' (resource)

if it's written like this and it will be fine:

requires:
 manifest.has_thunderbolt == 'True'
 device.category == 'AUDIO'
 package.name == 'alsa-base'
 package.name == 'gir1.2-gst-plugins-base-0.10' or package.name == 'gir1.2-gst-plugins-base-1.0'
 package.name == 'pulseaudio-utils'

Related branches

Revision history for this message
Po-Hsu Lin (cypressyew) wrote :

I would mark this as Low priority, since we know how to workaround it by putting the manifest requirement to the first place.
But please feel free to raise to priority.

Changed in plainbox:
importance: Undecided → Low
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

This is weird, I need to check what's going on and if it's a more serious concern.

Changed in plainbox:
status: New → In Progress
assignee: nobody → Zygmunt Krynicki (zyga)
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Reproduced. *REALLY* weird.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

With the same job as Sam mentioned above (and one tiny patch that can be seen in the output below)

(venv.fx)zyga@fx:~/checkbox/providers/plainbox-provider-checkbox$ LANGUAGE=en plainbox -C -T plainbox.depmgr run -i "2013.com.canonical.certification::audio/playback_thunderbolt"
===============================[ Analyzing Jobs ]===============================
DEBUG plainbox.depmgr: Starting solve
DEBUG plainbox.depmgr: Visiting job 2013.com.canonical.certification::audio/playback_thunderbolt (color Color.COLOR_WHITE)
DEBUG plainbox.depmgr: Visiting dependency: <JobDefinition id:'2013.com.canonical.certification::device' plugin:'resource'>
DEBUG plainbox.depmgr: Visiting job 2013.com.canonical.certification::device (color Color.COLOR_WHITE)
DEBUG plainbox.depmgr: Visiting dependency: <JobDefinition id:'2013.com.canonical.certification::package' plugin:'resource'>
DEBUG plainbox.depmgr: Visiting job 2013.com.canonical.certification::package (color Color.COLOR_WHITE)
DEBUG plainbox.depmgr: Appending <JobDefinition id:'2013.com.canonical.certification::package' plugin:'resource'> to solution
DEBUG plainbox.depmgr: Appending <JobDefinition id:'2013.com.canonical.certification::device' plugin:'resource'> to solution
==================================[ Warning ]===================================
There were some problems with the selected jobs
 * missing dependency: '2013.com.canonical.certification::manifest' (resource)
Problematic jobs will not be considered
=============================[ Session Statistics ]=============================
This session is about 0.00% complete
Estimated duration cannot be determined for automated jobs.
Estimated duration cannot be determined for manual jobs.
Size of the desired job list: 0
Size of the effective execution plan: 0
===========================[ Running Selected Jobs ]============================
==================================[ Results ]===================================

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Ok, so the problem seems to boil to this line:

DEBUG plainbox.depmgr: Found missing dependency: '2013.com.canonical.certification::manifest' from <JobDefinition id:'2013.com.canonical.certification::audio/playback_thunderbolt' plugin:None>

Note the full ID of the job, it is 2013.com.canonical.*certification*::manifest. The problem is *certification*, that job is in the *plainbox* namespace. It seems that the "imports" system doesn't work correctly here.

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Ahh. Cool bug. I'll explain in a second, it's actually trivial to solve.

Changed in plainbox:
importance: Low → Critical
milestone: none → 0.21
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Please look at the merge request for an explanation.

Zygmunt Krynicki (zyga)
Changed in plainbox:
status: In Progress → Fix Committed
Changed in plainbox:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.