Browse Source

Fix source file path emission in RESOURCE_FILES
commit_hash:9115d73d37586182bb7fc9ba45235d78af8c3316

spreis 5 months ago
parent
commit
11097c2577
2 changed files with 26 additions and 2 deletions
  1. 21 0
      build/plugins/_common.py
  2. 5 2
      build/plugins/res.py

+ 21 - 0
build/plugins/_common.py

@@ -208,3 +208,24 @@ def get_no_lint_value(unit):
     if no_lint_value and no_lint_value not in supported_no_lint_values:
         ymake.report_configure_error('Unsupported value for NO_LINT macro: {}'.format(no_lint_value))
     return no_lint_value
+
+
+def ugly_conftest_exception(path):
+    """
+    FIXME:
+    TAXICOMMON-9288: Taxi abused bug with absolute paths and built conftest descovery upon it
+    until the issue is filed let's limit impact only to existing files.
+    Never let this list grow!!! Fix issue before adding any new violating conftests
+    """
+    exceptions = [
+        'taxi/uservices/userver-arc-utils/functional_tests/basic/conftest.py',
+        'taxi/uservices/userver-arc-utils/functional_tests/basic_chaos/conftest.py',
+        'taxi/uservices/userver-arc-utils/functional_tests/json2yaml/conftest.py',
+    ]
+
+    if not path.endswith('conftest.py'):
+        return False
+    for e in exceptions:
+        if path.endswith(e):
+            return True
+    return False

+ 5 - 2
build/plugins/res.py

@@ -1,7 +1,7 @@
 import json
 import os
 import six
-from _common import rootrel_arc_src
+from _common import rootrel_arc_src, ugly_conftest_exception
 import ymake
 
 
@@ -65,7 +65,10 @@ def onresource_files(unit, *args):
                     ['warn', "Duplicated resource file {} in RESOURCE_FILES() macro. Skipped it.".format(path)]
                 )
                 continue
-            src = 'resfs/src/{}={}'.format(key, rootrel_arc_src(path, unit))
+            if not ugly_conftest_exception(path):
+                src = 'resfs/src/{}=${{rootrel;input;context=TEXT:"{}"}}'.format(key, path)
+            else:
+                src = 'resfs/src/{}={}'.format(key, rootrel_arc_src(path, unit))
             res += ['-', src, path, key]
 
     if unit.enabled('_GO_MODULE'):