Skip to content

Commit cbfde86

Browse files
committed
Remove not yet working code for patching Mach-O files and throw an exception with a basic message
1 parent 83f27a3 commit cbfde86

File tree

6 files changed

+12
-515
lines changed

6 files changed

+12
-515
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/copying/ElfFile.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2024, 2025, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -60,12 +60,20 @@ private String getPatchelf() {
6060
var executable = env.getPublicTruffleFile(context.getOption(PythonOptions.Executable).toJavaStringUncached());
6161
var patchelf = executable.resolveSibling("patchelf");
6262
var i = 0;
63-
while (!patchelf.isExecutable() && i < path.length) {
63+
while (!isExecutable(patchelf) && i < path.length) {
6464
patchelf = env.getPublicTruffleFile(path[i++]).resolve("patchelf");
6565
}
6666
return patchelf.toString();
6767
}
6868

69+
private static boolean isExecutable(TruffleFile patchelf) {
70+
try {
71+
return patchelf.isExecutable();
72+
} catch (SecurityException e) {
73+
return false;
74+
}
75+
}
76+
6977
ElfFile(byte[] b, PythonContext context) throws IOException {
7078
this.context = context;
7179
this.tempfile = context.getEnv().createTempFile(null, null, ".so");

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/copying/MachODylibCommand.java

Lines changed: 0 additions & 135 deletions
This file was deleted.

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/copying/MachOFile.java

Lines changed: 0 additions & 184 deletions
This file was deleted.

0 commit comments

Comments
 (0)