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 can't find build configurations specified with dynamic OutputPath node #914

Closed
allykzam opened this issue Jul 6, 2015 · 9 comments
Labels

Comments

@allykzam
Copy link
Contributor

allykzam commented Jul 6, 2015

When processing a project file using <OutputPath>bin\$(Configuration)\</OutputPath> in the main <PropertyGroup> node, running paket pack output "bin" results in:

Paket failed with:
Unable to find Release output path node in file C:\File\Path\Here\Project.fsproj

I'd try to jump in and work on some changes to fix this myself, but I'm not sure how the paket people feel this should be resolved.

@forki
Copy link
Member

forki commented Jul 19, 2015

Not really sure I understand the issue.

/cc @mavnn

@allykzam
Copy link
Contributor Author

In a typical project file, Visual Studio builds little sections of XML for each build configuration — Debug|AnyCPU, Debug|x86, Release|AnyCPU, etc. — and adds values that are considered specific to each configuration. One of these is an OutputPath value, which indicates where the compiled binaries are put. When compiling a project, MSBuild goes through the project file and process each value, dynamically resolving placeholders like $(Configuration) to the appropriate value. So rather than providing an OutputPath node for each build configuration, if you were writing a project file by hand, you could write a single node like <OutputPath>bin\$(Configuration)\</OutputPath> in the section of the project file that applies globally, and MSBuild would dynamically resolve that to bin\Release\, bin\Debug\, etc. as needed.

With a project file that only has one OutputPath node configured as above, paket pack commands refuse to run, giving the output I mentioned before. I assume this is because either paket is looking for an OutputPath within the block of XML specific to the current build configuration and can't find it, or because paket found the OutputPath but isn't processing the placeholder and can't find a folder named bin\$(Configuration)\.

@forki forki added the bug label Jul 23, 2015
@forki
Copy link
Member

forki commented Jul 23, 2015

@allykzam
Copy link
Contributor Author

Not quickly/easily; my only useful thought is to process every node in the project file, loading each value into a dictionary, and process the placeholders like MSBuild does. Realistically, doing that exactly how MSBuild does it means also processing external .targets files as well; hence my concern about how you feel like resolving this. Ignoring external .targets files would be fine for my current use-case, but would still preclude potential valid project files from being used.

@forki
Copy link
Member

forki commented Jul 23, 2015

Mhm, if you send a PR which solves your use case that would still be an improvement...

@allykzam
Copy link
Contributor Author

Alright, I'll see if I can work up something useful this weekend. :)

@allykzam
Copy link
Contributor Author

I have the start of an implementation at amazingant/features/handle-dynamic-outputpath if you want to take a look. I haven't touched handling placeholders or conditions yet, but if the route I'm going is entirely unappealing to you, it should be apparent already.

@forki
Copy link
Member

forki commented Jul 25, 2015

could you please create a WIP Pull Request for easier discussion? thx

@allykzam
Copy link
Contributor Author

Resolved with #942

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants