Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd support for XZ-compressed packages #1100
Conversation
This comment has been minimized.
This comment has been minimized.
|
This looks great @ranma42. Thank you for pushing this through all the tooling. I do think there should be tests for xz compression in rustup. Unfortunately rustup's testing is fairly cumbersome. I think the simplest thing here is to just add some unit tests that the installation code works correctly with xz. The basic way to do this is to duplicate this test case, add a new 'xz' boolean to MockDistServer::write that causes the mock dist server to generate both the 'gz' and 'xz' tarballs and the appropriate keys in the manifest, and thread that call into the new test case. That will at least provide a smoke test that the xz fields work. |
This comment has been minimized.
This comment has been minimized.
|
Ok, I will try and add a test as suggested. |
brson
reviewed
May 8, 2017
| xz = try!(TarXzPackage::new_file(&installer_file, temp_cfg)); | ||
| &xz | ||
| } | ||
| }; |
This comment has been minimized.
This comment has been minimized.
brson
May 8, 2017
Contributor
This is quite a fascinating pattern, leaving one local uninitialized. I did not know that was possible.
This comment has been minimized.
This comment has been minimized.
ranma42
May 9, 2017
Author
Contributor
rustc does not complain, but I guess it might be regarded as bad practice.
It is easy to transform this in a single local that is always assigned by wrapping the two cases in an enum, if it is preferred.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@ranma42 I don't have a better suggestion for that offhand. |
brson
referenced this pull request
May 8, 2017
Merged
Allow rustup to handle unavailable packages #1063
ranma42
force-pushed the
ranma42:package-xz
branch
from
b614e1f
to
bdd89e3
May 14, 2017
This comment has been minimized.
This comment has been minimized.
|
I updated the lzma-sys package (to fix some linking/crosscompiling issues) and added a test. |
This comment has been minimized.
This comment has been minimized.
|
For that one specific test could the xz tarball have different files than the gz tarball, and then you assert that the xz-specific files exist? |
This comment has been minimized.
This comment has been minimized.
|
That is apparently not so easy, because only the contents listed in the |
This comment has been minimized.
This comment has been minimized.
|
@ranma42 what about running |
ranma42
force-pushed the
ranma42:package-xz
branch
from
bdd89e3
to
7232a56
May 19, 2017
This comment has been minimized.
This comment has been minimized.
|
@Diggsey I tried to implement your suggestion and it seems to work locally, but somehow my new commit fails badly on the CI services |
This comment has been minimized.
This comment has been minimized.
|
@ranma42 I'm not sure, but while trying to reproduce locally, I ran into this other issue: I'm not keen on making rustup (even) harder to build on windows... |
This comment has been minimized.
This comment has been minimized.
|
Taking a look at the travis logs, it says:
I was able to check out this PR's branch locally and attempt to build, since I'm not on windows and not hitting the issue @Diggsey is. I'm indeed able to reproduce the error happening on travis. I reset Cargo.lock, then did diff --git a/Cargo.lock b/Cargo.lock
index 0602c7b..324ff53 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -345,12 +345,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lzma-sys"
-version = "0.1.3"
+version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"filetime 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)",
"gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
+ "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -997,7 +997,7 @@ name = "xz2"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "lzma-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
+ "lzma-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[metadata]
@@ -1038,7 +1038,7 @@ dependencies = [
"checksum libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)" = "babb8281da88cba992fa1f4ddec7d63ed96280a1a53ec9b919fd37b53d71e502"
"checksum libz-sys 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c18b5826abbfafb0160b37e1991e2d327c1fe38c955e496ea306f72c06d7570c"
"checksum log 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ab83497bf8bf4ed2a74259c1c802351fcd67a65baa86394b6ba73c36f4838054"
-"checksum lzma-sys 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c5eaaa53b35fa17482ee2c001b04242827b47ae0faba72663fee3dee32366248"
+"checksum lzma-sys 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fedff6a5cbb24494ec6ee4784e9ac5c187161fede04c7767d49bf87544013afa"
"checksum markdown 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bdb7e864aa1dccbebb05751e899bc84c639df47490c0c24caf4b1a77770b6566"
"checksum matches 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "15305656809ce5a4805b1ff2946892810992197ce1270ff79baded852187942e"
"checksum memchr 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d8b629fb514376c675b98c1421e80b151d3817ac42d7c667717d282761418d20"@ranma42 I'm guessing there was a merge conflict to Cargo.lock at some point? Can you try checking out the changes your branch makes to Cargo.lock, then building, then checking in Cargo.lock again? |
ranma42
force-pushed the
ranma42:package-xz
branch
from
7232a56
to
c180842
May 21, 2017
This comment has been minimized.
This comment has been minimized.
|
@carols10cents it was not a merge conflict in the sense of git (it would have been marked as such by github), but in a sense that was the problem. Thank you for helping out diagnosing the problem! @Diggsey what is the best way forward regarding alexcrichton/xz2-rs#6 ? |
This comment has been minimized.
This comment has been minimized.
|
@ranma42 I'm working on a fix for the xz2 issue, then we can get this merged. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
|
ranma42
added some commits
May 8, 2017
ranma42
force-pushed the
ranma42:package-xz
branch
from
c180842
to
f3aeab3
May 23, 2017
This comment has been minimized.
This comment has been minimized.
|
Why does AppVeyor report the branch as non-mergeable? (I rebased, upgraded lzma-sys and force-pushed) |
This comment has been minimized.
This comment has been minimized.
|
No idea :/ Let's give bors a try. @bors r+ |
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
May 23, 2017
This comment has been minimized.
This comment has been minimized.
|
|
This comment has been minimized.
This comment has been minimized.
|
@bors retry |
This comment has been minimized.
This comment has been minimized.
bors
added a commit
that referenced
this pull request
May 24, 2017
This comment has been minimized.
This comment has been minimized.
|
|
ranma42 commentedMay 8, 2017
When XZ-compressed packages are available, prefer them in place of the
GZip-compressed ones as they can provide significant savings interms
of download size.
This should be the last step towards fixing rust-lang/rust#21724