These are chat archives for rust-lang/rust

2nd
Jul 2017
eurie
@iseurie
Jul 02 2017 03:02
hi
eurie
@iseurie
Jul 02 2017 04:09
so, i've been trying to run a build of a bin that depends on curl-rs
is there anyone that develops on linux that could assist with linking against openssl?
Jonas Platte
@jplatte
Jul 02 2017 04:16
@iseurie What's the error message you're getting?
eurie
@iseurie
Jul 02 2017 04:17
ld: undefined references
https://pastebin.com/Vi7Zi4DV
Jonas Platte
@jplatte
Jul 02 2017 04:18
Oh, that's something I haven't seen before in this kind of context. Which distro / version are you using?
eurie
@iseurie
Jul 02 2017 04:18
arch linux
version of wat?
Jonas Platte
@jplatte
Jul 02 2017 04:19
well if it's arch linux then there is no version ^^
eurie
@iseurie
Jul 02 2017 04:19
mh
Jonas Platte
@jplatte
Jul 02 2017 04:19
but then I'm even more surprised...
eurie
@iseurie
Jul 02 2017 04:20
my project depends on curl-rs
i've brought this up elsewhere and i'm beginning to think it's just obsoleted deps
Jonas Platte
@jplatte
Jul 02 2017 04:20
That might be, yeah.
eurie
@iseurie
Jul 02 2017 04:20
the bindings are probably intended for an outdated version of this 'openssl-1.0' pkg
Jonas Platte
@jplatte
Jul 02 2017 04:21
Can you show me your Cargo.toml?
eurie
@iseurie
Jul 02 2017 04:21
oh wrong one
Jonas Platte
@jplatte
Jul 02 2017 04:22
well really the interesting part is the dependencies, you can leave out the rest
eurie
@iseurie
Jul 02 2017 04:22
[dependencies]
curl = "0.4.7"
clap = "2.25.0"
serde = "1.0.8"
serde_json = "1.0.2"
serde_derive = "1.0.8"
Jonas Platte
@jplatte
Jul 02 2017 04:24
Hm, curl doesn't seem to depend on an outdated version of openssl, and you are already explicitly depending on the latest version of it.
You probably do have the openssl package installed, not just openssl-1.0?
eurie
@iseurie
Jul 02 2017 04:26
yeah
Jonas Platte
@jplatte
Jul 02 2017 04:26
Because I've got both and it doesn't seem to be an issue
Actually if the thing you're working on is available somewhere, can you give me a link? Then I can try to reproduce it (although I do need to go soon pbbly)
eurie
@iseurie
Jul 02 2017 04:27
well, alrighty
here you go
Jonas Platte
@jplatte
Jul 02 2017 04:31
okay, so it works for me
eurie
@iseurie
Jul 02 2017 04:31
what the heck
Jonas Platte
@jplatte
Jul 02 2017 04:31
you could try a cargo update
eurie
@iseurie
Jul 02 2017 04:31
i did
just ran another
did nothing
Jonas Platte
@jplatte
Jul 02 2017 04:32
do you have a clean working directory?
eurie
@iseurie
Jul 02 2017 04:32
...define 'clean'
Jonas Platte
@jplatte
Jul 02 2017 04:33
do you have any local changes that I wouldn't see?
when fresh-cloning?
eurie
@iseurie
Jul 02 2017 04:33
not unless it's in .gitignore
Jonas Platte
@jplatte
Jul 02 2017 04:33
okay
you can get rid of all untracked files with git clean -xdf, you could try that
but if that helps where cargo update doesn't, it might be a bug...
So maybe make a copy of your working directory and try git clean -xdf && cargo build in there.
eurie
@iseurie
Jul 02 2017 04:34
git clean -xdf essentially does what cargo clean did for me
i am building now but not optimistic
same error
Jonas Platte
@jplatte
Jul 02 2017 04:36
yeah since you actually checked in your Cargo.toml and me doing a fresh build not updating that, it seems like our environments should be very alike.
even without you running cargo update
What's the version of your openssl package? (pacman -Qi openssl)
mine is 1.1.0.f-1
eurie
@iseurie
Jul 02 2017 04:37
mine too
Jonas Platte
@jplatte
Jul 02 2017 04:38
okay, I think this is the point at which I can't help you more than Google anymore
actually, one last idea. verify that your curl binary links against the standard openssl:
ldd $(which curl) | grep ssl
output on my machine is
    libssl.so.1.1 => /usr/lib/libssl.so.1.1 (0x00007fe1d7ef8000)
(or any other binary linking against openssl, really. just chose curl because you'd obviously have that installed)
eurie
@iseurie
Jul 02 2017 04:40
its the same thing
Jonas Platte
@jplatte
Jul 02 2017 04:41
(the assumption here being that cargo should resolve openssl the same way ldd does, instead of for example using the older openssl-1.0)
I think there are verbosity flags for cargo (build), maybe it will tell you how it resolved the -lssl..
eurie
@iseurie
Jul 02 2017 04:43
do u know how to force remove a package
and all of its associated files
Jonas Platte
@jplatte
Jul 02 2017 04:44
Oh, you want to get rid of openssl-1.0?
eurie
@iseurie
Jul 02 2017 04:44
yes
Jonas Platte
@jplatte
Jul 02 2017 04:44
Actually I've looked at the pastebin again and the first symbol not being found is SSL_library_init, that sounds like a symbol that would be present even in very old versions.
But if you want to get rid of openssl-1.0, you should probably remove the packages that depend on it too.
eurie
@iseurie
Jul 02 2017 04:45
nodejs
disgust
oh wpa_supplicant
Jonas Platte
@jplatte
Jul 02 2017 04:47
Just checked the manpage for pacman actually, and it seems you can just pass -c
eurie
@iseurie
Jul 02 2017 04:47
-c?
Jonas Platte
@jplatte
Jul 02 2017 04:47
for me sudo pacman -Rcns openssl-1.0 wants to remove a loooot of stuff though
yeah given that wpa_supplicant and qt5_base depend on it, you probably don't want to remove it..
Given that Google (for me at least) doesn't seem to find anything useful, I'd just ask in the Rust IRC. there are a lot more people there than here
eurie
@iseurie
Jul 02 2017 04:51
okie dokie
stevensonmt
@stevensonmt
Jul 02 2017 22:46
fn add_employee(company_hr: &mut HashMap<&'static str, &'static str>)   {
    let mut employee = String::new();

    println!("Please enter the name of the employee you would like to manage.");

    io::stdin().read_line(&mut employee)
        .expect("Failed to read line");

    let employee = employee.trim();

    let mut department = String::new();

    println!("Please enter the name of the department you would like to add the employee to.");

    io::stdin().read_line(&mut department)
        .expect("Failed to read line");

    let department = department.trim();

    company_hr.insert(&employee, &department);

    println!("Employee {:?} has been added to department {:?}", &employee, company_hr.get(&*employee).unwrap());
}
Lines 29 and 38 throw the error does not live long enough for employee and department respectively. The error message includes the note borrowed value must be valid for the static lifetime... I'm not sure how to address this problem. Any suggestions?
Is the problem that the employee and department values die but the company_hr hash map that contains them lives on?