Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Library names do not uniquely identify a library #18

Open
ppannuto opened this issue Jul 2, 2020 · 1 comment
Open

Library names do not uniquely identify a library #18

ppannuto opened this issue Jul 2, 2020 · 1 comment

Comments

@ppannuto
Copy link
Contributor

ppannuto commented Jul 2, 2020

This unfortunate situation is a product of managed libraries. It is valid to have two libraries with the same name in a project:

<library name="regulators">
...
<library name="regulators" urn="urn:adsk.eagle:library:20878889">

where the former is a regular library, and the latter is a managed library.

This results in the "sanity check" producing spurious errors because it only uses the name to search libraries.

  File "/usr/local/lib/python3.7/site-packages/Swoop/Swoop.py", line 48058, in check_sanity
    raise SwoopError("DeviceSet '" + self.find_library().name + ":" + self.deviceset + "' missing for '" + str(self.name) + "'")
Swoop.Swoop.SwoopError: DeviceSet 'regulators:+3V3' missing for 'P+1'

Instead, it needs to use the name plus the urn, but only if the urn exists.
If we look at two parts:

<part name="P+1" library="regulators" deviceset="+3V3" device=""/>
...
<part name="U4" library="regulators" library_urn="urn:adsk.eagle:library:20878889" deviceset="XCL206" device="B" package3d_urn="urn:adsk.eagle:package:20878971/3" value="1.8V"/>

The former is in the "regular library" while the latter is in a "managed library".


How would you get into this mess, you ask? Well, the new integration with Fusion 360 for 3D modeling is really nice, especially if you're trying to fit a board into a case. However, you're only allowed to have 3D packages for parts that are in managed libraries. You would begin by uploading your existing libraries Autodesk's new library service to make them managed libraries (that's how you end up with libraries of the same name). You would then only update the parts that are bigger or near something possibly important, so your old board ends up with a mixture of parts from regular and managed libraries.


What to do? Ideally, Swoop would become aware of managed libraries and use urns as part of the identifier for a library. That's probably the most robust fix. Unfortunately, that's also a bit beyond the scope of what I have the time or energy to do at the moment.

Alternatively, Swoop could simply detect this and print an explanation. Board authors could then in some way fix this conflict -- e.g. perhaps by renaming one of the libraries or by updating all components to be in a managed (or not) library.

@ppannuto
Copy link
Contributor Author

ppannuto commented Jul 2, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant