File tree Expand file tree Collapse file tree 7 files changed +83
-28
lines changed Expand file tree Collapse file tree 7 files changed +83
-28
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ export const enum Version {
32
32
V0x10 = 0 ,
33
33
/**
34
34
* Default value
35
- * Version 19 (0x13 in hex, default )
35
+ * Version 19 (0x13 in hex)
36
36
*/
37
37
V0x13 = 1 ,
38
38
}
Original file line number Diff line number Diff line change @@ -5,9 +5,22 @@ const { platform, arch } = process
5
5
6
6
let nativeBinding = null
7
7
let localFileExisted = false
8
- let isMusl = false
9
8
let loadError = null
10
9
10
+ function isMusl ( ) {
11
+ // For Node 10
12
+ if ( ! process . report || typeof process . report . getReport !== 'function' ) {
13
+ try {
14
+ return readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
15
+ } catch ( e ) {
16
+ return false
17
+ }
18
+ } else {
19
+ const { glibcVersionRuntime } = process . report . getReport ( ) . header
20
+ return ! glibcVersionRuntime
21
+ }
22
+ }
23
+
11
24
switch ( platform ) {
12
25
case 'android' :
13
26
if ( arch !== 'arm64' ) {
@@ -114,8 +127,7 @@ switch (platform) {
114
127
case 'linux' :
115
128
switch ( arch ) {
116
129
case 'x64' :
117
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
118
- if ( isMusl ) {
130
+ if ( isMusl ( ) ) {
119
131
localFileExisted = existsSync ( join ( __dirname , 'argon2.linux-x64-musl.node' ) )
120
132
try {
121
133
if ( localFileExisted ) {
@@ -140,8 +152,7 @@ switch (platform) {
140
152
}
141
153
break
142
154
case 'arm64' :
143
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
144
- if ( isMusl ) {
155
+ if ( isMusl ( ) ) {
145
156
localFileExisted = existsSync ( join ( __dirname , 'argon2.linux-arm64-musl.node' ) )
146
157
try {
147
158
if ( localFileExisted ) {
Original file line number Diff line number Diff line change @@ -5,9 +5,22 @@ const { platform, arch } = process
5
5
6
6
let nativeBinding = null
7
7
let localFileExisted = false
8
- let isMusl = false
9
8
let loadError = null
10
9
10
+ function isMusl ( ) {
11
+ // For Node 10
12
+ if ( ! process . report || typeof process . report . getReport !== 'function' ) {
13
+ try {
14
+ return readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
15
+ } catch ( e ) {
16
+ return false
17
+ }
18
+ } else {
19
+ const { glibcVersionRuntime } = process . report . getReport ( ) . header
20
+ return ! glibcVersionRuntime
21
+ }
22
+ }
23
+
11
24
switch ( platform ) {
12
25
case 'android' :
13
26
if ( arch !== 'arm64' ) {
@@ -114,8 +127,7 @@ switch (platform) {
114
127
case 'linux' :
115
128
switch ( arch ) {
116
129
case 'x64' :
117
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
118
- if ( isMusl ) {
130
+ if ( isMusl ( ) ) {
119
131
localFileExisted = existsSync ( join ( __dirname , 'bcrypt.linux-x64-musl.node' ) )
120
132
try {
121
133
if ( localFileExisted ) {
@@ -140,8 +152,7 @@ switch (platform) {
140
152
}
141
153
break
142
154
case 'arm64' :
143
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
144
- if ( isMusl ) {
155
+ if ( isMusl ( ) ) {
145
156
localFileExisted = existsSync ( join ( __dirname , 'bcrypt.linux-arm64-musl.node' ) )
146
157
try {
147
158
if ( localFileExisted ) {
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ crate-type = ["cdylib"]
10
10
[dependencies ]
11
11
annotate-snippets = {version = " 0.9" , features = [" color" ]}
12
12
anyhow = " 1"
13
- deno_ast = " 0.7 .0"
14
- deno_lint = " 0.20.1 "
13
+ deno_ast = " =0.8 .0"
14
+ deno_lint = " =0.21.0 "
15
15
env_logger = " 0.9"
16
16
global_alloc = {path = " ../../crates/alloc" }
17
17
globwalk = " 0.8"
Original file line number Diff line number Diff line change @@ -5,9 +5,22 @@ const { platform, arch } = process
5
5
6
6
let nativeBinding = null
7
7
let localFileExisted = false
8
- let isMusl = false
9
8
let loadError = null
10
9
10
+ function isMusl ( ) {
11
+ // For Node 10
12
+ if ( ! process . report || typeof process . report . getReport !== 'function' ) {
13
+ try {
14
+ return readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
15
+ } catch ( e ) {
16
+ return false
17
+ }
18
+ } else {
19
+ const { glibcVersionRuntime } = process . report . getReport ( ) . header
20
+ return ! glibcVersionRuntime
21
+ }
22
+ }
23
+
11
24
switch ( platform ) {
12
25
case 'android' :
13
26
if ( arch !== 'arm64' ) {
@@ -114,8 +127,7 @@ switch (platform) {
114
127
case 'linux' :
115
128
switch ( arch ) {
116
129
case 'x64' :
117
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
118
- if ( isMusl ) {
130
+ if ( isMusl ( ) ) {
119
131
localFileExisted = existsSync ( join ( __dirname , 'deno-lint.linux-x64-musl.node' ) )
120
132
try {
121
133
if ( localFileExisted ) {
@@ -140,8 +152,7 @@ switch (platform) {
140
152
}
141
153
break
142
154
case 'arm64' :
143
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
144
- if ( isMusl ) {
155
+ if ( isMusl ( ) ) {
145
156
localFileExisted = existsSync ( join ( __dirname , 'deno-lint.linux-arm64-musl.node' ) )
146
157
try {
147
158
if ( localFileExisted ) {
Original file line number Diff line number Diff line change @@ -5,9 +5,22 @@ const { platform, arch } = process
5
5
6
6
let nativeBinding = null
7
7
let localFileExisted = false
8
- let isMusl = false
9
8
let loadError = null
10
9
10
+ function isMusl ( ) {
11
+ // For Node 10
12
+ if ( ! process . report || typeof process . report . getReport !== 'function' ) {
13
+ try {
14
+ return readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
15
+ } catch ( e ) {
16
+ return false
17
+ }
18
+ } else {
19
+ const { glibcVersionRuntime } = process . report . getReport ( ) . header
20
+ return ! glibcVersionRuntime
21
+ }
22
+ }
23
+
11
24
switch ( platform ) {
12
25
case 'android' :
13
26
if ( arch !== 'arm64' ) {
@@ -114,8 +127,7 @@ switch (platform) {
114
127
case 'linux' :
115
128
switch ( arch ) {
116
129
case 'x64' :
117
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
118
- if ( isMusl ) {
130
+ if ( isMusl ( ) ) {
119
131
localFileExisted = existsSync ( join ( __dirname , 'jieba.linux-x64-musl.node' ) )
120
132
try {
121
133
if ( localFileExisted ) {
@@ -140,8 +152,7 @@ switch (platform) {
140
152
}
141
153
break
142
154
case 'arm64' :
143
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
144
- if ( isMusl ) {
155
+ if ( isMusl ( ) ) {
145
156
localFileExisted = existsSync ( join ( __dirname , 'jieba.linux-arm64-musl.node' ) )
146
157
try {
147
158
if ( localFileExisted ) {
Original file line number Diff line number Diff line change @@ -5,9 +5,22 @@ const { platform, arch } = process
5
5
6
6
let nativeBinding = null
7
7
let localFileExisted = false
8
- let isMusl = false
9
8
let loadError = null
10
9
10
+ function isMusl ( ) {
11
+ // For Node 10
12
+ if ( ! process . report || typeof process . report . getReport !== 'function' ) {
13
+ try {
14
+ return readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
15
+ } catch ( e ) {
16
+ return false
17
+ }
18
+ } else {
19
+ const { glibcVersionRuntime } = process . report . getReport ( ) . header
20
+ return ! glibcVersionRuntime
21
+ }
22
+ }
23
+
11
24
switch ( platform ) {
12
25
case 'android' :
13
26
if ( arch !== 'arm64' ) {
@@ -114,8 +127,7 @@ switch (platform) {
114
127
case 'linux' :
115
128
switch ( arch ) {
116
129
case 'x64' :
117
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
118
- if ( isMusl ) {
130
+ if ( isMusl ( ) ) {
119
131
localFileExisted = existsSync ( join ( __dirname , 'xxhash.linux-x64-musl.node' ) )
120
132
try {
121
133
if ( localFileExisted ) {
@@ -140,8 +152,7 @@ switch (platform) {
140
152
}
141
153
break
142
154
case 'arm64' :
143
- isMusl = readFileSync ( '/usr/bin/ldd' , 'utf8' ) . includes ( 'musl' )
144
- if ( isMusl ) {
155
+ if ( isMusl ( ) ) {
145
156
localFileExisted = existsSync ( join ( __dirname , 'xxhash.linux-arm64-musl.node' ) )
146
157
try {
147
158
if ( localFileExisted ) {
You can’t perform that action at this time.
0 commit comments