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

   Reading the element.py on master it seems this exact problem is solved (by 
not using yaml at all) in bst2.
   
   ```python
       # _file_is_whitelisted()
       #
       # Checks if a file is whitelisted in the overlap whitelist
       #
       # This is only internal (one underscore) and not locally private
       # because it needs to be proxied through ElementProxy.
       #
       # Args:
       #    path (str): The path to check
       #
       # Returns:
       #    (bool): True of the specified `path` is whitelisted
       #
       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 = bstdata.get_sequence("overlap-whitelist", default=[])
               whitelist_expressions = 
[utils._glob2re(self.__variables.subst(node)) for node in whitelist]
               expression = "^(?:" + "|".join(whitelist_expressions) + ")$"
               self.__whitelist_regex = re.compile(expression, re.MULTILINE | 
re.DOTALL)
           return self.__whitelist_regex.match(os.path.join(os.sep, path))
   ```
   
   Git blame shows it was this commit that fixed it in utils._glib2re which was 
the culprit :
   
   
https://github.com/apache/buildstream/commit/782555a674de2ab6f1760f13c4a1b17400f64533#diff-ddfabb836a421fd2981aea75354b2c11dba5343df2543c56124a8393aa651cc5
   
   This is a much better fix than mine.


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to