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

Paket pack seems to evaluate all templates it finds even when using the --template switch #2765

Closed
wastaz opened this issue Sep 14, 2017 · 4 comments · Fixed by #2769
Closed

Comments

@wastaz
Copy link

wastaz commented Sep 14, 2017

Description

When running paket pack with the --template switch it seems that paket still goes looking at other paket.template files than the one provided. This is all fine as long as all other paket.template files it can find are ok, but if for some reason they arent (in this case because of only partially compiling the solution) paket still fails even though the packing of the template file given by the --template switch would work fine.

Repro steps

Check out the following reproduction repo: https://github.com/wastaz/paket-template-repro
Run ./build.sh targetHost=ProjectA

Expected behavior

This project contains two projects, ProjectA and ProjectB, each of these has its own paket.template file (and is meant to be pushed as two separate nugets). They have no references to each other.
By running ./build.sh targetHost=ProjectA it should build only ProjectA and then pack only ProjectA. So I expect this to correctly produce a ProjectA nuget package.

Actual behavior

However paket fails with the following message.
I've also tried running this without FAKE, and I get the exact same output and problem.

Starting Target: ProGetPack (==> Build)
C:\oss-code\PaketTemplateRepro\.paket\paket.exe pack output "../build"  --version  0.1.0.0 --template  ./ProjectA/paket.template
Paket version 5.96.2
Please use the new syntax: 'output' is the default argument and should be omitted.
Performance:
 - Runtime: 923 milliseconds
Paket failed with
-> DirectoryNotFoundException: Could not find a part of the path 'C:\oss-code\PaketTemplateRepro\ProjectB\bin\Release\ProjectB.dll'.
Running build failed.
Error:
System.Exception: Error during packing ..
   at [email protected](String message) in D:\code\FAKE\src\app\FakeLib\PaketHelper.fs:line 128
   at Fake.Paket.Pack(FSharpFunc`2 setParams) in D:\code\FAKE\src\app\FakeLib\PaketHelper.fs:line 128
   at [email protected](Unit _arg4)
   at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in D:\code\FAKE\src\app\FakeLib\TargetHelper.fs:line 626

Notice how what it is complaining about is that it could not find ProjectB.dll, which is of course correct since we have not compiled ProjectB and we do not need ProjectB in order to pack ProjectA.

Known workarounds

Always compile everything or remove all other paket.template files...

@lexarchik
Copy link
Contributor

lexarchik commented Sep 14, 2017

it is due to my fix for #1848.
Sorry, i thought pack partially compiled solution is not required.
I see two solutions:

  • ban usage --include-referenced-projects with --template ... and evaluate only one template with --template
  • evaluate all templates with --template only if --include-referenced-projects

forki added a commit that referenced this issue Sep 14, 2017
@forki
Copy link
Member

forki commented Sep 14, 2017

#2766

@lexarchik lexarchik mentioned this issue Sep 14, 2017
@lexarchik
Copy link
Contributor

@wastaz do you use --include-referenced-projects flag with pack command (or in template file)?

@wastaz
Copy link
Author

wastaz commented Sep 15, 2017

@lexarchik No, I do not.

lexarchik pushed a commit to lexarchik/Paket that referenced this issue Sep 15, 2017
@forki forki closed this as completed Sep 18, 2017
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 a pull request may close this issue.

3 participants