File tree Expand file tree Collapse file tree 8 files changed +200
-70
lines changed Expand file tree Collapse file tree 8 files changed +200
-70
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,8 @@ functions:
67
67
env :
68
68
PROJECT_DIRECTORY : ${PROJECT_DIRECTORY}
69
69
PROJECT : ${project}
70
+ GYP_DEFINES : ${GYP_DEFINES|}
71
+ NPM_OPTIONS : ${NPM_OPTIONS|}
70
72
args :
71
73
- run
72
74
- ' --interactive'
@@ -76,6 +78,10 @@ functions:
76
78
- /app
77
79
- ' --env'
78
80
- PROJECT_DIRECTORY=/app
81
+ - ' --env'
82
+ - GYP_DEFINES
83
+ - ' --env'
84
+ - NPM_OPTIONS
79
85
- ' ubuntu:22.04'
80
86
- /bin/bash
81
87
- /app/.evergreen/run-tests-ubuntu.sh
@@ -122,6 +128,12 @@ tasks:
122
128
- name : run-tests-ubuntu
123
129
commands :
124
130
- func : run tests ubuntu
131
+ - name : run-tests-ubuntu-rtld
132
+ commands :
133
+ - func : run tests ubuntu
134
+ vars :
135
+ GYP_DEFINES : kerberos_use_rtld=true
136
+ NPM_OPTIONS : --build-from-source
125
137
- name : run-prebuild
126
138
commands :
127
139
- func : install dependencies
@@ -194,6 +206,7 @@ buildvariants:
194
206
packager_arch : x86_64
195
207
tasks :
196
208
- run-tests-ubuntu
209
+ - run-tests-ubuntu-rtld
197
210
- name : ubuntu2204-arm64
198
211
display_name : ' Ubuntu 22.04 arm64'
199
212
run_on : ubuntu2204-arm64-small
@@ -203,3 +216,4 @@ buildvariants:
203
216
packager_arch : arm64
204
217
tasks :
205
218
- run-tests-ubuntu
219
+ - run-tests-ubuntu-rtld
Original file line number Diff line number Diff line change @@ -105,3 +105,4 @@ echo "npm location: $(which npm)"
105
105
echo " npm version: $( npm -v) "
106
106
107
107
npm install " ${NPM_OPTIONS} "
108
+ ldd build/* /kerberos.node || true
Original file line number Diff line number Diff line change 7
7
'sources' : [
8
8
'src/kerberos.cc'
9
9
],
10
+ 'variables' : {
11
+ 'kerberos_use_rtld%' : 'false'
12
+ },
10
13
'xcode_settings' : {
11
14
'GCC_ENABLE_CPP_EXCEPTIONS' : 'YES' ,
12
15
'CLANG_CXX_LIBRARY' : 'libc++' ,
36
39
'src/unix/base64.cc' ,
37
40
'src/unix/kerberos_gss.cc' ,
38
41
'src/unix/kerberos_unix.cc'
39
- ],
42
+ ]
43
+ }],
44
+ ['(OS=="mac" or OS=="linux") and (kerberos_use_rtld!="true")' , {
40
45
'link_settings' : {
41
46
'libraries' : [
42
47
'-lkrb5' ,
53
58
}]
54
59
]
55
60
}],
61
+ ['(OS=="mac" or OS=="linux") and (kerberos_use_rtld=="true")' , {
62
+ 'defines' : ['KERBEROS_USE_RTLD=1' ],
63
+ 'link_settings' : {
64
+ 'libraries' : [
65
+ '-ldl' ,
66
+ ]
67
+ },
68
+ }],
56
69
['OS=="win"' , {
57
70
'sources' : [
58
71
'src/win32/kerberos_sspi.cc' ,
Original file line number Diff line number Diff line change @@ -171,6 +171,10 @@ void TestMethod(const CallbackInfo& info) {
171
171
}
172
172
173
173
static Object Init (Env env, Object exports) {
174
+ std::string libraries_unavailable_error;
175
+ if (!kerberos_libraries_available (&libraries_unavailable_error)) {
176
+ throw Error::New (env, libraries_unavailable_error);
177
+ }
174
178
Function KerberosClientCtor = KerberosClient::Init (env);
175
179
Function KerberosServerCtor = KerberosServer::Init (env);
176
180
exports[" KerberosClient" ] = KerberosClientCtor;
Original file line number Diff line number Diff line change 13
13
14
14
namespace node_kerberos {
15
15
16
+ bool kerberos_libraries_available (std::string* error_out);
17
+
16
18
class KerberosServer : public Napi ::ObjectWrap<KerberosServer> {
17
19
public:
18
20
static Napi::Function Init (Napi::Env env);
You can’t perform that action at this time.
0 commit comments