@@ -102,13 +102,21 @@ fn find_openssl_dir(target: &str) -> OsString {
102
102
return OsString :: from ( "/usr/local" ) ;
103
103
}
104
104
105
+ let msg_header =
106
+ "Could not find directory of OpenSSL installation, and this `-sys` crate cannot
107
+ proceed without this knowledge. If OpenSSL is installed and this crate had
108
+ trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
109
+ compilation process." ;
110
+
111
+ println ! (
112
+ "cargo:warning={} See stderr section below for further information." ,
113
+ msg_header. replace( '\n' , " " )
114
+ ) ;
115
+
105
116
let mut msg = format ! (
106
117
"
107
118
108
- Could not find directory of OpenSSL installation, and this `-sys` crate cannot
109
- proceed without this knowledge. If OpenSSL is installed and this crate had
110
- trouble finding it, you can set the `OPENSSL_DIR` environment variable for the
111
- compilation process.
119
+ {}
112
120
113
121
Make sure you also have the development packages of openssl installed.
114
122
For example, `libssl-dev` on Ubuntu or `openssl-devel` on Fedora.
@@ -122,6 +130,7 @@ $TARGET = {}
122
130
openssl-sys = {}
123
131
124
132
" ,
133
+ msg_header,
125
134
host,
126
135
target,
127
136
env!( "CARGO_PKG_VERSION" )
@@ -187,7 +196,8 @@ https://github.com/sfackler/rust-openssl#windows
187
196
) ;
188
197
}
189
198
190
- panic ! ( "{}" , msg) ;
199
+ eprintln ! ( "{}" , msg) ;
200
+ std:: process:: exit ( 101 ) ; // same as panic previously
191
201
}
192
202
193
203
/// Attempt to find OpenSSL through pkg-config.
@@ -212,7 +222,7 @@ fn try_pkg_config() {
212
222
{
213
223
Ok ( lib) => lib,
214
224
Err ( e) => {
215
- println ! ( "run pkg_config fail: {:?} " , e) ;
225
+ println ! ( "\n \n Could not find openssl via pkg-config: \n {} \n " , e) ;
216
226
return ;
217
227
}
218
228
} ;
0 commit comments