Skip to content

devices.util.load_lib: unintuitive load order #105

@PoroCYon

Description

@PoroCYon

On Windows, I noticed that devices.utils.load_lib.load_lib has an unintuitive order to search for DLLs: the last DLL found is actually the one used. This means the effective order is:

  1. %PATH%, C:\Windows\System32\ etc.
  2. Application-specific install directories (in C:\Program Files\ etc.)
  3. The custom directory specified in pylablib.par

This has two issues:

  • It is the opposite order of what I expected
    • This led to a fun afternoon of debugging after updating the UC480 drivers and noticing things stopped working. Turns out, pylablib was still using an old version of the DLL in System32, while the new version was only in C:\Program Files\
  • It opens file descriptors for and loads all available DLLs but only ends up using one.

I don't know if this is the intended behavior, but even if it is, this should probably be documented in a better way. For example, the generic docs leave the actual order very vague, and only say that System32 will be searched in "many cases" while also saying the "requirements are described in detail for the specific devices".

(FWIW, I'm willing to open another PR if you have a clear vision of how it should work.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions