-
Notifications
You must be signed in to change notification settings - Fork 942
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support arm64 #5320
base: main
Are you sure you want to change the base?
Support arm64 #5320
Conversation
b287234
to
13d4e30
Compare
Thanks for this PR! @harryzcy instead of commenting things as a first step, I would start from making the |
3a5edad
to
2b614d7
Compare
2b614d7
to
ca63be2
Compare
if [[ "${TARGETARCH}" == "amd64" ]]; then | ||
LINTER_NAMES_ARRAY['ENV']="dotenv-linter" | ||
LINTER_NAMES_ARRAY['POWERSHELL']="pwsh" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These two linters are only available in the standard
image. I'm wondering if we can start with the slim
image only, instead of having to account for these cases here and in the Dockerfile.
if [[ "${TARGETARCH}" != "amd64" ]]; then | ||
# Install Rust compiler (required by checkov on arm64) # | ||
# remove this once https://github.com/bridgecrewio/checkov/pull/6045 is merged | ||
apk add --no-cache curl | ||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
export PATH=$PATH:$HOME/.cargo/bin | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if that Checkov PR lands in, so we can skip this part.
dependencies/python/build-venvs.sh
Outdated
apk add --no-cache --virtual .python-build-deps \ | ||
gcc \ | ||
linux-headers \ | ||
musl-dev \ | ||
packages=( | ||
gcc | ||
linux-headers | ||
musl-dev | ||
python3-dev | ||
) | ||
|
||
if [[ "${TARGETARCH}" != "amd64" ]]; then | ||
# libffi-dev is required for building wheel for cffi, | ||
# until https://github.com/python-cffi/cffi/issues/69 is merged | ||
packages+=(libffi-dev) | ||
fi | ||
|
||
apk add --no-cache --virtual .python-build-deps \ | ||
"${packages[@]}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's see if that cffi PR lands, so we can skip this change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That PR landed, shall we remove this if
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the logs, cffi still need to built from source until a release is landed
#71 659.6 Building wheel for cffi (pyproject.toml): started
@@ -58,7 +58,6 @@ LINTER_NAMES_ARRAY['R']="R" | |||
LINTER_NAMES_ARRAY['RAKU']="raku" | |||
LINTER_NAMES_ARRAY['RENOVATE']="renovate-config-validator" | |||
LINTER_NAMES_ARRAY['RUBY']="rubocop" | |||
LINTER_NAMES_ARRAY['SCALAFMT']="scalafmt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is going to be a bit more challenging. Is scalafmt
not available on arm64?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, not available yet. i don't know anything about scala and is having a hard time contributing a multi-arch image for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that there's a scalafmt-macos executable available since a few releases? Maybe that's useful in this case?
9e1c809
to
afb0efc
Compare
This pull request has been automatically marked as stale because it has not had recent activity. If you think this pull request should stay open, please remove the If you're a maintainer, you can stop the bot to mark this issue as stale in the future by adding the |
This comment was marked as off-topic.
This comment was marked as off-topic.
eae232f
to
07347cd
Compare
252ac4c
to
860b230
Compare
860b230
to
1b33f1b
Compare
9df4f73
to
e35a567
Compare
if [[ "${IMAGE}" == "standard" ]]; then | ||
LINTER_NAMES_ARRAY['ARM']="arm-ttk" | ||
LINTER_NAMES_ARRAY['CSHARP']="dotnet" | ||
LINTER_NAMES_ARRAY['ENV']="dotenv-linter" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that dotenv-linter has an arm64 image? dotenv-linter/dotenv-linter#533
if [[ "${IMAGE}" == "standard" ]]; then | ||
LINTER_NAMES_ARRAY['ARM']="arm-ttk" | ||
LINTER_NAMES_ARRAY['CSHARP']="dotnet" | ||
LINTER_NAMES_ARRAY['ENV']="dotenv-linter" | ||
LINTER_NAMES_ARRAY['POWERSHELL']="pwsh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
arm64 request tracked in PowerShell/PowerShell-Docker#795
@@ -25,6 +25,24 @@ function ValidateBooleanConfigurationVariables() { | |||
ValidateBooleanVariable "YAML_ERROR_ON_WARNING" "${YAML_ERROR_ON_WARNING}" | |||
} | |||
|
|||
function ValidatePlatformArchitecture() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we shouldn't validate this at runtime, but rather when we build the image. Also, we wouldn't want to silently disable linters in the case that they aren't available on a given platform.
I would revert this change and the related function call in linter.sh
. We likely need to think a bit more about how to handle this.
Thanks!
@@ -108,6 +108,7 @@ declare -l YAML_ERROR_ON_WARNING | |||
YAML_ERROR_ON_WARNING="${YAML_ERROR_ON_WARNING:-false}" | |||
|
|||
ValidateBooleanConfigurationVariables | |||
ValidatePlatformArchitecture |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you revert this change as well? See my previous comment.
Proposed changes
Fix #5070
Fix #5339
Readiness checklist
In order to have this pull request merged, complete the following tasks.
Pull request author tasks
I added the
Fix #ISSUE_NUMBER
label to the description of the pull request.Super-linter maintainer tasks
breaking
if this change breaks compatibility with the previous released version.automation
,bug
,documentation
,enhancement
,infrastructure
.