aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2023-11-10 14:59:38 -0800
committerCole Faust <colefaust@google.com>2023-11-10 15:03:37 -0800
commit0fb13522eb32ab6dcee8b1f79b832c1ff8744b8b (patch)
treeb93dc16bcb9e649881601e1254728a899ed4a2d1
parent71ff99d90a971da511bb526b512cd97101e255fc (diff)
downloadpdl-compiler-0fb13522eb32ab6dcee8b1f79b832c1ff8744b8b.tar.gz
Use embedded_launcher: true in python tools
These scripts generate files, and they include the command used to generate them in the file itself. When using a non-embedded-launcher python binary, the binary is a zip file that extracts itself to a temporary folder before running. The temporary folder is non-deterministic, and that non-deterministic path will end up in the file since they write the sys.argv to the file. embedded_launcher binaries do not extract the zip, and thus don't have any non-deterministic paths. Bug: 307824623 Test: Presubmits Change-Id: Ia1d2ab97d587cf2f7a2d7a524b29ad875985577c
-rw-r--r--patches/0001-Add-scripts-Android.bp.patch15
-rw-r--r--scripts/Android.bp15
2 files changed, 30 insertions, 0 deletions
diff --git a/patches/0001-Add-scripts-Android.bp.patch b/patches/0001-Add-scripts-Android.bp.patch
index 2c2b1f9..b5f4f1f 100644
--- a/patches/0001-Add-scripts-Android.bp.patch
+++ b/patches/0001-Add-scripts-Android.bp.patch
@@ -25,6 +25,11 @@ index 0000000..bb0932c
+ "pdl/core.py",
+ "pdl/utils.py",
+ ],
++ version: {
++ py3: {
++ embedded_launcher: true,
++ },
++ },
+}
+
+// C++ generator.
@@ -37,6 +42,11 @@ index 0000000..bb0932c
+ "pdl/core.py",
+ "pdl/utils.py",
+ ],
++ version: {
++ py3: {
++ embedded_launcher: true,
++ },
++ },
+}
+
+// C++ test generator.
@@ -49,6 +59,11 @@ index 0000000..bb0932c
+ "pdl/core.py",
+ "pdl/utils.py",
+ ],
++ version: {
++ py3: {
++ embedded_launcher: true,
++ },
++ },
+}
+
+// C++ packet runtime.
diff --git a/scripts/Android.bp b/scripts/Android.bp
index bb0932c..05bee6b 100644
--- a/scripts/Android.bp
+++ b/scripts/Android.bp
@@ -8,6 +8,11 @@ python_binary_host {
"pdl/core.py",
"pdl/utils.py",
],
+ version: {
+ py3: {
+ embedded_launcher: true,
+ },
+ },
}
// C++ generator.
@@ -20,6 +25,11 @@ python_binary_host {
"pdl/core.py",
"pdl/utils.py",
],
+ version: {
+ py3: {
+ embedded_launcher: true,
+ },
+ },
}
// C++ test generator.
@@ -32,6 +42,11 @@ python_binary_host {
"pdl/core.py",
"pdl/utils.py",
],
+ version: {
+ py3: {
+ embedded_launcher: true,
+ },
+ },
}
// C++ packet runtime.