From bc44b73601a2043ddb025e71c83d46469edf5388 Mon Sep 17 00:00:00 2001 From: Prabhu Subramanian Date: Wed, 15 Jan 2025 17:12:22 +0000 Subject: [PATCH] =?UTF-8?q?Life=20must=20be=20simple.=20Removed=20the=20pr?= =?UTF-8?q?oblematic=20utf-8=20character=20=E2=9A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Prabhu Subramanian --- README.md | 7 +++++++ ci/Dockerfile | 1 + ci/Dockerfile.sle | 1 + src/main/scala/io/appthreat/atom/Atom.scala | 16 +++++++--------- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 67ee1da..96018e3 100644 --- a/README.md +++ b/README.md @@ -153,6 +153,13 @@ docker run --rm -v /tmp:/tmp -v $(pwd):/app:rw -it ghcr.io/appthreat/atom atom u # podman run --rm -v /tmp:/tmp -v $(pwd):/app:rw -it ghcr.io/appthreat/atom atom usages -l ruby -o /app/app.atom -s /app/usages.slices.json /app ``` +Pass the argument `--platform=linux/amd64` when you face issues with Java or Ruby builds on arm64 architecture. + +```shell +docker run --rm --platform=linux/amd64 -v /tmp:/tmp -v $(pwd):/app:rw -it ghcr.io/appthreat/atom atom usages -l ruby -o /app/app.atom -s /app/usages.slices.json /app +# podman run --rm --platform=linux/amd64 -v /tmp:/tmp -v $(pwd):/app:rw -it ghcr.io/appthreat/atom atom usages -l ruby -o /app/app.atom -s /app/usages.slices.json /app +``` + ### Create data-flow slice for a java project. ```shell diff --git a/ci/Dockerfile b/ci/Dockerfile index 62ffedc..c9014f2 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -54,6 +54,7 @@ RUN set -e; \ pcre2 findutils which tar gzip zip unzip sudo nodejs rust \ && microdnf install -y epel-release \ && microdnf install --enablerepo=crb -y libyaml-devel jemalloc-devel \ + && java --version \ && git clone https://github.com/rbenv/rbenv.git --depth=1 ~/.rbenv \ && echo 'export PATH="/root/.rbenv/bin:$PATH"' >> ~/.bashrc \ && echo 'eval "$(/root/.rbenv/bin/rbenv init - bash)"' >> ~/.bashrc \ diff --git a/ci/Dockerfile.sle b/ci/Dockerfile.sle index 8dbeb9d..aa4f2d4 100644 --- a/ci/Dockerfile.sle +++ b/ci/Dockerfile.sle @@ -88,6 +88,7 @@ RUN unzip -q atom.zip \ && cd /opt/nodejs && npm install --only=production && cd /opt \ && npm install -g /opt/nodejs \ && rm -rf atom.zip composer.json composer.lock composer-setup.php /usr/local/bin/atom \ + && java --version \ && /opt/bin/atom --help \ && which astgen \ && which phpastgen \ diff --git a/src/main/scala/io/appthreat/atom/Atom.scala b/src/main/scala/io/appthreat/atom/Atom.scala index ab1c80c..e08c48f 100644 --- a/src/main/scala/io/appthreat/atom/Atom.scala +++ b/src/main/scala/io/appthreat/atom/Atom.scala @@ -46,15 +46,13 @@ import scala.util.{Failure, Properties, Success, Try} object Atom: - val DEFAULT_ATOM_OUT_FILE: String = - if Properties.isWin || Charset.defaultCharset() != Charset.forName("UTF-8") then "app.atom" - else "app.⚛" - val DEFAULT_SLICE_OUT_FILE = "slices.json" - val DEFAULT_SLICE_DEPTH = 7 - val DEFAULT_MAX_DEFS: Int = 2000 - val FRAMEWORK_INPUT_TAG: String = "framework-input" - val FRAMEWORK_OUTPUT_TAG: String = "framework-output" - val DEFAULT_EXPORT_DIR: String = "atom-exports" + val DEFAULT_ATOM_OUT_FILE: String = "app.atom" + val DEFAULT_SLICE_OUT_FILE = "slices.json" + val DEFAULT_SLICE_DEPTH = 7 + val DEFAULT_MAX_DEFS: Int = 2000 + val FRAMEWORK_INPUT_TAG: String = "framework-input" + val FRAMEWORK_OUTPUT_TAG: String = "framework-output" + val DEFAULT_EXPORT_DIR: String = "atom-exports" // Possible values: graphml, dot val DEFAULT_EXPORT_FORMAT: String = "graphml" // Possible values: no-delombok, default, types-only, run-delombok