diff --git a/launcher/src/backend.rs b/launcher/src/backend.rs index 4934c4819..ac6fe3a4d 100644 --- a/launcher/src/backend.rs +++ b/launcher/src/backend.rs @@ -418,8 +418,9 @@ fn resources_compatible(from: &Path, to: &Path, manifest: &serde_json::Value) -> if !preparer.iter().all(|p| same_or_absent(p)) { return false; } - let mut sources = - vec!["mods/horizon/src/test/java/dev/horizonlab/parity/VanillaHeightmapOracle.java".to_string()]; + let mut sources = vec![ + "mods/horizon/src/test/java/dev/horizonlab/parity/VanillaHeightmapOracle.java".to_string(), + ]; for (_, value) in fields .iter() .filter(|(key, _)| key.ends_with("_exporters_sha256")) diff --git a/launcher/src/mcp.rs b/launcher/src/mcp.rs index c590d066d..8573e2f62 100644 --- a/launcher/src/mcp.rs +++ b/launcher/src/mcp.rs @@ -110,7 +110,11 @@ impl Session { lines.pop_front(); } }); - let tail = lines.into_inner().into_iter().collect::>().join("\n"); + let tail = lines + .into_inner() + .into_iter() + .collect::>() + .join("\n"); (result, tail) } }; diff --git a/tools/compare_prepare.py b/tools/compare_prepare.py index 58216af00..7b53bc704 100644 --- a/tools/compare_prepare.py +++ b/tools/compare_prepare.py @@ -35,10 +35,14 @@ PYTHON_REF = '66ce394d2d6dc19ed5f5c53a97b650741af9be76' IGNORED_PARTS = {'classes', 'client-classes', 'logs', '.cache'} -def tree(ref, destination): +def tree(ref, destination, archive=None): + """The preparer's inputs at `ref`: research-lock.json, the exporters and the Python preparer.""" destination.mkdir(parents=True) - archive = subprocess.run(['git', '-C', str(ROOT), 'archive', ref, 'tools', 'mods/horizon/src/test/java', - 'research-lock.json'], check=True, capture_output=True).stdout + if archive is None: + archive = subprocess.run(['git', '-C', str(ROOT), 'archive', ref, 'tools', 'mods/horizon/src/test/java', + 'research-lock.json'], check=True, capture_output=True).stdout + else: + archive = archive.read_bytes() subprocess.run(['tar', '-x', '-C', str(destination)], input=archive, check=True) @@ -66,6 +70,9 @@ def main(): parser.add_argument('--server-jar', type=Path, required=True) parser.add_argument('--minecraft-dir', type=Path, required=True) parser.add_argument('--python-ref', default=PYTHON_REF) + parser.add_argument('--python-tree', type=Path, + help='a tar of that tree instead of git (git archive REF tools mods/horizon/src/test/java ' + 'research-lock.json), for a machine without the repository') parser.add_argument('--binary', type=Path, help='horizon-prepare to test (default: cargo build --release)') parser.add_argument('--work', type=Path, default=ROOT / '.local/compare-prepare') parser.add_argument('--keep', action='store_true', help='keep the prepared folders') @@ -87,7 +94,7 @@ def main(): folders = {name: work / name for name in ['python-1', 'python-2', 'rust']} times = {} for name, folder in folders.items(): - tree(args.python_ref, folder) + tree(args.python_ref, folder, args.python_tree) command = [str(binary), '--root', str(folder), *game] if name == 'rust' else python times[name] = run(name, command, folder, work / f'{name}.log') first, second, rust = (hashes(folders[n]) for n in ['python-1', 'python-2', 'rust'])