-
Notifications
You must be signed in to change notification settings - Fork 59
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
Start a compiler troubleshooting guide. #1634
base: main
Are you sure you want to change the base?
Conversation
Docs/Compiler/Troubleshooting.md
Outdated
- quit any IDEs (yes, please do that) | ||
- delete the build folder (e.g., `.build`) | ||
- delete `Package.resolved` | ||
- run `swift package resolve` |
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.
You don't need that step; it happens automatically.
You do need a potential step that updates Package.swift
to point at the right version of the external library. It may be that the symbolic reference is currently what you want and that's fine.
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.
Fixed. Thank you.
- delete `Package.resolved` | ||
- run `swift package resolve` | ||
- build with Swift build system (e.g., `swift build -c release`), and ensure everything builds | ||
- build with the CMake system and ensure that everything builds |
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.
You're missing the step that points the CMake builds at the right version of the updated library. That means updating one of the FindXXX
modules in https://github.com/hylo-lang/CMakeModules
Currently Swifty-LLVM points at main
there, which is a little dicey considering that Package.resolved
points to a specific SHA while main
can keep changing. Probably we should repoint the FindXXX
module for Swifty-LLVM at the SHA
as long as we don't have stable tags for it.
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.
I agree that we should not point to main, but this is the current situation. I just wanted to describe the issue I had, which took me several hours to figure out what to do.
|
||
> **_NOTE:_** | ||
> This will most probably update other packages that swift will use. | ||
> This is expected. |
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.
Maybe. The most “responsible” way to do development would be for our Package.swift
and CMake Find modules to always point at stable releases, which in turn should be pointing at stable releases of their dependencies.
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.
This is the current state of affairs, so I documented it. The goal here was to improve the documentation, not the process.
Docs/Compiler/Troubleshooting.md
Outdated
## Updating an external library | ||
|
||
Let's take the example of Swifty-LLVM, which is a Hylo repository for which we always get the latest version from `main`. | ||
For this example, making a change to Swifty-LLVM should be picked up automatically, after the change is submitted to `main`. |
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.
Not really. Package.resolved
is designed to lock dependent projects into specific versions of their dependencies, so things don't start unexpectedly failing due to downstream dependency branch updates.
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.
Added more clarfication. It was indeed badly written. Thank you!
No description provided.