Skip to content
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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

lucteo
Copy link
Contributor

@lucteo lucteo commented Dec 20, 2024

No description provided.

- quit any IDEs (yes, please do that)
- delete the build folder (e.g., `.build`)
- delete `Package.resolved`
- run `swift package resolve`
Copy link
Collaborator

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.

Copy link
Contributor Author

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
Copy link
Collaborator

@dabrahams dabrahams Dec 20, 2024

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.

Copy link
Contributor Author

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.
Copy link
Collaborator

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.

Copy link
Contributor Author

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.

## 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`.
Copy link
Collaborator

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.

Copy link
Contributor Author

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!

@lucteo lucteo requested a review from dabrahams January 2, 2025 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants