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

Malformed bindep.txt files do not halt execution #90

Open
AlanCoding opened this issue Aug 21, 2020 · 4 comments
Open

Malformed bindep.txt files do not halt execution #90

AlanCoding opened this issue Aug 21, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@AlanCoding
Copy link
Member

See #89

We don't know how to determine of the bindep CLI command is successful in finding the missing deps, or if it has erred.

@AlanCoding AlanCoding added bug Something isn't working state:blocked This Issue or PR is blocked priority:medium labels Aug 21, 2020
@AlanCoding
Copy link
Member Author

Issue was filed upstream for bindep here https://storyboard.openstack.org/#!/story/2008049

Ping @pabelanger, this can create situations which are really difficult to debug. I mainly hit it where it would error without a trailing newline at the end of the input bindep.txt file (but there are many other things that can go wrong, from collection bindep.txt files). It keeps running deep into the build process because there's no indicator to alert the code to the error (meaning of return code is overloaded for other purpose), and by the time it does error it is a nightmare to figure out. This is a big part of the reason we write the intermediary files like bindep_combined.txt - because this file might contain an error dump from the bindep CLI, and there's no way for the user to know. I would say that assemble becomes obligated to handle these errors, but I honestly don't think it can because this is a pretty fundamental problem.

@AlanCoding
Copy link
Member Author

I'm increasingly thinking that the best solution is to make ansible-builder depend on bindep as a python package and call it directly in code.

    if depends is None:
        depends = bindep.depends.get_depends(args.filename)
        if not depends:
            return 1

    if args.profiles:
        logging.info("Platform profiles:")
        for profile in depends.platform_profiles():
            logging.info("%s", profile)
        logging.info("")
        logging.info("Configuration profiles:")
        for profile in depends.profiles():
            logging.info("%s", profile)
        return 0

The cases which are actually painful for us look like fairly intentional return 1 or 0 cases in code, and we could error handle just fine if we were doing this in python, IMO.

But now we're calling this via the assemble script, and this leads back to my idea that we may be better off to combine those with introspect to create multiple documented tools with a CLI to go with them.

@AlanCoding
Copy link
Member Author

I am likely to combine this with #201

@felixfontein
Copy link
Contributor

Hmm, I think I also encountered that: https://github.com/ansible-collections/community.sops/runs/6039420137?check_suite_focus=true

I had URLs in my bindep.txt file, which made bindep barf, but the build process just continued and ended with Complete!. (Obviously the dependency wasn't in the EE image and thus the tests expecting it to be there failed...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants