Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions tests/test_other.py
Original file line number Diff line number Diff line change
Expand Up @@ -7371,15 +7371,14 @@ def test_emar_duplicate_inputs(self):
create_file('file1', ' ')
self.run_process([EMAR, 'cr', 'file1.a', 'file1', 'file1'])

# Temporarily disabled to allow this llvm change to roll
# https://reviews.llvm.org/D69665
@no_windows('Temporarily disabled under windows')
def test_emar_response_file(self):
# Test that special character such as single quotes in filenames survive being
# sent via response file
create_file("file'1", ' ')
create_file("file'2", ' ')
building.emar('cr', 'libfoo.a', ("file'1", "file'2"))
create_file("hyvää päivää", ' ')
create_file("snowman freezes covid ☃ 🦠", ' ')
building.emar('cr', 'libfoo.a', ("file'1", "file'2", "hyvää päivää", "snowman freezes covid ☃ 🦠"))

def test_archive_empty(self):
# This test added because we had an issue with the AUTO_ARCHIVE_INDEXES failing on empty
Expand Down
8 changes: 6 additions & 2 deletions tools/response_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import os
import shlex
import tempfile
from .utils import WINDOWS


DEBUG = int(os.environ.get('EMCC_DEBUG', '0'))
Expand All @@ -21,7 +22,10 @@ def create_response_file(args, directory):
response_fd, response_filename = tempfile.mkstemp(prefix='emscripten_', suffix='.rsp', dir=directory, text=True)

# Backslashes and other special chars need to be escaped in the response file.
escape_chars = ('\\', '\"', '\'')
escape_chars = ['\\', '\"']
# When calling llvm-ar on Linux and macOS, single quote characters ' should be escaped.
if not WINDOWS:
escape_chars += ['\'']

def escape(arg):
for char in escape_chars:
Expand All @@ -39,7 +43,7 @@ def escape(arg):
with os.fdopen(response_fd, 'w') as f:
f.write(contents)
if DEBUG:
logging.warning('Creating response file ' + response_filename + ': ' + contents)
logging.warning('Creating response file ' + response_filename + ' with following contents: ' + contents)

# Register the created .rsp file to be automatically cleaned up once this
# process finishes, so that caller does not have to remember to do it.
Expand Down