Skip to content

Commit

Permalink
Ensure that intermediate outputs created for Swift source files (such…
Browse files Browse the repository at this point in the history
… as object files) do not have spaces in their names.

This was already handled for basenames, but not for directory names between the target's package and the file; for example, if one had `swift_library(name = "ArgumentParser", ...)` in a `BUILD` file that also contained `Sources/ArgumentParser/Parsable Types/ParsableCommand.swift`.

PiperOrigin-RevId: 329799243
  • Loading branch information
allevato authored and keith committed Sep 2, 2020
1 parent 53ee8ea commit 0622893
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions swift/internal/derived_files.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,10 @@ def _intermediate_frontend_file_path(target_name, src):
target and source file should be stored.
"""
objs_dir = "{}_objs".format(target_name)
owner_rel_path = owner_relative_path(src)

# TODO(b/131185317): Remove this once ar_wrapper handles filenames with
# spaces correctly.
safe_name = src.basename.replace(" ", "__SPACE__")
owner_rel_path = owner_relative_path(src).replace(" ", "__SPACE__")
safe_name = paths.basename(owner_rel_path)

return paths.join(objs_dir, paths.dirname(owner_rel_path)), safe_name

def _intermediate_object_file(actions, target_name, src):
Expand Down

0 comments on commit 0622893

Please sign in to comment.