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

get_bootstrap_from_recipes() result consistency #1875

Closed
AndreMiras opened this issue Jun 20, 2019 · 2 comments · Fixed by #1887
Closed

get_bootstrap_from_recipes() result consistency #1875

AndreMiras opened this issue Jun 20, 2019 · 2 comments · Fixed by #1887

Comments

@AndreMiras
Copy link
Member

In #1872 (comment) we realised get_bootstrap_from_recipes() was not always returning consistent result across setups.
This is an investigation task to determine if it's a bug or a feature and if it's a bug to fix it.

@AndreMiras
Copy link
Member Author

Basically on my setup and in 0c9ef2e calling list(Bootstrap().list_bootstraps()) returns the following: ['webview', 'sdl2', 'service_only', 'empty'] I guess for @opacam and Travis it returned something with "service_only" being first.

@ghost
Copy link

ghost commented Jun 26, 2019

@AndreMiras listdir depends on inode ordering and is not alphabetically sorted:

    @classmethod
    def list_bootstraps(cls):
        '''Find all the available bootstraps and return them.'''
        forbidden_dirs = ('__pycache__', 'common')
        bootstraps_dir = join(dirname(__file__), 'bootstraps')
        for name in listdir(bootstraps_dir):
            if name in forbidden_dirs:
                continue
            filen = join(bootstraps_dir, name)
            if isdir(filen):
                yield name

I think a simple sorted(listdir(bootstraps_dir)) may fix it and make it behave deterministically

AndreMiras added a commit that referenced this issue Jul 9, 2019
Fix Bootstrap.get_bootstrap_from_recipes() so it's smarter and deterministic, fixes #1875
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant