Skip to content

Missing exported lib is only a warning, so a half-built package looks like success #27

Description

@battlesnake

Hey, first off thanks for mama. It quietly does a ton of work across our repos and mostly just gets out of the way, which is exactly the point.

Ran into a head-scratcher today and I think it comes down to one small spot in package.py, so I wanted to jot it down while it's fresh.

I ended up with a dependency whose static lib never actually got built (partly our fault, a stale build dir on our side). The thing is, mama's export step noticed the lib was missing but just logged it and carried on:

# mama/package.py, export_lib()
else:
    console(f'export_lib failed to find: {path}')

So the package reported as exported/deployed just fine, everything looked green, and the build happily went on to compile our whole app. It only fell over at the very end, at the final link, with a big pile of undefined symbols. That took a good while to trace back to the one missing .a from way earlier.

What bit me is that it's non-fatal: a target that is told to export libFoo.a but can't find libFoo.a still counts as a success, and the real failure shows up minutes later and a repo away, where it's much harder to connect back to the cause.

One small idea, if you think it's worth it: treat a missing export_lib as an error right there (or mark the target as not-actually-built so it rebuilds next pass), instead of a console warning. If some targets legitimately export optional libs, maybe an opt-in required=True on export_lib would keep both behaviours.

Nothing urgent, and I fully expect there's some history here I'm not seeing. Just figured a quick heads up might save the next person the same evening I had. Thanks again, it's a genuinely handy tool.

(Seen with mama 0.12.10; the same export_lib shape is in current main too.)

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