Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

modifying pruning logic to less aggressively purge files after publish #2953

Merged
merged 1 commit into from
Oct 21, 2015

Conversation

JunTaoLuo
Copy link
Contributor

@JunTaoLuo
Copy link
Contributor Author

I'm not sure if checking in *.nupkg* into misc for use in tests is a good idea and if not, I can just create test package on the fly. I didn't since it took extra steps in terms of pack, package add, which are not really relevant to the what the test is for.


foreach (var path in library.RuntimeAssemblies)
{
keep.Add(CombinePath(packagesDir, path));
keep.Add(Path.Combine(packagesDir, Path.GetDirectoryName(path)));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of collecting files to keep, this collects TFMs. An alternative is to compare the lock files of the original project and the published output. Or some kind of fuzzy best match to figure it out from the TFM of the published lockfile.

@JunTaoLuo
Copy link
Contributor Author

I have the fix in #2932 but the test hanged on linux again 😲 :trollface:
looks like the DTH tests didn't even get a chance to start.

@troydai @pakrym

}
catch
{
continue;
Copy link
Contributor

Choose a reason for hiding this comment

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

can this really happen? and if this does can it really be ignored?

@troydai
Copy link
Contributor

troydai commented Oct 12, 2015

We shouldn't check in binary files. For testing nupkg we can generate it on the fly.

@JunTaoLuo JunTaoLuo force-pushed the johluo/2850-less-aggressive-postpublish-pruning branch 7 times, most recently from 7b9f858 to 6ff3e85 Compare October 14, 2015 17:32
@@ -33,11 +34,12 @@ public PublishRoot(Runtime.Project project, string outputPath, IServiceProvider
TargetRuntimesPath = Path.Combine(outputPath, AppRootName, "runtimes");
Operations = new PublishOperations();
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will remove spacing

@JunTaoLuo JunTaoLuo force-pushed the johluo/2850-less-aggressive-postpublish-pruning branch from 6ff3e85 to d060c2b Compare October 14, 2015 18:11
@JunTaoLuo
Copy link
Contributor Author

Note that if you publish without restoring, no lock file will be generated for the main project and no pruning will occur.

{
// 'shared' folder is build time dependency, so we only copy it when deploying with source
specialFolders.Add("shared");
return true;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe we should remove the return value for PrunePackages. There are no cases for which we want to report a non-successful pruning that stops further publishing progress. If there are problems, such as no lock file in the main project, just don't prune anything.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good.

@JunTaoLuo JunTaoLuo force-pushed the johluo/2850-less-aggressive-postpublish-pruning branch from cc98ec7 to 02390ff Compare October 14, 2015 20:54
@JunTaoLuo
Copy link
Contributor Author

ping @davidfowl @moozzyk @troydai

var specialFolderPath = CombinePath(packagesDir, specialFolder);
foreach (var target in root.MainProjectLockFile.Targets.Where(projectTarget =>
!root.PublishedLockFile.Targets.Any(publishTarget =>
projectTarget.TargetFramework == publishTarget.TargetFramework)))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only pruning by TFM. Maybe we should prune by RID if one is specified as well?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe move this into a method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Difficult to do lockfile based RID filtering for now since the published project is not restored with the runtimes specified by publish. Could potentially revisit this once publish is refactored to be based on lock file.

@JunTaoLuo
Copy link
Contributor Author

ping @moozzyk @anurse @troydai @davidfowl

@troydai
Copy link
Contributor

troydai commented Oct 16, 2015

:shipit:

@JunTaoLuo JunTaoLuo force-pushed the johluo/2850-less-aggressive-postpublish-pruning branch 2 times, most recently from 4b094ad to dba7778 Compare October 18, 2015 23:33
@davidfowl
Copy link
Member

:shipit:

@JunTaoLuo JunTaoLuo force-pushed the johluo/2850-less-aggressive-postpublish-pruning branch from 310ad1d to 1d45291 Compare October 20, 2015 23:58
@JunTaoLuo JunTaoLuo merged commit 1d45291 into dev Oct 21, 2015
@JunTaoLuo JunTaoLuo deleted the johluo/2850-less-aggressive-postpublish-pruning branch October 24, 2015 04:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants