Skip to content

Commit

Permalink
[Refactor:Autograding] Cleanup make output log (Submitty#8333)
Browse files Browse the repository at this point in the history
fix: cleanup make log

Co-authored-by: TKoz[0] <[email protected]>
  • Loading branch information
Viyerelu23333 and tkoz0 authored Feb 28, 2023
1 parent eea4012 commit 5bcd9e2
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 18 deletions.
4 changes: 1 addition & 3 deletions bin/build_homework_function.sh
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,10 @@ function build_homework {

# capture exit code of make
make_res="$?"
chmod -f 660 "$hw_build_path/log_make_output.txt"
find "$hw_build_path" -type d -exec chmod -f ug+rwx,g+s,o= {} \;
find "$hw_build_path" -type f -exec chmod -f ug+rw,o= {} \;
if (( "$make_res" != 0 )); then
echo -e "\nMAKE ERROR\nlogfile: $hw_build_path/log_make_output.txt\n\n"
cat "$hw_build_path/log_make_output.txt"
echo -e "\nMAKE ERROR\n\n"
fix_permissions "$hw_config" "$hw_bin_path" "$hw_build_path" "$course_dir" "$assignment" "$course_group"
popd > /dev/null
exit 1
Expand Down
4 changes: 1 addition & 3 deletions site/app/controllers/admin/AdminGradeableController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1349,10 +1349,8 @@ public function getBuildLogs(string $gradeable_id): JsonResponse {
$build_script_output = is_file($build_script_output_file) ? htmlentities(file_get_contents($build_script_output_file)) : null;
$cmake_out_dir = FileUtils::joinPaths($this->core->getConfig()->getCoursePath(), 'build', $gradeable_id, 'log_cmake_output.txt');
$cmake_output = is_file($cmake_out_dir) ? htmlentities(file_get_contents($cmake_out_dir)) : null;
$make_out_dir = FileUtils::joinPaths($this->core->getConfig()->getCoursePath(), 'build', $gradeable_id, 'log_make_output.txt');
$make_output = is_file($make_out_dir) ? htmlentities(file_get_contents($make_out_dir)) : null;

return JsonResponse::getSuccessResponse([$build_script_output,$cmake_output,$make_output]);
return JsonResponse::getSuccessResponse([$build_script_output,$cmake_output]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,11 +134,6 @@
<pre id="cmake-log-body"></pre>
</div>

<div class="log-container" hidden>
<div class="option-title">Make output:</div>
<pre id="make-log-body"></pre>
</div>

</div>

<script>
Expand Down
7 changes: 0 additions & 7 deletions site/public/js/admin-gradeable-updates.js
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,6 @@ function ajaxGetBuildLogs(gradeable_id) {
success: function (response) {
var build_info = response['data'][0];
var cmake_info = response['data'][1];
var make_info = response['data'][2];

if (build_info != null) {
$('#build-log-body').html(build_info);
Expand All @@ -340,12 +339,6 @@ function ajaxGetBuildLogs(gradeable_id) {
else {
$('#cmake-log-body').html('There is currently no cmake output.');
}
if (make_info != null) {
$('#make-log-body').html(make_info);
}
else {
$('#make-log-body').html('There is currently no make output.');
}

$('.log-container').show();
$('#open-build-log').hide();
Expand Down

0 comments on commit 5bcd9e2

Please sign in to comment.