Commit Graph

12 Commits

Author SHA1 Message Date
Paolo Tranquilli
20eaa34485 Swift: failing tests for linkage awareness 2023-01-18 10:07:46 +01:00
Paolo Tranquilli
874fe2b8f9 Swift: introduce an in-memory file hash cache
File hashing is now done internally in `SwiftFileInterception` (and
exported as a `getHashOfRealFile` function for future use in linkage
awareness), and using a per-process in-memory cache. The persistent
caching of paths is removed, so the solution is now robust against input
file changes during the build.

For the same reason, the hash to artifact mapping have the symlinks
reversed now. The artifacts themselves are stored using the hash as
filenames, and the original paths of the artifacts are reacreated in the
scratch dir with symlinks mostly for debugging purposes (to understand
what artifact each hash corresponds to, and to follow what was built by
the extractor).
2023-01-16 12:05:36 +01:00
Paolo Tranquilli
3084eda28a Swift: add swiftmodule hash map testing to frontend_invocations 2022-12-15 10:33:47 +01:00
Paolo Tranquilli
14fd89d482 Swift: generalize output redirection code 2022-12-14 18:26:48 +01:00
Paolo Tranquilli
4a41bb4061 Merge branch 'main' into redsun82/swift-open-redirection 2022-12-09 09:59:21 +01:00
Paolo Tranquilli
935e264f24 Swift: add empty directory marker 2022-12-08 17:04:56 +01:00
Paolo Tranquilli
bf1b32f210 Swift: rework file redirection
The hash map mechanism that was already in use for reading swiftmodule
files on macOS is now in use also on Linux. The output replacing
mechanism has been also reworked so that:
* frontend module emission modes have the remapping done directly in
  the internal frontend options instead of painstakingly modifying input
  flags (this requires a patch on the swift headers though)
* object emission mode is silenced to be just a type checking pass,
  thus producing no output files
* all other passes but some debugging and version related ones become
  noops

The open file read redirection uses a global weak pointer instance to
maximize robustness in the face of possibly multi-threaded calls to open
happening while `main` is exiting. Possibly overkill, but better safe
than sorry.
2022-12-08 16:10:44 +01:00
Paolo Tranquilli
1ba8b6d35a Swift: fix extraction of sources from .. 2022-12-08 15:57:57 +01:00
Paolo Tranquilli
4e29ff1d6e Swift: add -merge-modules to frontend-invocations test
Also, moved from Makefile to a bash source.
2022-11-30 17:46:47 +01:00
Paolo Tranquilli
635391eae8 Swift: autopep8 integration tests 2022-11-15 15:43:05 +01:00
Paolo Tranquilli
ced36ffc61 Swift: run swift instead of swift-frontend on Linux 2022-08-26 12:12:21 +02:00
Paolo Tranquilli
c7c42acbf5 Swift: port frontend-invocations test to linux
`swift-frontend` will be in `$PATH` on Linux, and apparently it does
not require the `-sdk` option.
2022-08-26 12:03:18 +02:00