I also make heavy use of it during development. Because the package manager and Xcode have different ideas about what the working directory for unit tests should be, it is the only way I know to reliably find the package directory in both contexts in order to load/export Git‐tracked specifications.
There is a lot of package testing code out there that relies on things like this:
let packageRoot = URL(fileURLWithPath: #file) .deletingLastPathComponent() .deletingLastPathComponent() .deletingLastPathComponent() let resources = packageRoot.appendingPathComponent("Resources")
However, I agree that there is probably never a good reason to have full paths still kicking around in a binary that will be shipped without its source.
fatalError() and friends are over‐eager about it and also hide what they are doing.
Something should be done, but completely removing the ability to discover the full path even during development would be crippling.