Broken HDL Worker Search Path on Slave Attributes

When creating hdl workers in 2.4.7 their OWD is now given the extension “-hdl” (e.g. worker-hdl.xml), however the search paths for the rcc slave attributes haven’t been updated and so can’t search for these new variants of the file.

The slave attribute does work with new rcc files, which similarly now have the “-rcc” extension (worker-rcc.xml).

Output from a demo proxy worker searching for a worker:

OCPI( 8:407.0937): Component  0:  name: demo_worker impl: demo_worker.hdl spec:  selection: 
OCPI(10:407.0937): Trying to open 'hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open 'hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open 'gen/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../lib/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../specs/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open 'hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open 'gen/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../specs/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../lib/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../demo_proxy.comp/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../../components/lib/hdl/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../../components/lib/rcc/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../../components/lib/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../../imports/ocpi.core/exports/lib/components/hdl/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../../imports/ocpi.core/exports/lib/components/rcc/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../../imports/ocpi.core/exports/lib/components/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open '../../imports/ocpi.core/exports/specs/hdl/demo_worker.xml', and failed
OCPI(10:407.0937): Trying to open 'hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open 'hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open 'gen/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../lib/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../specs/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open 'hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open 'gen/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../specs/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../lib/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../demo_proxy.comp/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../../components/lib/hdl/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../../components/lib/rcc/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../../components/lib/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../../imports/ocpi.core/exports/lib/components/hdl/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../../imports/ocpi.core/exports/lib/components/rcc/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../../imports/ocpi.core/exports/lib/components/hdl/demo_worker-rcc.xml', and failed
OCPI(10:407.0937): Trying to open '../../imports/ocpi.core/exports/specs/hdl/demo_worker-rcc.xml', and failed
For file demo_proxy-rcc.xml: slave processing error: for worker demo_worker.hdl: Cannot find worker using "hdl/demo_worker-rcc" or "hdl/demo_worker": File "hdl/demo_worker-rcc" could not be opened for reading/parsing.  Files tried: hdl/demo_worker-rcc.xml, hdl/demo_worker-rcc.xml, gen/hdl/demo_worker-rcc.xml, ../lib/hdl/demo_worker-rcc.xml, ../specs/hdl/demo_worker-rcc.xml, hdl/demo_worker-rcc.xml, gen/hdl/demo_worker-rcc.xml, ../specs/hdl/demo_worker-rcc.xml, ../lib/hdl/demo_worker-rcc.xml, ../demo_proxy.comp/hdl/demo_worker-rcc.xml, ../../components/lib/hdl/hdl/demo_worker-rcc.xml, ../../components/lib/rcc/hdl/demo_worker-rcc.xml, ../../components/lib/hdl/demo_worker-rcc.xml, ../../imports/ocpi.core/exports/lib/components/hdl/hdl/demo_worker-rcc.xml, ../../imports/ocpi.core/exports/lib/components/rcc/hdl/demo_worker-rcc.xml, ../../imports/ocpi.core/exports/lib/components/hdl/demo_worker-rcc.xml, ../../imports/ocpi.core/exports/specs/hdl/demo_worker-rcc.xml. CWD is /home/fergus/Documents/hdl_worker_test/components/demo_proxy.rcc
make[2]: *** [gen/demo_proxy-worker.hh] Error 1
make[1]: *** [demo_proxy.rcc] Error 2
make: *** [rcc] Error 2

I just hit this same issue as well.

To clarify what Fergus is saying and how to avoid this:

  • The search path for slaves looks only for <worker>.xml files when scanning HDL Workers. So the newer <worker>-hdl.xml files are not found.
    • The workaround is to not use the <worker>-hdl.xml form, and keep using <worker>.xml.

Furthermore, this appears to fix the problem:

diff --git a/tools/ocpigen/src/parse.cc b/tools/ocpigen/src/parse.cc
index 819cb4b60..259db2c78 100644
--- a/tools/ocpigen/src/parse.cc
+++ b/tools/ocpigen/src/parse.cc
@@ -875,8 +875,8 @@ create(const char *file, const std::string &parentFile, const char *package, con
   // a potentially qualified worker name for searching, including authoring model suffix.
   std::string packagePrefix; // used when we have a non-slash, more than one dot, worker identifier
   std::string fileName(file);
+  const char *model = NULL;
   if (!slash && dot && strcasecmp("xml", dot + 1)) {
-    const char *model = NULL;
     for (const char **cp = OM::g_models; *cp; ++cp)
       if (!strcasecmp(*cp, dot + 1)) {
        model = dot + 1;
@@ -903,7 +903,7 @@ create(const char *file, const std::string &parentFile, const char *package, con
     if (!strcasecmp(fileName.c_str() + fileName.length() - 4, ".xml") || slash)
       return NULL;
     std::string suffixed;
-    OU::format(suffixed, "%s-%s", fileName.c_str(), parent->m_modelString);
+    OU::format(suffixed, "%s-%s", fileName.c_str(), model ? model : parent->m_modelString);
     if ((err = parseFile(suffixed.c_str(), parentFile, NULL, &xml, xf, false, true, false,
                         packagePrefix.empty() ? NULL : skipFile, &packagePrefix))) {
       err = OU::esprintf("Cannot find worker using \"%s\" or \"%s\": %s",

Can’t guarantee this is an appropriate fix in all conditions, but it works for the case identified in this post.

I have added this fix to a merge request I am preparing:

1 Like