mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-29 01:04:29 +00:00
Restore language sync
- Bring back 5 commits a force push dropped from GitHub master (0aad88c30)
- Keep the thin Bukkit entry; port language sync into IrisRuntime
- Fetch guides through GitHubLanguageSource instead of the removed catalog
This commit is contained in:
commit
5769b0d4e8
53 files changed
+13688
-14119
No files matched your search
@@ -101,6 +101,7 @@ import art.arcane.iris.world.safeguard.RuntimeLockNotice;
|
||||
import art.arcane.iris.world.task.J;
|
||||
import art.arcane.iris.world.tree.TreeFellerSVC;
|
||||
import art.arcane.iris.world.tree.TreeSVC;
|
||||
import art.arcane.volmlib.util.diagnostics.DebugDumpContributor;
|
||||
import art.arcane.volmlib.integration.ReloadAware;
|
||||
import art.arcane.volmlib.nativelib.terrain.ServerShutdownBoundary;
|
||||
import art.arcane.volmlib.util.bukkit.papi.PlaceholderRegistration;
|
||||
@@ -661,10 +662,11 @@ public final class IrisRuntime implements IrisPluginRuntime {
|
||||
IrisLanguage.initialize();
|
||||
debugDump = BukkitDebugDump.create(plugin, new BukkitDebugDump.Options(
|
||||
() -> true,
|
||||
() -> IrisSafeguard::debugReport));
|
||||
IrisRuntime::captureDebugReport));
|
||||
languageSwitcher = BukkitLanguageSwitcher.register(plugin, IrisLanguage.selections(),
|
||||
new BukkitLanguageSwitcher.Options("iris", "iris.all",
|
||||
DirectorMiniMenu.Theme.irisGreen(), IrisLanguage.directorResolver(), IrisLanguage.editorOptions()));
|
||||
DirectorMiniMenu.Theme.irisGreen(), IrisLanguage.directorResolver(), IrisLanguage.editorOptions(),
|
||||
null, IrisLanguage::checkUpstream, IrisLanguage::metaName));
|
||||
updateNotifier = new IrisUpdateNotifier(plugin);
|
||||
PaperLibBootstrap.install();
|
||||
SimdSupport.install();
|
||||
@@ -803,9 +805,15 @@ public final class IrisRuntime implements IrisPluginRuntime {
|
||||
IrisToolbelt.retainMantleDataForSlice(TreeBlockMaterial.class.getCanonicalName());
|
||||
});
|
||||
timings.mark("startupTasks");
|
||||
IrisLanguage.checkUpstream();
|
||||
timings.report();
|
||||
}
|
||||
|
||||
private static DebugDumpContributor.Report captureDebugReport() {
|
||||
String language = IrisLanguage.debugReport();
|
||||
return () -> IrisSafeguard.debugReport() + "\n" + language;
|
||||
}
|
||||
|
||||
private static final class EnableTimings {
|
||||
private static final int REPORTED_SERVICES = 3;
|
||||
|
||||
|
||||
+14
-8
@@ -1,5 +1,6 @@
|
||||
package art.arcane.iris.platform.agent;
|
||||
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.lang.foreign.Arena;
|
||||
@@ -20,21 +21,26 @@ public class AttachSignalTest {
|
||||
private static final int SIGQUIT = 3;
|
||||
private static final int SIGTERM = 15;
|
||||
private static final long ACTION_BYTES = 256;
|
||||
private static final MethodHandle SIGACTION = Linker.nativeLinker().downcallHandle(
|
||||
Linker.nativeLinker().defaultLookup().find("sigaction").orElseThrow(),
|
||||
FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS));
|
||||
private static MethodHandle sigaction;
|
||||
|
||||
@BeforeClass
|
||||
public static void linkSigaction() {
|
||||
assumeFalse(System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("win"));
|
||||
sigaction = Linker.nativeLinker().downcallHandle(
|
||||
Linker.nativeLinker().defaultLookup().find("sigaction").orElseThrow(),
|
||||
FunctionDescriptor.of(ValueLayout.JAVA_INT, ValueLayout.JAVA_INT, ValueLayout.ADDRESS, ValueLayout.ADDRESS));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aConsoleThatResetsQuitGetsTheJvmHandlerBack() throws Throwable {
|
||||
assumeFalse(System.getProperty("os.name").toLowerCase(Locale.ROOT).contains("win"));
|
||||
long jvmHandler = handler(SIGTERM);
|
||||
assertNotEquals(0L, jvmHandler);
|
||||
try (Arena arena = Arena.ofConfined()) {
|
||||
MemorySegment original = arena.allocate(ACTION_BYTES);
|
||||
assertEquals(0, (int) SIGACTION.invokeExact(SIGQUIT, MemorySegment.NULL, original));
|
||||
assertEquals(0, (int) sigaction.invokeExact(SIGQUIT, MemorySegment.NULL, original));
|
||||
try {
|
||||
MemorySegment reset = arena.allocate(ACTION_BYTES);
|
||||
assertEquals(0, (int) SIGACTION.invokeExact(SIGQUIT, reset, MemorySegment.NULL));
|
||||
assertEquals(0, (int) sigaction.invokeExact(SIGQUIT, reset, MemorySegment.NULL));
|
||||
assertEquals(0L, handler(SIGQUIT));
|
||||
|
||||
assertTrue(AttachSignal.restoreJvmHandler());
|
||||
@@ -42,7 +48,7 @@ public class AttachSignalTest {
|
||||
assertEquals(jvmHandler, handler(SIGQUIT));
|
||||
assertFalse(AttachSignal.restoreJvmHandler());
|
||||
} finally {
|
||||
assertEquals(0, (int) SIGACTION.invokeExact(SIGQUIT, original, MemorySegment.NULL));
|
||||
assertEquals(0, (int) sigaction.invokeExact(SIGQUIT, original, MemorySegment.NULL));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -50,7 +56,7 @@ public class AttachSignalTest {
|
||||
private static long handler(int signal) throws Throwable {
|
||||
try (Arena arena = Arena.ofConfined()) {
|
||||
MemorySegment action = arena.allocate(ACTION_BYTES);
|
||||
assertEquals(0, (int) SIGACTION.invokeExact(signal, MemorySegment.NULL, action));
|
||||
assertEquals(0, (int) sigaction.invokeExact(signal, MemorySegment.NULL, action));
|
||||
return action.get(ValueLayout.JAVA_LONG, 0);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user