These are chat archives for rust-lang/rust

9th
Aug 2017
Neno
@nenadl
Aug 09 2017 03:59
Hi. I'm trying to use serde to serialize a rust-url::Url inside of an enum. rust-url has a serde implementation in the crate url_serde and they say I need to use an attribute to help #derive to find the serialize/deserialize implementations - more specifically #[serde(with = "url_serde")]. However I'm getting a "unknown serde container attribute with" when using this attribute inside of an enum. The serde docs seem to indicate that this field attributes also work on variants. Any idea what I'm missing here?
Restioson
@Restioson
Aug 09 2017 06:00
Hi! I'm trying to get Rust (via rustup) installed on my Windows Subsystem for Linux. I can't seem to ping, wget, or curl from static.rust-lang.org though. Whenever I try this, I get a Resource Temporarily Unavailable. Any help appreciated :smile:
David DeSimone
@DavidDeSimone
Aug 09 2017 07:04
@Restioson I can ping static.rust-lang.org on my WSL instance fine right now.
Restioson
@Restioson
Aug 09 2017 07:15
hm
Maybe to do with that I'm not on Ipv6?
oh hm i can ping, wget'ing and curl'ing is the problem
restioson@RestiComp:~$ wget static.rust-lang.org
--2017-08-09 09:16:46--  http://static.rust-lang.org/
Resolving static.rust-lang.org (static.rust-lang.org)... 2600:9000:200c:1800:5:26a9:7440:93a1, 2600:9000:200c:a600:5:26a9:7440:93a1, 2600:9000:200c:8e00:5:26a9:7440:93a1, ...
Connecting to static.rust-lang.org (static.rust-lang.org)|2600:9000:200c:1800:5:26a9:7440:93a1|:80... failed: Resource temporarily unavailable.
Any page gives me this, however I can access it through chrome under windows fine
Michal 'vorner' Vaner
@vorner
Aug 09 2017 07:45
@Restioson It seems your IPv6 is somewhat broken. The machine thinks it has connectivity and it doesn't, or something. And it doesn't fall back onto legacy IPv4. Maybe you could try with -4 to force ipv4 manually.
Restioson
@Restioson
Aug 09 2017 07:59
No, I don't have IPv6
I'm on Telkom internet, they don't offer it
-4 does work!
Now the issue will be getting the rustup installation script to use it
Michal 'vorner' Vaner
@vorner
Aug 09 2017 08:00
Well, something on that computer seems to think it has it and it doesn't work due to that mistake.
Restioson
@Restioson
Aug 09 2017 08:05
hm
rustup-init uses ipv6 unfortunately
Michal 'vorner' Vaner
@vorner
Aug 09 2017 08:06
It probably uses some kind of OS-level preference. It should be configurable somewhere.
Restioson
@Restioson
Aug 09 2017 08:07
hm, yeah
Michal 'vorner' Vaner
@vorner
Aug 09 2017 08:07
Unless the program does its own magic (like chrome, which tries both IPv4 and IPv6 connections in parallel), it likely uses something like gethostbyname under the hood.
But it should take the presence of IPv6 connectivity into account, so maybe you should look for why the computer thinks it has IPv6. Maybe some of your network interfaces have an IPv6 address assigned, but no route.
(and you might try bugging rustup-init to support some kind of fallback mechanism if the first connection fails)
Restioson
@Restioson
Aug 09 2017 08:09
hm, yeah
i'm gonna try set the preference to ipv4
Works now
Think I should report it? I think the issue is that it sees it as an error and exits
Michal 'vorner' Vaner
@vorner
Aug 09 2017 08:11
Well, it's reasonable to try all the addresses the resolution returned before giving up.
But I have no idea on what level this should happen.
Restioson
@Restioson
Aug 09 2017 08:12
True. The lookup seems to return the ipv6 address, which again I can ping using ping6 but not wget/curl from
Michal 'vorner' Vaner
@vorner
Aug 09 2017 08:12
You can actually ping that IPv6 address? And you claim you have no IPv6 connectivity? That seems strange, to say the least. Being that computer, I'd be confused too ;-)
Restioson
@Restioson
Aug 09 2017 08:13
Yep, I haven't a clue
The people who run telkom are idiots, let me tell you that
I found rust-lang-nursery/rustup.rs#179 and rust-lang-nursery/rustup.rs#877
they seem to be different though
and some (closed) BSD issues
its happily working now...
Joonas Koivunen
@koivunej
Aug 09 2017 14:53
should LTO builds be possible with nightly? i keep hitting rustc: /checkout/src/llvm/lib/Transforms/Scalar/GVN.cpp:1933: bool llvm::GVN::replaceOperandsWithConsts(llvm::Instruction*) const: Assertion `!isa<Constant>(Operand) && "Replacing constants with constants is invalid"' failed. but can't google an issue for it, only some discussion around CARGO_INCREMENTAL=1 which I should have disabled...
constants, not const ants ... :)
whoops, I was using an old nightly, lets have a look with a fresh one
Joonas Koivunen
@koivunej
Aug 09 2017 15:08
and it works, nice. 25% faster than non-LTO'd build at a single benchmark