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

Fix Scala Native directory project caching #641

Merged
merged 4 commits into from
Feb 16, 2022

Conversation

jchyb
Copy link
Contributor

@jchyb jchyb commented Feb 9, 2022

Previously if scala-cli run srcDir --native was run, only the initial project would be cached and used, with following changes to the codebase being ignored.

Copy link
Contributor

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

It would be neat to have a non-regression test for that.

@jchyb jchyb marked this pull request as draft February 9, 2022 10:01
@jchyb
Copy link
Contributor Author

jchyb commented Feb 9, 2022

Sure! I'll add some tests

@jchyb jchyb marked this pull request as ready for review February 10, 2022 10:41
Copy link
Contributor

@alexarchambault alexarchambault left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can address the point in my comment in another PR…

}
Iterator(elem.path.toString, content, "\n").map(bytes)
Iterator((elem.path.toString +: content :+ "\n"): _*).map(bytes)
Copy link
Contributor

@alexarchambault alexarchambault Feb 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to build a new string here, only to convert it to bytes from the iterator later on. This should have worked:

Suggested change
Iterator((elem.path.toString +: content :+ "\n"): _*).map(bytes)
(Iterator(elem.path.toString) ++ content.iterator ++ Iterator("\n")).map(bytes)

@lwronski lwronski merged commit d479dbf into VirtusLab:main Feb 16, 2022
romanowski pushed a commit to romanowski/scala-cli that referenced this pull request Mar 10, 2022
* Fix Scala Native directory project caching

* Adjust SN caching tests to test directory caching

* run scalafmt

* Add iterators instead of converting to string
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.

None yet

4 participants