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:
6767 env :
6868 PROJECT_DIRECTORY : ${PROJECT_DIRECTORY}
6969 PROJECT : ${project}
70+ GYP_DEFINES : ${GYP_DEFINES|}
71+ NPM_OPTIONS : ${NPM_OPTIONS|}
7072 args :
7173 - run
7274 - ' --interactive'
@@ -76,6 +78,10 @@ functions:
7678 - /app
7779 - ' --env'
7880 - PROJECT_DIRECTORY=/app
81+ - ' --env'
82+ - GYP_DEFINES
83+ - ' --env'
84+ - NPM_OPTIONS
7985 - ' ubuntu:22.04'
8086 - /bin/bash
8187 - /app/.evergreen/run-tests-ubuntu.sh
@@ -122,6 +128,12 @@ tasks:
122128 - name : run-tests-ubuntu
123129 commands :
124130 - 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
125137 - name : run-prebuild
126138 commands :
127139 - func : install dependencies
@@ -194,6 +206,7 @@ buildvariants:
194206 packager_arch : x86_64
195207 tasks :
196208 - run-tests-ubuntu
209+ - run-tests-ubuntu-rtld
197210 - name : ubuntu2204-arm64
198211 display_name : ' Ubuntu 22.04 arm64'
199212 run_on : ubuntu2204-arm64-small
@@ -203,3 +216,4 @@ buildvariants:
203216 packager_arch : arm64
204217 tasks :
205218 - 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)"
105105echo " npm version: $( npm -v) "
106106
107107npm install " ${NPM_OPTIONS} "
108+ ldd build/* /kerberos.node || true
Original file line number Diff line number Diff line change 77 'sources' : [
88 'src/kerberos.cc'
99 ],
10+ 'variables' : {
11+ 'kerberos_use_rtld%' : 'false'
12+ },
1013 'xcode_settings' : {
1114 'GCC_ENABLE_CPP_EXCEPTIONS' : 'YES' ,
1215 'CLANG_CXX_LIBRARY' : 'libc++' ,
3639 'src/unix/base64.cc' ,
3740 'src/unix/kerberos_gss.cc' ,
3841 'src/unix/kerberos_unix.cc'
39- ],
42+ ]
43+ }],
44+ ['(OS=="mac" or OS=="linux") and (kerberos_use_rtld!="true")' , {
4045 'link_settings' : {
4146 'libraries' : [
4247 '-lkrb5' ,
5358 }]
5459 ]
5560 }],
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+ }],
5669 ['OS=="win"' , {
5770 'sources' : [
5871 'src/win32/kerberos_sspi.cc' ,
Original file line number Diff line number Diff line change @@ -171,6 +171,10 @@ void TestMethod(const CallbackInfo& info) {
171171}
172172
173173static 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+ }
174178 Function KerberosClientCtor = KerberosClient::Init (env);
175179 Function KerberosServerCtor = KerberosServer::Init (env);
176180 exports[" KerberosClient" ] = KerberosClientCtor;
Original file line number Diff line number Diff line change 1313
1414namespace node_kerberos {
1515
16+ bool kerberos_libraries_available (std::string* error_out);
17+
1618class KerberosServer : public Napi ::ObjectWrap<KerberosServer> {
1719 public:
1820 static Napi::Function Init (Napi::Env env);
You can’t perform that action at this time.
0 commit comments