-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
download .tar.xz if python3 is used #65932
Conversation
(rust_highfive has picked a reviewer for you, use r? to override) |
Thanks! Is there something that we should test for in Python to see if xz decompression is supported? Is it possible to configure that off in python 3? Are we sure that all Python 3 versions support this? |
Off hand, I'm almost certain it's possible to compile without it, and you can check for availability by seeing if |
Good catch, I added an extra check for the version, according to the python documentation here: https://docs.python.org/3/library/tarfile.html
If we trust this info, checking the version is enough, we don't have to try to import lzma. |
We could use |
Can we just check for lzma support directly, and not do any version detection? That seems more reliable and avoids these questions. |
Maybe: tarball_suffix = '.tar.xz'
try:
import lzma
except ImportError:
tarball_suffix = '.tar.gz' |
updated to import check, please help review again. btw how can we update the azure pipelines to do a full verification? |
Is it certain that if This seems like it's getting somewhat complicated, so I'm not sure if it's worth having so many checks to avoid a few megabytes on the download? (presumably the git repo is much larger than the snapshots at this point?) |
According to the but in python2, even we have So that's why I originally think it's better to do the version check, it's simple and it can always work though it might be a more conservative estimate. |
That's what I'm sort of getting at with maybe not doing this at all because it doesn't save all that much and it's pretty complicated. The Perhaps a configuration option could be used to opt-in to this? Or something like that? |
I think if you change |
@alex we can do that, but I'd argue the logic is a bit unclear at first glance, just checking the python version is >= 3.3 is much clear. @alexcrichton I don't see why the version check won't work, as |
Presumably though lzma support can be disabled when python is compiled right? Sorry but this is where it all just seems like this is perhaps a bit too much effort with respect to the change proposed here? |
It's technically possible, yes.
I'm practice compiling with lzma disabled is _incredibly_ rare.
…On Mon, Nov 4, 2019, 9:55 AM Alex Crichton ***@***.***> wrote:
Presumably though lzma support can be disabled when python is compiled
right? Sorry but this is where it all just seems like this is perhaps a bit
too much effort with respect to the change proposed here?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#65932?email_source=notifications&email_token=AAAAGBDUGPMBXGWH7AKX3STQSAZXXA5CNFSM4JGJNEC2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC7QVBI#issuecomment-549390981>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAAAGBBWDKCFZMTCJZH7BDTQSAZXXANCNFSM4JGJNECQ>
.
|
Ping from triage - this PR has sat idle for the last few days... Thanks! |
I come up with a slightly better idea. We can try to create a Code is pushed, but I need to test that with Python3, will report back. |
I tried python2 and python3, they both can figure out the right file types. These are pre-built version, not custom built, I believe it would cover most of the use cases. |
@bors: r+ |
📌 Commit 8d56bcc has been approved by |
@bors: r- er actually, let's keep this out of the hot path. This shouldn't be calculated every time |
thank you for the review. I've moved the check to the downloading function. locally it's fine for python 3. let's see if the CI job works. it's using python 2. |
@bors: r+ |
📌 Commit 0019371 has been approved by |
download .tar.xz if python3 is used fixes rust-lang#65757
Rollup of 13 pull requests Successful merges: - #65932 (download .tar.xz if python3 is used) - #66074 ([mir-opt] Turn on the `ConstProp` pass by default) - #66094 (Fix documentation for `Iterator::count()`.) - #66166 (rename cfg(rustdoc) into cfg(doc)) - #66227 (docs: Fix link to BufWriter::flush) - #66292 (add Result::map_or) - #66297 (Add a callback that allows compiler consumers to override queries.) - #66317 (Use a relative bindir for rustdoc to find rustc) - #66330 (Improve non-exhaustiveness handling in usefulness checking) - #66331 (Add some tests for fixed ICEs) - #66334 (Move Session fields to CrateStore) - #66335 (Move self-profile infrastructure to data structures) - #66337 (Remove dead code for encoding/decoding lint IDs) Failed merges: r? @ghost
download .tar.xz if python3 is used fixes rust-lang#65757
download .tar.xz if python3 is used fixes rust-lang#65757
Rollup of 14 pull requests Successful merges: - #65932 (download .tar.xz if python3 is used) - #66094 (Fix documentation for `Iterator::count()`.) - #66166 (rename cfg(rustdoc) into cfg(doc)) - #66186 (Add long error explanation for E0623) - #66227 (docs: Fix link to BufWriter::flush) - #66248 (add raw ptr variant of UnsafeCell::get) - #66292 (add Result::map_or) - #66297 (Add a callback that allows compiler consumers to override queries.) - #66317 (Use a relative bindir for rustdoc to find rustc) - #66330 (Improve non-exhaustiveness handling in usefulness checking) - #66331 (Add some tests for fixed ICEs) - #66334 (Move Session fields to CrateStore) - #66335 (Move self-profile infrastructure to data structures) - #66337 (Remove dead code for encoding/decoding lint IDs) Failed merges: r? @ghost
fixes #65757