Skip to content

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

Merged
forki merged 4 commits into
fsprojects:masterfrom
matthid:do_not_write_paket_targets
Jun 24, 2019
Merged

forki merged 4 commits into
fsprojects:masterfrom
matthid:do_not_write_paket_targets

Conversation

@matthid

@matthid matthid commented Jun 21, 2019

Copy link
Copy Markdown
Member

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

matthid commented Jun 21, 2019

Copy link
Copy Markdown
Member Author

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

matthid commented Jun 23, 2019

Copy link
Copy Markdown
Member Author

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
Copy Markdown
Contributor

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

@matthid

matthid commented Jun 23, 2019

Copy link
Copy Markdown
Member Author

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 done
@theimowski

theimowski commented Jul 2, 2019 •

Copy link
Copy Markdown
Member

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

matthid commented Jul 2, 2019

Copy link
Copy Markdown
Member Author

@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
Copy Markdown
Member

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

@theimowski

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