Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
DRIVERS-2497 Fix paths on Cygwin and Python package dependencies #244
DRIVERS-2497 Fix paths on Cygwin and Python package dependencies #244
Changes from 8 commits
70a8d46
cf44f48
905808d
04d78f4
eb209b0
cb6ad69
971c854
16a96c8
daf0df0
ac503ff
1dea6ef
513006c
fdc4bd1
4a74e14
8a8b952
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this only windows-64-2016? What about windows-64-vsMulti-small (Microsoft Windows Server 2019 Datacenter)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: I reproduced the same issue there. This probably hits all windows hosts on evergreen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to the patch testing windows-64-2019, there appeared to be no issue. I was not aware of
windows-64-vsMulti-small
. It is unclear to me what the difference between these distros may be.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why windows-64-2019 works but windows-64-vsMulti-small doesn't. Either way the issue needs to be fixed on windows-64-vsMulti-small too because that's what we test on in pymongo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just documenting what we discussed via other channels that the windows-64-vsMulti-small was added to the test suite but did not demonstrate failure that was observed when testing on a spawn host, and that this issue could be related to BUILD-12392.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if instead of trying to pinpoint which platforms need cryptography<3.4 we just try to install the latest version and if that fails fallback to cryptography<3.4? Like this:
This is simpler and should work on more platforms.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is indeed simpler, but I deliberately opted for the current approach in order to be very explicit about conditions that require workarounds and as narrow as possible in the application of said workarounds.
This was motivated by the status quo where generally-applied workarounds such as pinning cryptography to
~=3.4.8
or usingCRYPTOGRAPHY_DONT_BUILD_RUST=1
continued to demonstrate unexpected failures, and the conditions for said failures appeared to be inconsistent and opaque. It was unclear to me whenever I encountered such a failure whether it was already known, a new problem, or where the blame should be assigned (did I break it, or did the environment change without my knowing?).My hope was that being explicit in this manner would make it easier to maintain this script moving forward, with simplifications/removals of special-casing being applied in a controlled and targeted manner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer the generic one to avoid needing to tweak and maintain these 30 extra lines which may or may not cover all the hosts drivers test on. I think a good compromise would be to use the generic approach but add an informative comment that specifically explains why the workaround exists like:
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that is an acceptable compromise. Would appeciate other reviewers' thoughts on this before committing to the refactor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a slight preference for the compromise. That may require less changes to this script as distros undergo changes or more distros are added.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Verified by this patch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be refactored to avoid duplicating
"$bin" -m venv "$tmp" || return
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I opted for a dedicated
real_path
variable only when required, but I can refactor it to reduce duplication instead.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you show an example of this happening? Regardless can we remove this check because it's already handled by the if/elif/else below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The example is as described in the PR description under "Paths on Cygwin".
I suppose it could be considered redundant due to the checks below. The intent of this check was to test if there are any files placed in the intended directory at all, which I felt to be different enough from whether or not an activation script could be found. I can remove/simplify if preferable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I would prefer removing it because it simplifies the script and we don't do anything special for an empty dir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comments as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is -p actually needed here?
-p
defaults to the current version of python so this seems redundant.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it is required, as some old versions of
virtualenv
do not correctly select the Python binary used to create the virtual environment. This is documented by this comment in the oldutils.sh
script, but I observed it to be an issue on more than just Debian 10 distros. I wanted to link to a relevant bug report, but could not find one.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, can you add the comment from the old script? It's much more informative.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do. 👍