always use unix file endings when building libfuzzer-qemu wrappers (#782)

This commit is contained in:
bmc-msft
2021-04-09 09:56:56 -04:00
committed by GitHub
parent 80b3533f83
commit bf5f3d0ebb

View File

@ -626,7 +626,7 @@ class Libfuzzer(Command):
with tempfile.TemporaryDirectory() as tempdir: with tempfile.TemporaryDirectory() as tempdir:
if sysroot: if sysroot:
setup_path = File(os.path.join(tempdir, "setup.sh")) setup_path = File(os.path.join(tempdir, "setup.sh"))
with open(setup_path, "w") as handle: with open(setup_path, "w", newline="\n") as handle:
sysroot_filename = helper.target_exe_blob_name(sysroot, None) sysroot_filename = helper.target_exe_blob_name(sysroot, None)
handle.write( handle.write(
"#!/bin/bash\n" "#!/bin/bash\n"
@ -638,7 +638,7 @@ class Libfuzzer(Command):
) )
wrapper_path = File(os.path.join(tempdir, wrapper_name)) wrapper_path = File(os.path.join(tempdir, wrapper_name))
with open(wrapper_path, "w") as handle: with open(wrapper_path, "w", newline="\n") as handle:
handle.write( handle.write(
"#!/bin/bash\n" "#!/bin/bash\n"
'SETUP_DIR=$(dirname "$(readlink -f "$0")")\n' 'SETUP_DIR=$(dirname "$(readlink -f "$0")")\n'
@ -648,7 +648,7 @@ class Libfuzzer(Command):
upload_files = [setup_path, wrapper_path, sysroot] upload_files = [setup_path, wrapper_path, sysroot]
else: else:
setup_path = File(os.path.join(tempdir, "setup.sh")) setup_path = File(os.path.join(tempdir, "setup.sh"))
with open(setup_path, "w") as handle: with open(setup_path, "w", newline="\n") as handle:
handle.write( handle.write(
"#!/bin/bash\n" "#!/bin/bash\n"
"set -ex\n" "set -ex\n"
@ -656,7 +656,7 @@ class Libfuzzer(Command):
) )
wrapper_path = File(os.path.join(tempdir, wrapper_name)) wrapper_path = File(os.path.join(tempdir, wrapper_name))
with open(wrapper_path, "w") as handle: with open(wrapper_path, "w", newline="\n") as handle:
handle.write( handle.write(
"#!/bin/bash\n" "#!/bin/bash\n"
'SETUP_DIR=$(dirname "$(readlink -f "$0")")\n' 'SETUP_DIR=$(dirname "$(readlink -f "$0")")\n'