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

Gencopy panic #188

Open
pcj opened this issue Oct 21, 2021 · 1 comment
Open

Gencopy panic #188

pcj opened this issue Oct 21, 2021 · 1 comment

Comments

@pcj
Copy link
Member

pcj commented Oct 21, 2021

on v2_prerelease branch:

        for f in info.outputs:
            print("checking info", f.path)
            dsts.append(f.short_path)
            path = f.short_path.split(ctx.attr.original_label_name + "_")[0]
            file = f.short_path[f.short_path.rfind("/") + 1:]

            # srcs.append(path + file)
            srcs.append(f.basename)
            # srcs.append(ctx.label.package + "/" + f.basename)

        config.packageConfigs.append(
            struct(
                targetLabel = str(info.label),
                # targetPackage = info.label.package,
                generatedFiles = dsts,
                # sourceFiles = srcs,
            ),
        )
panic: runtime error: index out of range [0] with length 0

goroutine 1 [running]:
main.runPkg(0xc0001282a0, 0xc00012e0f0, 0x10f9485, 0xc000128120)
	external/build_stack_rules_proto/cmd/gencopy/gencopy.go:170 +0x4af
main.run(0xc0001282a0, 0x3a, 0xc0001282a0)
	external/build_stack_rules_proto/cmd/gencopy/gencopy.go:192 +0x70
main.main()
	external/build_stack_rules_proto/cmd/gencopy/gencopy.go:235 +0x145
@pcj
Copy link
Member Author

pcj commented Jan 29, 2022

If the srcs and dsts are unbalanced, program will panic

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