-
Notifications
You must be signed in to change notification settings - Fork 543
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
fix: dependency resolver on windows only works when --enable_runfiles and --windows_enable_symlinks is used #2457
base: main
Are you sure you want to change the base?
Conversation
Thanks for the PR.
|
…ndalone_mode = False' is not passed. On linux, this ended up not mattering because the file written to by pip_compile is a symlink to the file in the source tree. Symlinks are disabled by default on windows, so it writes to a new file in the runfiles tree but doesn't copy back to the source tree because the program exits.
…noenable_runfiles). This means the runfiles library resolves the requirements_file to the file in the source tree (ie resolved_requirements_file is the absolute path to the file in the source tree, not to a file in the runfiles directory). pip_compile is told to output to a relative path, which means it will output to a file in the runfiles directory. The check to see if we need to copy that file to the source tree was incorrect because it didn't check to see if the file output by pip_compile was the same as the one in the source tree, it checked if the resolved file was the same as the one in the source tree. Since the resolved file IS the same as the one in the source tree, it never copied, but the resolved file is not the file that pip_compile output to.
e85a02d
to
3b41efe
Compare
There are no longer any minimum requirements on Windows after this PR. I don't see any such existing requirements in that document, so I don't think we need to add anything do we?
The problem is that the test created by |
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'll play with the CI a little later, for now I wanted to leave the comment on the documentation.
Co-authored-by: Ignas Anikevicius <[email protected]>
compile_pip_requirements
doesn't work as expected on Windows unless both--enable_runfiles
and--windows_enable_symlinks
are used. Both options default to off on Windows because the filesystem on Windows makes setting up the runfiles directories with actual files very slow. This means that anyone on Windows with a default set up has to search around the Github issues to try and figure out why things don't work as advertised.The
dependency_resolver.py
doesn't inherently require these options, it just had two bugs that prevented it from working.runfiles
resolved file would be in the runfiles tree, but on Windows, when--enable_runfiles
is not set, it actually gets resolved to a file in the source tree.Before:
After:
And
//third_part/python:requirements_windows.txt
is updated.Reference issues: #1943 #1431