Skip to content

Commit ab39776

Browse files
committed
deps,test: fixed failures
Signed-off-by: Paolo Insogna <paolo@cowtech.it>
1 parent d269454 commit ab39776

5 files changed

Lines changed: 20 additions & 6 deletions

File tree

deps/libffi/libffi.gyp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,6 @@
173173
'include',
174174
'--include-dir',
175175
'src/x86',
176-
'--include-dir',
177-
'<(INTERMEDIATE_DIR)',
178176
'--define',
179177
'FFI_BUILDING',
180178
'--define',

deps/libffi/preprocess_asm.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,24 @@ def normalize_path(value):
3636
return str(value).strip().strip('"')
3737

3838

39+
def unique_paths(paths):
40+
seen = set()
41+
result = []
42+
for path in paths:
43+
if path in seen:
44+
continue
45+
seen.add(path)
46+
result.append(path)
47+
return result
48+
49+
3950
def preprocess(args):
4051
compiler = find_compiler()
4152
input_path = normalize_path(args.input)
4253
output = Path(normalize_path(args.output))
4354
include_dirs = [normalize_path(include_dir) for include_dir in args.include_dir]
55+
include_dirs.append(str(output.parent))
56+
include_dirs = unique_paths(include_dirs)
4457
output.parent.mkdir(parents=True, exist_ok=True)
4558

4659
if os.name == 'nt' and Path(compiler[0]).name.lower() in ('cl.exe', 'cl', 'clang-cl.exe', 'clang-cl'):

src/ffi/data.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,6 @@ void ToString(const FunctionCallbackInfo<Value>& args) {
527527
Local<String> out;
528528
if (!String::NewFromUtf8(isolate, str, NewStringType::kNormal)
529529
.ToLocal(&out)) {
530-
env->ThrowError("Failed to create a string from native memory");
531530
return;
532531
}
533532

@@ -581,7 +580,6 @@ void ToBuffer(const FunctionCallbackInfo<Value>& args) {
581580
if (args.Length() < 3 || args[2]->IsUndefined() ||
582581
args[2]->BooleanValue(isolate)) {
583582
if (!Buffer::Copy(env, reinterpret_cast<char*>(ptr), len).ToLocal(&buf)) {
584-
env->ThrowError("Failed to create a Buffer from native memory");
585583
return;
586584
}
587585
} else {
@@ -592,7 +590,6 @@ void ToBuffer(const FunctionCallbackInfo<Value>& args) {
592590
[](char* data, void* hint) {},
593591
nullptr)
594592
.ToLocal(&buf)) {
595-
env->ThrowError("Failed to create a Buffer from native memory");
596593
return;
597594
}
598595
}

test/ffi/test-ffi-permissions.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
const common = require('../common');
44
const assert = require('node:assert');
55
const { test } = require('node:test');
6-
const ffi = require('node:ffi');
76

87
common.skipIfFFIMissing();
98

9+
const ffi = require('node:ffi');
10+
1011
const dummyLibraryPath = 'ffi-permission-test-library';
1112
const denied = {
1213
code: 'ERR_ACCESS_DENIED',

test/parallel/test-process-env-allowed-flags-are-documented.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@ if (!hasOpenSSL3) {
4949
documented.delete('--openssl-shared-config');
5050
}
5151

52+
if(!common.hasFFI) {
53+
documented.delete('--allow-ffi');
54+
documented.delete('--experimental-ffi');
55+
}
56+
5257
const isV8Sandboxed = process.config.variables.v8_enable_sandbox;
5358

5459
// Filter out options that are conditionally present.

0 commit comments

Comments
 (0)