b
.
c
did the 💡 hit you?
b
mayyyyybe
I realized it might be because of my changes
When you mess with dependency inference, all of a sudden your bugs really blow up
💥 1
c
This may be completely off, but in this snippet, I think it would be pretty straight forward how to proceed… (but it sounds like your issue may lay else where..)
Copy code
docker_image_field_values = apply_overrides(
            image_ref,
            overrides,
            {
                "dependencies": [spec_file_address.spec],
                "instructions": [f"FROM {image_ref}"],
                "repository": image_ref.image,
                "tags": ["docker-mirror"],
            },
        )

        # Only set `image_tags` if it where not provided with the `overrides`.
        docker_image_field_values.setdefault("image_tags", [image_ref.tag or "latest"])

        yield DockerImageTarget(
            docker_image_field_values,
            address.create_generated(image_ref.target_name),
            union_membership,
        )


@rule
async def generate_targets_from_docker_mirror_images(
    request: GenerateTargetsFromDockerMirrorImages,
    union_membership: UnionMembership,
) -> GeneratedTargets:
    sources = await Get(
        SourceFiles,
        SourceFilesRequest([request.generator[MirrorImagesSourcesField]]),
    )
    contents = await Get(DigestContents, Digest, sources.snapshot.digest)

    gen = partial(generate_targets, request=request, union_membership=union_membership)
    targets = chain(*[gen(c.path, c.content.decode().split("\n")) for c in contents])
    return GeneratedTargets(request.generator, targets)
b
OK yeah 100% my code 😅
👍 1
LOL it was a stray backslash ruining my strings!
c
haha.. it’s always the smallest typos that causes the most spectacular issues
(chased a hard to reproduce and diagnose bug for months once, all due to missing enclosing () around a bitwise expression macro in C..)
b
C/C++ is a horror story generator.
🤣 2
One of my worst ones is getting different results for a complex equation on two machines. Turns out the debug binary used slower, more precise floating point arithmetic, but the compiler decided that for me 😔
c
😮 indeed, there’s quite a few war stories from that era of my life..