Skip to content

Commit

Permalink
Add Linux ARM override value to diagnose report (#657)
Browse files Browse the repository at this point in the history
In PR #656 I added the experimental Linux ARM build behind a feature
flag. In the implementation I forgot to add the `linux_arm_override`
value to the diagnose report with which we can detect if this env var
was set during installation. This change adds that value to the report.
  • Loading branch information
tombruijn authored Jun 23, 2021
1 parent 31b98f9 commit 76a3140
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 0 deletions.
Empty file added .changesets/.gitkeep
Empty file.
5 changes: 5 additions & 0 deletions .changesets/add-linux-arm-override-to-diagnose-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
bump: "patch"
---

Add Linux ARM override value to diagnose report. This was omitted from the original implementation of the `APPSIGNAL_BUILD_FOR_LINUX_ARM` flag.
2 changes: 2 additions & 0 deletions lib/mix/tasks/appsignal.diagnose.ex
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ defmodule Mix.Tasks.Appsignal.Diagnose do
IO.puts(" Architecture: #{format_value(build_report["architecture"])}")
IO.puts(" Target: #{format_value(build_report["target"])}")
IO.puts(" Musl override: #{format_value(build_report["musl_override"])}")
IO.puts(" Linux ARM override: #{format_value(build_report["linux_arm_override"])}")
IO.puts(" Library type: #{format_value(build_report["library_type"])}")
host_report = installation_report["host"]
IO.puts(" Host details")
Expand All @@ -207,6 +208,7 @@ defmodule Mix.Tasks.Appsignal.Diagnose do
IO.puts(" Architecture: #{format_value(download_report["architecture"])}")
IO.puts(" Target: #{format_value(download_report["target"])}")
IO.puts(" Musl override: #{format_value(download_report["musl_override"])}")
IO.puts(" Linux ARM override: #{format_value(download_report["linux_arm_override"])}")
IO.puts(" Library type: #{format_value(download_report["library_type"])}")
IO.puts(" Checksum: #{format_value(download_report["checksum"])}")
end
Expand Down
3 changes: 3 additions & 0 deletions mix_helpers.exs
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@ defmodule Mix.Appsignal.Helper do
architecture: nil,
target: os,
musl_override: force_musl_build?(),
linux_arm_override: force_linux_arm_build?(),
library_type: "static"
},
host: %{
Expand All @@ -494,6 +495,7 @@ defmodule Mix.Appsignal.Helper do
architecture: architecture,
target: target,
musl_override: musl_override,
linux_arm_override: linux_arm_override,
library_type: library_type
}
} = report
Expand All @@ -511,6 +513,7 @@ defmodule Mix.Appsignal.Helper do
architecture: architecture,
target: target,
musl_override: musl_override,
linux_arm_override: linux_arm_override,
library_type: library_type,
download_url: download_url,
checksum: checksum || "unverified"
Expand Down
3 changes: 3 additions & 0 deletions test/mix/tasks/appsignal_diagnose_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ defmodule Mix.Tasks.Appsignal.DiagnoseTest do
assert Enum.member?(valid_architectures, download_report["architecture"])
assert Enum.member?(valid_targets, download_report["target"])
assert download_report["musl_override"] == false
assert download_report["linux_arm_override"] == false
assert download_report["library_type"] == "static"
assert download_report["checksum"] == "verified"

Expand All @@ -110,6 +111,7 @@ defmodule Mix.Tasks.Appsignal.DiagnoseTest do
assert Enum.member?(valid_architectures, build_report["architecture"])
assert Enum.member?(valid_targets, build_report["target"])
assert download_report["musl_override"] == false
assert download_report["linux_arm_override"] == false
assert build_report["library_type"] == "static"
end

Expand Down Expand Up @@ -1127,6 +1129,7 @@ defmodule Mix.Tasks.Appsignal.DiagnoseTest do
assert output =~ ~r{Architecture: "x86(_64)?"}
assert output =~ ~r{Target: "[\w-]+"}
assert String.contains?(output, " Musl override: false")
assert String.contains?(output, " Linux ARM override: false")
assert String.contains?(output, " Library type: \"static\"")
assert output =~ ~r{Checksum: "(verified|unverified)"}
end
Expand Down

0 comments on commit 76a3140

Please sign in to comment.