Skip to content

Stricter parsing in Requirements.parseRestrictionsLegacy - #2816

Merged
forki merged 1 commit into
fsprojects:masterfrom
csmager:fw-parsing
Oct 4, 2017
Merged

forki merged 1 commit into
fsprojects:masterfrom
csmager:fw-parsing

Conversation

@csmager

@csmager csmager commented Oct 2, 2017

Copy link
Copy Markdown
Contributor

This more strictly requires expressions matching the syntax in the examples below:

Value Result
net45 Exactly net45
= net45 Exactly net45
>= net45 At least net45
>= net45 <= net46 Between net45 and net46
portable-windows8+net45+wp8 At least Profile78
>= portable-windows8+net45+wp8 At least Profile78

Note that due to expectations in lock file parsing tests like this one, we also accept >= net45 < net46 as meaning 'Between net45 and net46'.

Fixes #2803

@forki
forki merged commit 93c02b2 into fsprojects:master Oct 4, 2017
@forki

forki commented Oct 4, 2017

Copy link
Copy Markdown
Member

This lead to #2822 so I reverted for now. Let's investigate if this was intentional

@csmager

csmager commented Oct 4, 2017

Copy link
Copy Markdown
Contributor Author

Sure. Would guess the code I didn’t touch only parses ‘framework’ and passes ‘s: net45’ along to be parsed.

I guess we need to decide whether we want to allow ‘frameworks’ or not. Either way, it needs a better error message I think.

@forki

forki commented Oct 4, 2017 via email

Copy link
Copy Markdown
Member

@csmager

csmager commented Oct 4, 2017

Copy link
Copy Markdown
Contributor Author

Agreed. Will add a few more tests with ‘framework’ with and without various combinations of ‘s’ and ‘:’

@forki

forki commented Oct 4, 2017 via email

Copy link
Copy Markdown
Member

@csmager

csmager commented Oct 5, 2017

Copy link
Copy Markdown
Contributor Author

I've checked this out, was as I expected - we find 'framework', read the text after it, remove any occurrence of : and then pass that along to the parser. In the case of #2822, we would try to parse s net40, and s isn't a valid framework identifier. In the previous 'loose' parsing, we would assume the s was = and parse net40.

That also means that e.g. frameworks: >= net40 and frameworks: auto-detect wouldn't have worked in the past.

I've made a change that will check for frameworks and then framework, which means they are now interchangeable. Will open a new PR shortly.

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.

2 participants