Skip to content

Commit

Permalink
Set PATH_PREFIX=./ instead of failing (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
lalten authored Sep 6, 2024
1 parent 62294c2 commit 427babc
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
3 changes: 1 addition & 2 deletions perl/binary_wrapper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ elif [ -s `dirname $0`/../../MANIFEST ]; then
elif [ -d $0.runfiles ]; then
PATH_PREFIX=`cd $0.runfiles; pwd`/{workspace_name}/
else
echo "WARNING: it does not look to be at the .runfiles directory" >&2
exit 1
PATH_PREFIX=./
fi

export PERL5LIB="$PERL5LIB{PERL5LIB}"
Expand Down
35 changes: 35 additions & 0 deletions test/data_dep/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
genrule(
name = "gen_program_sh",
srcs = ["@genhtml//:genhtml_bin"],
outs = ["program.sh"],
cmd = """\
cat <<"EOF" >$@
#!/bin/bash
set -euxo pipefail
genhtml='$(rootpath @genhtml//:genhtml_bin)'
test "$$("$$genhtml" --version)" == "genhtml: LCOV version 1.0"
EOF
""",
)

sh_binary(
name = "program_bin",
srcs = ["program.sh"],
data = ["@genhtml//:genhtml_bin"],
)

genrule(
name = "gen_program_test_sh",
srcs = [":program_bin"],
outs = ["program_test.sh"],
cmd = """\
echo '#!/bin/sh' >$@
echo 'exec env --ignore-environment test/data_dep/program_bin' >>$@
""",
)

sh_test(
name = "program_test",
srcs = ["program_test.sh"],
data = [":program_bin"],
)

0 comments on commit 427babc

Please sign in to comment.