From 234f18d75a5c870f952c75a7274332fbc91370c8 Mon Sep 17 00:00:00 2001 From: Nathan Wang Date: Mon, 8 Jul 2024 20:29:30 -0400 Subject: [PATCH] debug --- Dockerfile | 3 +++ src/compile.rs | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 70048e9..0336ffd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,6 +16,9 @@ RUN g++ -std=c++11 -O2 -fsanitize=address -o /precompiled-headers/bits/stdc++.h. RUN g++ -std=c++17 -O2 -fsanitize=address -o /precompiled-headers/bits/stdc++.h.gch/05 /usr/include/c++/11/x86_64-amazon-linux/bits/stdc++.h RUN g++ -std=c++23 -O2 -fsanitize=address -o /precompiled-headers/bits/stdc++.h.gch/06 /usr/include/c++/11/x86_64-amazon-linux/bits/stdc++.h +# ^ this takes 0.3s to compile. However, the initial compilation can take a lot longer than 5 seconds, presumably because lambda disk read speeds are very slow. +# I think maybe we try to compile this after execution or something. + RUN dnf install -y java-21-amazon-corretto-devel RUN dnf install -y time diff --git a/src/compile.rs b/src/compile.rs index 783a453..9ed3741 100644 --- a/src/compile.rs +++ b/src/compile.rs @@ -49,12 +49,15 @@ pub fn compile(compile_request: CompileRequest) -> Result { "g++ -I/precompiled-headers -o {} {} program.cpp", output_file_path, compile_request.compiler_options ); + let command = format!( + "cp /precompiled-headers/bits/stdc++.h.gch/01 /tmp/01", + ); let compile_output = run_command( &command, tmp_dir.path(), CommandOptions { stdin: String::new(), - timeout_ms: 5000, + timeout_ms: 35000, }, )?;