apache / openwhisk-wskdeploy

Apache OpenWhisk utility for deploying and managing OpenWhisk projects and packages
https://openwhisk.apache.org/
Apache License 2.0
77 stars 74 forks source link

Unrecognized architecture:aarch64 #1129

Closed advancedwebdeveloper closed 3 years ago

advancedwebdeveloper commented 3 years ago

Hello.

I caught such error:

$ ./gradlew

FAILURE: Build failed with an exception.

  • Where: Build file '/home/oceanfish81/openwhisk-wskdeploy/build.gradle' line: 32

  • What went wrong: An exception occurred applying plugin request [id: 'com.github.blindpirate.gogradle', version: '0.10']

    Failed to apply plugin 'com.github.blindpirate.gogradle'. Could not create task ':goBuild'. Could not create task of type 'GoBuild'. Unrecognized architecture:aarch64

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

mrutkows commented 3 years ago

@advancedwebdeveloper the gradle wrapper build works fine within our Linux (Ubuntu) build pipeline which runs with every GitHub PR and on every merge (release). It also runs well (verified) on local Ubuntu and Mac OS just fine.

Not sure why it even attempted to build "AARCH64" as it is not in the supported matrix: https://github.com/apache/openwhisk-wskdeploy#downloading-released-binaries

and not in the build.gradle array: https://github.com/apache/openwhisk-wskdeploy/blob/master/build.gradle

Can you provide more on your environment and verify you are using the recommended versions of Go Language (1.15) and Gradle. Also, please explain why AARCH64 is even being attempted as ARM64 is what is in the build matrix.

advancedwebdeveloper commented 3 years ago

@mrutkows , I have access to those servers - and they are alternative to x86_64. So diversification is the answer.

$ git diff diff --git a/build.gradle b/build.gradle index dde0a2f..34ba571 100644 --- a/build.gradle +++ b/build.gradle @@ -26,7 +26,7 @@ buildscript { }

plugins {

  • id 'com.github.blindpirate.gogradle' version '0.10'
  • id 'com.github.blindpirate.gogradle' version '0.11.4' }

    subprojects { @@ -200,8 +200,8 @@ task getGoBinData(type: Exec) {

    task goI18n(type: Exec) { dependsOn 'getGoBinData'

  • executable = "$System.env.GOPATH" + '/bin/go-bindata'
  • // run '${GOPATH}/bin/go-bindata -pkg wski18n -o wski18n/i18n_resources.go wski18n/resources'
  • executable = 'go-bindata'
  • // run 'go-bindata -pkg wski18n -o wski18n/i18n_resources.go wski18n/resources' args = ['-pkg', 'wski18n', '-o', 'wski18n/i18n_resources.go', 'wski18n/resources']

    doLast{ $ git log -1 commit 92c251f5d3a873029ccd8d815409582301d1103d (HEAD -> master, origin/master, origin/HEAD) Author: David Grove dgrove-oss@users.noreply.github.com Date: Sat Mar 13 10:23:20 2021 -0500

    configure github project via .asf.yaml (#501)

Please instruct me about what should I track/trace/log, in detail. CC @ianlancetaylor, for the Golang's ecosystem stuff.

mrutkows commented 3 years ago

@advancedwebdeveloper as I cannot reproduce locally or see in the Travis builds, not sure how to help...

and not sure why the problem changed to "go-bindata" (tool) execution? Which is a tool that is dated, but has never failed with current configs. Are you trying to have me infer that you are with ASF Infra. and trying to use new build hardware?

If there is a hardware architecture issue with this project, the same go-bindata tool is also used in the CLI project (and is why we use in wskdeploy project) since we are a plugin to that tool.

mrutkows commented 3 years ago

@advancedwebdeveloper your first problem capture indicated:

Build file '/home/oceanfish81/openwhisk-wskdeploy/build.gradle' line: 32

plugins {
    id 'com.github.blindpirate.gogradle' version '0.10'
}

seems to imply the import of the "gogradle" gradle plugin failed... does the build environment have external access to that tool/repo? (https://github.com/gogradle/gogradle)

Again, the OpenWhisk CLI also loads this plugin: https://github.com/apache/openwhisk-cli/blob/master/build.gradle

advancedwebdeveloper commented 3 years ago

If you are talking about

$ git clone https://github.com/gogradle/gogradle

git clone https://github.com/gogradle/gogradle Cloning into 'gogradle'... remote: Enumerating objects: 77, done. remote: Counting objects: 100% (77/77), done. remote: Compressing objects: 100% (45/45), done. remote: Total 37737 (delta 20), reused 56 (delta 12), pack-reused 37660 Receiving objects: 100% (37737/37737), 10.57 MiB | 16.34 MiB/s, done. Resolving deltas: 100% (17078/17078), done.

On Wed, Mar 17, 2021 at 5:52 PM Matt Rutkowski @.***> wrote:

@advancedwebdeveloper https://github.com/advancedwebdeveloper your first problem capture indicated:

Build file '/home/oceanfish81/openwhisk-wskdeploy/build.gradle' line: 32

seems to imply the import of the "gogradle" gradle plugin failed... does the build environment have external access to that tool/repo? ( https://github.com/gogradle/gogradle)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/openwhisk-wskdeploy/issues/1129#issuecomment-801195518, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJHLKSV3XBWWVZGC45QZT3TEDF25ANCNFSM4ZJZK73A .

advancedwebdeveloper commented 3 years ago

How should I enable additional tracing?

On Wed, Mar 17, 2021 at 6:10 PM Yan Titarenko @.***> wrote:

If you are talking about

$ git clone https://github.com/gogradle/gogradle

git clone https://github.com/gogradle/gogradle Cloning into 'gogradle'... remote: Enumerating objects: 77, done. remote: Counting objects: 100% (77/77), done. remote: Compressing objects: 100% (45/45), done. remote: Total 37737 (delta 20), reused 56 (delta 12), pack-reused 37660 Receiving objects: 100% (37737/37737), 10.57 MiB | 16.34 MiB/s, done. Resolving deltas: 100% (17078/17078), done.

  • yes. Or you are considering something else?

On Wed, Mar 17, 2021 at 5:52 PM Matt Rutkowski @.***> wrote:

@advancedwebdeveloper https://github.com/advancedwebdeveloper your first problem capture indicated:

Build file '/home/oceanfish81/openwhisk-wskdeploy/build.gradle' line: 32

seems to imply the import of the "gogradle" gradle plugin failed... does the build environment have external access to that tool/repo? ( https://github.com/gogradle/gogradle)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/openwhisk-wskdeploy/issues/1129#issuecomment-801195518, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABJHLKSV3XBWWVZGC45QZT3TEDF25ANCNFSM4ZJZK73A .

mrutkows commented 3 years ago

@advancedwebdeveloper

I have no idea how you increase tracing in Gradle Wrapper, I am a novice user of it as a build tool and it has never failed for me where low-level trace was needed (simply inspecting the line number and treating as a Java application was always enough) or simply manually running (locally) the build tools in the gradle tasks and making sure build paths, etc. were correct sufficed.

It seems like you have 2 problems (I can infer)....

advancedwebdeveloper commented 3 years ago

I was able to perform

$ ./gradlew goBuild

Configure project : Found go 1.16.2 in /usr/local/go/bin/go, use it.

Task :goPrepare Use project GOPATH: /home/oceanfish81/openwhisk-wskdeploy/.gogradle/project_gopath

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/6.8.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD SUCCESSFUL in 2s 3 actionable tasks: 3 executed

with

https://gist.github.com/advancedwebdeveloper/9ee1d333d0101b06823735cf871055b1

advancedwebdeveloper commented 3 years ago

Sorry, that was ahead of the discussion - it contained a modified source code.

Consider using such a diff:

diff --git a/Dockerfile b/Dockerfile index f3dd5c7..f7f580e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@

limitations under the License.

#

-FROM golang:1.15 +FROM golang:1.16.2

Install zip

RUN apt-get -y update && \ diff --git a/build.gradle b/build.gradle index 4c9ce40..8280e80 100644 --- a/build.gradle +++ b/build.gradle @@ -29,7 +29,7 @@ buildscript { // Gogradle Config: // https://github.com/gogradle/gogradle/blob/master/docs/getting-started.md#configuration plugins {

  • id 'com.github.blindpirate.gogradle' version '0.10'

  • id 'com.github.blindpirate.gogradle' version '0.11.4' }

    apply plugin: "org.nosphere.apache.rat" @@ -176,10 +176,7 @@ if (rootProject.hasProperty('buildPlatforms')) { } else { if (!rootProject.hasProperty('nativeCompile')) { rootProject.ext.platforms = [

  • 'linux-386', 'linux-amd64',

  • 'linux-s390x', 'linux-ppc64le', 'linux-arm', 'linux-arm64',

  • 'darwin-amd64',

  • 'windows-386', 'windows-amd64'

  • 'linux-arm64' ].collect { new OpenWhiskPlatform(it) } } else { rootProject.ext.platforms = [ rootProject.localPlatform ] @@ -258,7 +255,7 @@ task index() { def pathObject = [ "path" : "${p.archiveDirName}/${p.archiveFileName}" ] content.get(p.owOs,[:])[p.goArch] = pathObject // TODO: Default architecture should be configurable as a property

  • if (p.goArch == 'amd64') {

  • if (p.goArch == 'arm64') { content.get(p.owOs,[:])['default'] = pathObject } } diff --git a/build.sh b/build.sh index fb9a3e1..7b1faaa 100644 --- a/build.sh +++ b/build.sh @@ -43,7 +43,7 @@ build_wskdeploy () { export GOOS=$os; fi

  • export GOARCH=$arch

  • export GOARCH=arm64

    cd /src/github.com/apache/openwhisk-wskdeploy go build -ldflags "-X main.Version=date -u '+%Y-%m-%dT%H:%M:%S'" -v -o build/$os/$arch/$bin main.go; @@ -54,7 +54,7 @@ get_compressed_name() { local arch=$2 local product_name="OpenWhisk_WSKDEPLOY"

  • if [ $arch = amd64 ]; then

  • if [ $arch = arm64 ]; then comp_name="$product_name-$os"; elif [ $arch = 386 ]; then comp_name="$product_name-$os-32bit"; @@ -116,6 +116,6 @@ create_wskdeploy_packages() {

    platforms="$WSKDEPLOY_OS" archs="$WSKDEPLOY_ARCH"; -default_arch="amd64" +default_arch="arm64"

    create_wskdeploy_packages

I wasn't heading to cross-compile anything - nor I was heading to run under an emulator. So you can submit a proper patch.