-
Notifications
You must be signed in to change notification settings - Fork 1
Fix lazy compilation of standard lib in -resource-dir
#6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
70b472e
add actions moved from workflow
redsun82 99fafb0
split patches into multiple files and add `patch.sh`
redsun82 a4a0e06
fix lazy swiftinterface compilation for `-resource-dir`
redsun82 d9243ad
remove `swift_tag.txt`
redsun82 c3a3eb7
add explanation to new patch
redsun82 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
PATCH_DIR="$(cd "$(dirname "$0")/patches"; pwd)" | ||
|
||
for patch_subdir in "$PATCH_DIR"/*; do | ||
( | ||
repo="$(basename "$patch_subdir")" | ||
cd "$repo" || exit 0 | ||
echo "patching $repo" | ||
for patch in "$patch_subdir"/*; do | ||
echo " applying $(basename "$patch")" | ||
git apply "$patch" | ||
done | ||
) | ||
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
There are some cases when we extract bad ASTs where we hit this assertion if we compile in debug | ||
mode. This is undesirable. | ||
|
||
diff --git a/include/swift/AST/Stmt.h b/include/swift/AST/Stmt.h | ||
index 532e038c386..f013eee2f98 100644 | ||
--- a/include/swift/AST/Stmt.h | ||
+++ b/include/swift/AST/Stmt.h | ||
@@ -920,7 +920,6 @@ public: | ||
/// Get the CaseStmt block to which the fallthrough transfers control. | ||
/// Set during Sema. | ||
CaseStmt *getFallthroughDest() const { | ||
- assert(FallthroughDest && "fallthrough dest is not set until Sema"); | ||
return FallthroughDest; | ||
} | ||
void setFallthroughDest(CaseStmt *C) { |
15 changes: 3 additions & 12 deletions
15
swift-build-system.patch → .../swift/02-handle-empty-pattern-list.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
patches/swift/03-reinstate-swiftinterface-compilation-for-resource-dir.patch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
When running the extractor against a different version of the swift compiler, we provide it the | ||
original standard library via `-resource-dir`, and we do want that to be lazily compiled out of the | ||
`.swiftinterface` files. The code removed here explicitly disables that behavior. | ||
|
||
diff --git a/lib/Frontend/ModuleInterfaceLoader.cpp b/lib/Frontend/ModuleInterfaceLoader.cpp | ||
redsun82 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
index 2a490a680d8..8d8f48aeed0 100644 | ||
--- a/lib/Frontend/ModuleInterfaceLoader.cpp | ||
+++ b/lib/Frontend/ModuleInterfaceLoader.cpp | ||
@@ -726,21 +726,6 @@ class ModuleInterfaceLoaderImpl { | ||
<< "; deferring to serialized module loader\n"); | ||
UsableModulePath = adjacentMod; | ||
return std::make_error_code(std::errc::not_supported); | ||
- } else if (isInResourceDir(adjacentMod) && | ||
- loadMode == ModuleLoadingMode::PreferSerialized) { | ||
- // Special-case here: If we're loading a .swiftmodule from the resource | ||
- // dir adjacent to the compiler, defer to the serialized loader instead | ||
- // of falling back. This is mainly to support development of Swift, | ||
- // where one might change the module format version but forget to | ||
- // recompile the standard library. If that happens, don't fall back | ||
- // and silently recompile the standard library -- instead, error like | ||
- // we used to. | ||
- LLVM_DEBUG(llvm::dbgs() << "Found out-of-date module in the " | ||
- "resource-dir at " | ||
- << adjacentMod | ||
- << "; deferring to serialized module loader " | ||
- "to diagnose\n"); | ||
- return std::make_error_code(std::errc::not_supported); | ||
} else { | ||
LLVM_DEBUG(llvm::dbgs() << "Found out-of-date module at " | ||
<< adjacentMod << "\n"); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be followed by
cd ..
(or whatever the previous directory was)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, because it's in a
(...)
subshell, so any change of directory is discarded on exit