You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by GitBox <gi...@apache.org> on 2022/12/11 10:31:54 UTC

[GitHub] [buildstream] germinolegrand commented on issue #1758: bst1: Seems buildstream is not compatible with python 3.11

germinolegrand commented on issue #1758:
URL: https://github.com/apache/buildstream/issues/1758#issuecomment-1345515931

   For people like me with bst1 in Fedora 37 and python 3.11 ; i fixed buildstream/element.py with the following:
   
   buildstream/element.py:2370
   ```python
       def __file_is_whitelisted(self, path):
           # Considered storing the whitelist regex for re-use, but public data
           # can be altered mid-build.
           # Public data is not guaranteed to stay the same for the duration of
           # the build, but I can think of no reason to change it mid-build.
           # If this ever changes, things will go wrong unexpectedly.
           if not self.__whitelist_regex:
               bstdata = self.get_public_data('bst')
               whitelist = _yaml.node_get(bstdata, list, 'overlap-whitelist', default_value=[])
               whitelist_expressions = [
                   utils._glob2re(
                       self.__variables.subst(
                           exp.strip(),
                           _yaml.node_get_provenance(bstdata, key='overlap-whitelist', indices=[index])
                       )
                   )[5:] # FIX Skip flags "(?ms)" to avoid "global flags not at the start of the expression at position 4"
                   for index, exp in enumerate(whitelist)
               ]
               expression = ('^(?:' + '|'.join(whitelist_expressions) + ')$')
               self.__whitelist_regex = re.compile(expression, flags=re.M|re.S) # FIX Add global flags
           return self.__whitelist_regex.match(path) or self.__whitelist_regex.match(os.path.join(os.sep, path))
   ```
   
   This allowed me to open my dev_shell successfully.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@buildstream.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org