File: do_not_capture_full_file_path.patch

package info (click to toggle)
ispc 1.28.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 97,620 kB
  • sloc: cpp: 77,067; python: 8,303; yacc: 3,337; lex: 1,126; ansic: 631; sh: 475; makefile: 17
file content (37 lines) | stat: -rw-r--r-- 1,588 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From: Francois Mazen <mzf@debian.org>
Date: Tue, 23 Jul 2024 18:27:23 +0200
Subject: Do not write full file path to avoid reproducibility issue.

Some packages like ospray uses ispc to generate some optimized headers.
If ispc write the whole file path it creates a reproducibility issue for these
packages.

Forwarded: no
---
 src/header.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/header.cpp b/src/header.cpp
index 2b5c9fb..92bd2db 100644
--- a/src/header.cpp
+++ b/src/header.cpp
@@ -942,7 +942,8 @@ bool Module::writeHeader() {
         return false;
     }
 
-    fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", output.header.c_str());
+    auto [directory, filename] = GetDirectoryAndFileName("", output.header.c_str());
+    fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", filename.c_str());
     fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n");
 
     writeHeader(f);
@@ -986,7 +987,8 @@ bool Module::writeDispatchHeader(DispatchHeaderInfo *DHI) {
     reportInvalidSuffixWarning(DHI->fn, OutputType::Header);
 
     if (DHI->EmitFrontMatter) {
-        fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", DHI->fn);
+        auto [directory, filename] = GetDirectoryAndFileName("", DHI->fn);
+        fprintf(f, "//\n// %s\n// (Header automatically generated by the ispc compiler.)\n", filename.c_str());
         fprintf(f, "// DO NOT EDIT THIS FILE.\n//\n\n");
     }
     // Create a nice guard string from the filename, turning any