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

Eliminate codespan dependency #425

Merged
merged 18 commits into from
Jan 20, 2025
Merged

Eliminate codespan dependency #425

merged 18 commits into from
Jan 20, 2025

Conversation

BinderDavid
Copy link
Collaborator

@BinderDavid BinderDavid commented Dec 26, 2024

During parsing we annotate every syntax node with a Span which consists of two byte-indizes which measure the distance to the beginning of the document in bytes. We later need to convert these Spans to a new format which takes line-endings into account and uses positions with line and column numbers; this format is used by the miette error reporting library and by the LSP protocol.

So far we used the codespan library to perform these transformations, but due to the fact that we needed to change internal representations we used our own fork at www.github.com/polarity-lang/codespan. This is problematic because we cannot publish polarity on www.crates.io if we have dependencies which are not themselves on crates.io. This PR therefore inlines the few parts of the codespan library that we actually need in the codebase: the conversions of different position/span/range representations.

This repository is currently dual-licensed using both the Apache-2.0 and the MIT license, whereas the codespan library is mono-licensed as Apache-2.0. We will therefore ask the contributors of the codespan library if they agree to also grant us a MIT license for their respective contributions.

@BinderDavid
Copy link
Collaborator Author

We probably can remove this:

"codespan-0.11.1" = "sha256-Wq99v77bqSGIOK/iyv+x/EG1563XSeaTDW5K2X3kSXU=";

@BinderDavid BinderDavid force-pushed the inline-codespan-dependency branch from ccc01ca to b9c777c Compare December 29, 2024 19:25
@BinderDavid BinderDavid changed the title Inline codespan dependency Eliminate codespan dependency Jan 4, 2025
@BinderDavid BinderDavid force-pushed the inline-codespan-dependency branch 2 times, most recently from bac3ccb to eb52c3b Compare January 8, 2025 11:04
@BinderDavid BinderDavid marked this pull request as ready for review January 8, 2025 11:44
@BinderDavid BinderDavid force-pushed the inline-codespan-dependency branch from bb4718e to 6b2fb8c Compare January 16, 2025 12:19
@BinderDavid
Copy link
Collaborator Author

BinderDavid commented Jan 16, 2025

Hello @Johann150 @Marwes @brendanzab @jyn514 @etaoins

In the description #425 (comment) above we describe why we would like to inline some code from the codespan library into this repository. Since we would like the entire codebase to be licensed under the same conditions we would need your agreement to grant us the rights to use your code additionally under the MIT license. If all of you agree, then I will add a comment on top of the file lang/driver/src/codespan.rs and lang/miette_util/src/codespan.rs which identifies you as the authors of those files and merge this PR.

If you agree to this, then please respond with a short comment "I do agree to license my contributions contained in this PR under the MIT license to the polarity project".

Many thanks in advance :D

(We used the git history to identify you as contributers which changed the code contained within this PR)

@Marwes
Copy link

Marwes commented Jan 16, 2025

I do agree to license my contributions contained in this PR under the MIT license to the polarity project

3 similar comments
@jyn514
Copy link

jyn514 commented Jan 16, 2025

I do agree to license my contributions contained in this PR under the MIT license to the polarity project

@etaoins
Copy link

etaoins commented Jan 17, 2025

I do agree to license my contributions contained in this PR under the MIT license to the polarity project

@brendanzab
Copy link

I do agree to license my contributions contained in this PR under the MIT license to the polarity project

@Johann150
Copy link

I agree to relicense my contributions too. There's not much difference between the licenses in practice anyway and I'm surprised it isn't dual-licensed in the first place.

@brendanzab
Copy link

More my fault than anything 😔

@BinderDavid BinderDavid force-pushed the inline-codespan-dependency branch from 6b2fb8c to 0a85bc4 Compare January 20, 2025 10:56
@BinderDavid BinderDavid merged commit 6ba4bcb into main Jan 20, 2025
12 checks passed
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.

7 participants