1717# This file contains rules for for our UI builds.
1818
1919ui_shared_cmds_start = [
20+ "set -x" ,
2021 'export BASE_PATH="$(pwd)"' ,
21- "export PATH=/usr/local/bin:/opt/px_dev/tools/node/bin:$PATH" ,
22- 'export HOME="$(mktemp -d)"' , # This makes node-gyp happy.
22+ "export PATH=/opt/px_dev/tools/node/bin:/usr/local/bin:$PATH" ,
23+ "hash -r" ,
24+ 'export HOME="$(mktemp -d)"' ,
2325 'export TMPPATH="$(mktemp -d)"' ,
2426]
2527
@@ -49,6 +51,7 @@ def _pl_webpack_deps_impl(ctx):
4951 execution_requirements = {tag : "" for tag in ctx .attr .tags },
5052 outputs = [out ],
5153 command = " && " .join (cmd ),
54+ use_default_shell_env = True ,
5255 progress_message =
5356 "Generating webpack deps %s" % out .short_path ,
5457 )
@@ -72,8 +75,8 @@ def _pl_webpack_library_impl(ctx):
7275 # and apply it to the environment here. Hopefully,
7376 # no special characters/spaces/quotes in the results ...
7477 env_cmds = [
75- '$(sed -E "s/^([A-Za-z_]+ )\\ s* (.*)/export \\ 1=\\ 2/g " "{}")' .format (ctx .info_file .path ),
76- '$(sed -E "s/^([A-Za-z_]+ )\\ s* (.*)/export \\ 1=\\ 2/g " "{}")' .format (ctx .version_file .path ),
78+ '$(sed -E -n "s/^(STABLE_BUILD_TAG|BUILD_TIMESTAMP )\\ s+ (.*)/export \\ 1=\\ 2/p " "{}")' .format (ctx .info_file .path ),
79+ '$(sed -E -n "s/^(STABLE_BUILD_TAG|BUILD_TIMESTAMP )\\ s+ (.*)/export \\ 1=\\ 2/p " "{}")' .format (ctx .version_file .path ),
7780 ]
7881 all_files .append (ctx .info_file )
7982 all_files .append (ctx .version_file )
@@ -95,6 +98,7 @@ def _pl_webpack_library_impl(ctx):
9598 execution_requirements = {tag : "" for tag in ctx .attr .tags },
9699 outputs = [out ],
97100 command = " && " .join (cmd ),
101+ use_default_shell_env = True ,
98102 progress_message =
99103 "Generating webpack bundle %s" % out .short_path ,
100104 )
@@ -170,6 +174,7 @@ def _pl_deps_licenses_impl(ctx):
170174 execution_requirements = {tag : "" for tag in ctx .attr .tags },
171175 outputs = [out ],
172176 command = " && " .join (cmd ),
177+ use_default_shell_env = True ,
173178 progress_message =
174179 "Generating licenses %s" % out .short_path ,
175180 )
0 commit comments