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

Change caching logic to be more suitable for FAKE and in particular the Ionide tooling #3598

Merged
merged 4 commits into from
Jun 24, 2019

Conversation

matthid
Copy link
Member

@matthid matthid commented Jun 21, 2019

This changes some internals with (hopefully) minimal observable impact. The cache now supports multiple different "caching scenarios". This means that we can no detect if the .nuget/packages folder is up to date separately from if we have written new SDK restore files.
I left it the same single file because otherwise, we would have problems with .gitignore and user education again :). But the format changed now to a JSON file and we only store the hash within.

Why?

After adding FAKE support into Ionide I noticed paket.restore.targets is written by paket.core (which is used by the Fake.Runtime, which is used to provide Ionide support).
To solve this (and potentially some reported issues in FAKE as well). I refactored the restore process to allow a SimpleRestore (new public API), all this does is restoring packages into the NuGet cache.
I could have tried to no use the cache when in Ionide or FAKE. But then the performance could be a problem. Hence this PR.

FAKE and in particular the Ionide tooling
@matthid
Copy link
Member Author

matthid commented Jun 21, 2019

To unblock myself I uploaded Paket.Core in an alpha version.
This is nice in case this breaks someone and needs to be reverted.

@matthid
Copy link
Member Author

matthid commented Jun 23, 2019

Ok, I added the PAKET_SKIP_RESTORE_TARGETS environment variable to skip paket.restore.targets extraction. This would have been helpful in analysing and to workaround issues like #3599

There are now just too many places where paket writes that file and that makes it impossible to quickly add a warning message into the targets file ...

@BlythMeister
Copy link
Contributor

Me: adds set environment variable to start of build batch file. 🤣

@matthid
Copy link
Member Author

matthid commented Jun 23, 2019

I don't think the failure is related to my last commit (which basically should be a noop as long as the environment variable is not set).

@forki forki merged commit a63f745 into fsprojects:master Jun 24, 2019
@matthid matthid mentioned this pull request Jul 1, 2019
2 tasks
@theimowski
Copy link
Member

theimowski commented Jul 2, 2019

The automatic extraction of Paket.Restore.targets breaks building SAFE Template projects if someone doesn't have Paket installed as global tool.
Can't rely on the environment variable really, as we use global fake to restore paket and suggest using fake build - is there any other way to disable automatic targets file extraction?

Edit: turned out it's not automatic extraction of targets file, but rather some change in FAKE between 5.13 and 5.15.1

@matthid
Copy link
Member Author

matthid commented Jul 2, 2019

@theimowski note that the extraction was not added with this PR.

is there any other way to disable automatic targets file extraction?

You mean in FAKE, correct?

if someone doesn't have Paket installed as global tool.

How is that even related to paket as global tool?

@theimowski
Copy link
Member

Sorry I was wrong - edited my comment, I'll create a new issue in FAKE repository

@theimowski
Copy link
Member

fsprojects/FAKE#2348

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.

4 participants