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

Remove alternative token usage #1053

Merged
merged 1 commit into from
Dec 3, 2020
Merged

Remove alternative token usage #1053

merged 1 commit into from
Dec 3, 2020

Conversation

antkmsft
Copy link
Member

@antkmsft antkmsft commented Dec 2, 2020

CI/CD sometimes fails, and MSVC build now fails on some of our personal machines with the latest updates.
#1042 currently fails due to this.

I think it has to do with the compiler version update.

and shouldn't be used anyway - it is an alternative operator, that is intended to be used on the old systems with 7-bit char that don't have good representation for the & character.
https://en.cppreference.com/w/cpp/language/operator_alternative

I think the reason it worked is that it was available in older MSVC versions, but now you must use some sort of a compiler switch in order to make it available.

Other possible explanation, which I hope is not the case, is that someone (us or 3rd party library) has defined "and" as macro, and now it can be substituted by something random, but I don't think it is the case.

Anyways, this change goes in, we compile successfully everywhere.

@ghost
Copy link

ghost commented Dec 2, 2020

Hello @antkmsft!

Because this pull request has the auto-merge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@ahsonkhan
Copy link
Contributor

ahsonkhan commented Dec 2, 2020

Though I agree that this change is good, can we please hold off on merging this until we have isolated and verified the root cause of the #1042 CI failure.

If the use of and along with using vcpkg to install 3.9.1 of the JSON library is causing CI failures, it would be good to understand why first.

I suspect the use of and, alone, is not the reason since CI from master and other PRs is green, even with the use of and already checked-in. @vhvb1989 is trying to isolate the issue, and it might be because of needing to react to breaking changes between 3.8.0 and 3.9.1.

@ahsonkhan ahsonkhan added Storage Storage Service (Queues, Blobs, Files) and removed auto-merge labels Dec 2, 2020
@ahsonkhan ahsonkhan added this to the [2020] December milestone Dec 2, 2020
@ahsonkhan
Copy link
Contributor

Otherwise, looks good.

@Jinming-Hu
Copy link
Member

I want to understand why we used and for logical and and if it's also used elsewhere.

@antkmsft
Copy link
Member Author

antkmsft commented Dec 2, 2020

@Jinming-Hu , @katmsft introduced that line months ago, and it was fine until some recent MSVC update.
Per https://en.cppreference.com/w/cpp/language/operator_alternative, and many others, and is absolutely the same as && (just another way to write it down), there is no behavior difference, maybe he didn't think it makes significant difference which one to use (I wouldn't).

@antkmsft
Copy link
Member Author

antkmsft commented Dec 2, 2020

@ahsonkhan , you asked not to merge, removed the auto-merge label 2 hours ago and later approved this 30 minutes ago. I am not sure if you are done with the investigations, so I am not merging this, please merge this PR if you are done.

@Jinming-Hu
Copy link
Member

@Jinming-Hu , @katmsft introduced that line months ago, and it was fine until some recent MSVC update.
Per https://en.cppreference.com/w/cpp/language/operator_alternative, and many others, and is absolutely the same as && (just another way to write it down), there is no behavior difference, maybe he didn't think it makes significant difference which one to use (I wouldn't).

I agree that it wouldn't make a big difference. But I believe it's not a good habit to mix them (sometimes and while sometimes &&). I want to be consistent and obviously && is widely used in C++ world.

@antkmsft
Copy link
Member Author

antkmsft commented Dec 2, 2020

@Jinming-Hu , I agree, and I see no reason to use it, and it is better for consistency. I wouldn't block anyone's PR due to that, but I would leave my feedback. Even if not for fixing any issues, I see our code base better with this change than without it, so this is also why I want to check this in, but now I'm asking @ahsonkhan to ok if he is done with this investigations, since he requested to hold off this for a moment.
To your other question - I didn't find other usages of and or or in our codebase, this is the only one.

@Jinming-Hu
Copy link
Member

To your other question - I didn't find other usages of and or or in our codebase, this is the only one.

That's great!

@ahsonkhan
Copy link
Contributor

ahsonkhan commented Dec 2, 2020

you asked not to merge, removed the auto-merge label 2 hours ago and later approved this 30 minutes ago.

Apologies for the mixed signal. I will be more clear next time :)
After Jinming approved the PR, there was nothing blocking the merge anyway, so I approved as well, but I should have added a comment to hold off on merging.

I am not sure if you are done with the investigations, so I am not merging this, please merge this PR if you are done.

I will merge it once the investigation is complete and post an update here. It will likely be tomorrow because I wanted to isolate exactly which JSON version triggers the issue (whether it is 3.9.0 or 3.9.1). Thanks for double checking and waiting.

@ahsonkhan
Copy link
Contributor

@antkmsft merge away :)

@antkmsft
Copy link
Member Author

antkmsft commented Dec 3, 2020

For the context, @vhvb1989 has located the change, it is nlohmann/json@8d29523, and the issue that explains the situation in detail: nlohmann/json#2089

@antkmsft antkmsft merged commit d61e106 into Azure:master Dec 3, 2020
@antkmsft antkmsft deleted the and branch December 3, 2020 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants