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

Fixed DocFx bug #2188

Merged
merged 1 commit into from Oct 10, 2019
Merged

Fixed DocFx bug #2188

merged 1 commit into from Oct 10, 2019

Conversation

DigitalFlow
Copy link
Contributor

@DigitalFlow DigitalFlow commented Nov 6, 2018

Description

This PR switches the DocFx module to use Args instead of the deprecated Process functions.

Unfortunately neither building the project using fake run nor using dotnet builds successfully.
But this was also the case for me before I did the changes.
Some hints whether the stringify functions are ok as they are would be great.

TODO

@matthid
Copy link
Member

matthid commented Nov 6, 2018

Unfortunately neither building the project using fake run nor using dotnet builds successfully.

Can you open an issue with the problem description? It is a bit unusual that this wouldn't work considering the amount of CI-Systems this stuff is running on.

@DigitalFlow
Copy link
Contributor Author

DigitalFlow commented Nov 6, 2018

Unfortunately neither building the project using fake run nor using dotnet builds successfully.

Can you open an issue with the problem description? It is a bit unusual that this wouldn't work considering the amount of CI-Systems this stuff is running on.

@matthid Yes, sure. For the FAKE build it seems that chocolatey was missing, we might want to add that to the build requirements.
I'll redirect the output to a file and open a case afterwards.

It would be awesome if you could check the file changes in the commit, I hope I used the Args module as it was intended.

@matthid
Copy link
Member

matthid commented Nov 6, 2018

@DigitalFlow My suggestion would be to go with arg-lists all the way and switch to the CreateProcess API (and add a test for this bugfix, a single one is enough).
This has the advantage that no string building is required at all.

@matthid matthid added the needs-tests This PR needs tests in order to be accepted label Nov 6, 2018
@kblohm
Copy link
Contributor

kblohm commented Nov 6, 2018

Thanks for taking care of this!
But there are some things that are not going to work properly right now:
You need something along the lines of boolParam, optionParam etc. Right now you generate arguments like overwrite as --overwrite=false or --overwrite=true instead of leaving the argument when it is false and just specifying --overwrite when it is true. Similairly for strings, you generate --ApiSourceFolder="" when nothing is specified instead of leaving the argument off. Same goes for Option.
If you need any help, let me know.

@matthid as you deprecated the params-stuff (e.g. boolParam) from the ProcessModule, is there any alternative now or should every module do its own thing? I know the ArgsModule can be used for escaping, but there is no support for actually "specifying" the arguments similair to what the ProcessModule had before.

@DigitalFlow
Copy link
Contributor Author

@matthid: Would be interested in what to use as replacement for the stringification which was done in boolParam, stringParam, ... as well.
Adding a unit test and using CreateProcess is fine.

@matthid
Copy link
Member

matthid commented Nov 7, 2018

I know the ArgsModule can be used for escaping, but there is no support for actually "specifying" the arguments similair to what the ProcessModule had before.

Yes it would be nice to have the same helpers for list based parameter generation, I think @vbfox has written a library we might want to steal ;)

@vbfox
Copy link
Contributor

vbfox commented Nov 7, 2018

s/steal/reference/ 😉

Joke aside you can copy paste it if you want it's MIT but I can cross license to Apache 2 if you need :) Just please steal the printf integration ( https://github.com/vbfox/FoxSharp/blob/master/src/BlackFox.CommandLine/Readme.md ) :

let cmd =
    CmdLine.empty
    |> CmdLine.append "build"
    |> CmdLine.appendIf noRestore "--no-restore"
    |> CmdLine.appendPrefixIfSome "--framework" framework
    |> CmdLine.appendPrefixf "--configuration" "%A" configuration
    |> CmdLine.appendf "-n=%s" name
    |> CmdLine.toString

Obviously I would prefer a reference as it will avoid fixing issues in two places (And I love that habit of JS ecosystem of making small dedicated libraries) but fake having some code so serialize / deserialize command lines already make it less simple than "just use it" ( vbfox/FoxSharp#1 )

@matthid
Copy link
Member

matthid commented Nov 7, 2018

@vbfox Yes referencing is an option but I don't think people should need to convert types between several libraries in order to start a process. I think process starting should be in the fake core.

@vbfox
Copy link
Contributor

vbfox commented Nov 7, 2018

Can't you reference it in Fake.Core.Process ? is there a technical limitation or just a wish to keep fake core dependency free ?

@matthid
Copy link
Member

matthid commented Nov 7, 2018

@vbfox No technical limitation, more that we should have a set of types working well together and the wish to have breaking changes around them in control ;)

@matthid
Copy link
Member

matthid commented Nov 7, 2018

Or to be clear: I'm not against it. I just feel like having it in the repository leads to fewer issues in the long run..

@DigitalFlow
Copy link
Contributor Author

@matthid: So how to continue? Copy the code you linked to a separate class and use it?

@matthid
Copy link
Member

matthid commented Nov 14, 2018

@DigitalFlow sorry we got a bit sidetracked. What this pr needs is a basic test showing what this fixes

@matthid matthid added the waiting for author Some information or action was requested and it needs to be addressed. Or a response from author label Nov 14, 2018
@matthid
Copy link
Member

matthid commented Nov 18, 2018

any interest in finishing this?

@DigitalFlow
Copy link
Contributor Author

Yes, definetly.
As was shown by @kblohm, some parameters are not handled properly.
So I need to either rework the logic, or use the library of @vbfox.

@matthid
Copy link
Member

matthid commented Nov 18, 2018

Yes just skip all manual escaping and just build a list of string is probably the easiest option

@DigitalFlow
Copy link
Contributor Author

Yes, we did no escaping, however building the strings had some issues, for example boolean options that were passed as - -option=true instead of just passing - -option.
I have the feeling that we should have a central module for such stringifications, such as in ProcessHelper.

@matthid matthid merged commit cdd66aa into fsprojects:release/next Oct 10, 2019
@matthid matthid mentioned this pull request Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-tests This PR needs tests in order to be accepted waiting for author Some information or action was requested and it needs to be addressed. Or a response from author
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Illegal Characters in Path error when using DocFx
4 participants