Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • B buck
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 201
    • Issues 201
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 22
    • Merge requests 22
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • buck
  • Merge requests
  • !2324

SwiftCompile: utilize relative instead of absolute path for shorter swiftc argument character count

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Administrator requested to merge github/fork/airbnb/dfed--relative-path-upstream into master Oct 08, 2019
  • Overview 2
  • Commits 1
  • Pipelines 0
  • Changes 1

Created by: dfed

This PR shortens the paths used in Swift build commands, which is more helpful than it sounds.

Late last week, Airbnb found that some of our swiftc build commands were failing with the following exception:

java.io.IOException: Cannot run program "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc" (in directory "/usr/local/var/buildkite-agent/builds/apps"): error=7, Argument list too long

This was happening because our swiftc commands were longer than ARG_MAX. The primary cause of our swiftc commands being so long is that we had more than 440 modules in our application target.

The argument list included many full paths to our modules, over and over again. This PR resulted in the generated swiftc command using approximately nineteen thousand fewer characters, which enables us to write ~20 more modules before we end up with a compiler command that is too long again. For context, the total character limit is 262144 on the machines we use.

We're working on a longer-term fix, but it seemed reasonable to push this fix back up to Facebook's repo as well.

A quick note to the reviewer: other code in this file is already using relative paths, so this PR helps standardize on using relative paths – we aren't introducing a new concept.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: github/fork/airbnb/dfed--relative-path-upstream