From ddec01a42915a0abf7d009df62391c5bb11ed1a9 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Mon, 29 Jul 2019 23:53:43 +0300 Subject: [PATCH 1/6] feat: gcc,npm,node versions on issues --- .../angular-template/frontend/npm-debug.log | 46 +++++++++++++++++++ cmd/wails/9_issue.go | 25 ++++++++++ 2 files changed, 71 insertions(+) create mode 100644 cmd/templates/angular-template/frontend/npm-debug.log diff --git a/cmd/templates/angular-template/frontend/npm-debug.log b/cmd/templates/angular-template/frontend/npm-debug.log new file mode 100644 index 00000000..64c9f05c --- /dev/null +++ b/cmd/templates/angular-template/frontend/npm-debug.log @@ -0,0 +1,46 @@ +0 info it worked if it ends with ok +1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ] +2 info using npm@3.5.2 +3 info using node@v8.10.0 +4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] +5 info lifecycle my-app@0.0.0~prebuild: my-app@0.0.0 +6 silly lifecycle my-app@0.0.0~prebuild: no script for prebuild, continuing +7 info lifecycle my-app@0.0.0~build: my-app@0.0.0 +8 verbose lifecycle my-app@0.0.0~build: unsafe-perm in lifecycle true +9 verbose lifecycle my-app@0.0.0~build: PATH: /usr/share/npm/bin/node-gyp-bin:/home/bh90210/wails-angular/frontend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/usr/local/go/bin:/home/bh90210/go/bin +10 verbose lifecycle my-app@0.0.0~build: CWD: /home/bh90210/wails-angular/frontend +11 silly lifecycle my-app@0.0.0~build: Args: [ '-c', +11 silly lifecycle 'npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false' ] +12 silly lifecycle my-app@0.0.0~build: Returned: code: 3 signal: null +13 info lifecycle my-app@0.0.0~build: Failed to exec build script +14 verbose stack Error: my-app@0.0.0 build: `npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false` +14 verbose stack Exit status 3 +14 verbose stack at EventEmitter. (/usr/share/npm/lib/utils/lifecycle.js:232:16) +14 verbose stack at emitTwo (events.js:126:13) +14 verbose stack at EventEmitter.emit (events.js:214:7) +14 verbose stack at ChildProcess. (/usr/share/npm/lib/utils/spawn.js:24:14) +14 verbose stack at emitTwo (events.js:126:13) +14 verbose stack at ChildProcess.emit (events.js:214:7) +14 verbose stack at maybeClose (internal/child_process.js:925:16) +14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) +15 verbose pkgid my-app@0.0.0 +16 verbose cwd /home/bh90210/wails-angular/frontend +17 error Linux 4.18.0-22-generic +18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "build" +19 error node v8.10.0 +20 error npm v3.5.2 +21 error code ELIFECYCLE +22 error my-app@0.0.0 build: `npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false` +22 error Exit status 3 +23 error Failed at the my-app@0.0.0 build script 'npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false'. +23 error Make sure you have the latest version of node.js and npm installed. +23 error If you do, this is most likely a problem with the my-app package, +23 error not with npm itself. +23 error Tell the author that this fails on your system: +23 error npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false +23 error You can get information on how to open an issue for this project with: +23 error npm bugs my-app +23 error Or if that isn't available, you can get their info via: +23 error npm owner ls my-app +23 error There is likely additional logging output above. +24 verbose exit [ 1, true ] diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index 596363c8..ed735679 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -42,12 +42,37 @@ To help you in this process, we will ask for some information, add Go/Wails deta gomodule = "(Not Set)" } + // Get versions for GCC, node & npm + program := cmd.NewProgramHelper() + var gccVersion, nodeVersion, npmVersion string + + gcc := program.FindProgram("gcc") + if gcc != nil { + stdout, _, _, _ := gcc.Run("--version") + gccVersion = stdout + } + + npm := program.FindProgram("npm") + if npm != nil { + stdout, _, _, _ := npm.Run("--version") + nodeVersion = stdout + } + + node := program.FindProgram("node") + if node != nil { + stdout, _, _, _ := node.Run("--version") + npmVersion = stdout + } + str.WriteString("\n| Name | Value |\n| ----- | ----- |\n") str.WriteString(fmt.Sprintf("| Wails Version | %s |\n", cmd.Version)) str.WriteString(fmt.Sprintf("| Go Version | %s |\n", runtime.Version())) str.WriteString(fmt.Sprintf("| Platform | %s |\n", runtime.GOOS)) str.WriteString(fmt.Sprintf("| Arch | %s |\n", runtime.GOARCH)) str.WriteString(fmt.Sprintf("| GO111MODULE | %s |\n", gomodule)) + str.WriteString(fmt.Sprintf("| Gcc | %s |\n", gccVersion)) + str.WriteString(fmt.Sprintf("| Npm | %s |\n", npmVersion)) + str.WriteString(fmt.Sprintf("| Node | %s |\n", nodeVersion)) fmt.Println() fmt.Println("Processing template and preparing for upload.") From 6e81a36adaca544cf4f1649367b29bb24e3ee3e4 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Tue, 30 Jul 2019 02:02:01 +0300 Subject: [PATCH 2/6] linux working --- cmd/wails/9_issue.go | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index ed735679..a4c64c7e 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -6,6 +6,7 @@ import ( "net/http" "net/url" "os" + "os/exec" "runtime" "strings" @@ -46,22 +47,29 @@ To help you in this process, we will ask for some information, add Go/Wails deta program := cmd.NewProgramHelper() var gccVersion, nodeVersion, npmVersion string - gcc := program.FindProgram("gcc") - if gcc != nil { - stdout, _, _, _ := gcc.Run("--version") - gccVersion = stdout - } + //gcc := program.FindProgram("gcc") + //if gcc != nil { + // stdout, _, _, _ := gcc.Run("--version", "|", "sed", "'s/[^0-9.]*\\([0-9.]*\\).*/\\1/'", "|", "grep", "-m1", "''") + // gccVersion = stdout + //} + + gccCmd := "gcc --version | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/' | grep -m1 ''" + gcc, _ := exec.Command("bash", "-c", gccCmd).Output() + gccVersion = string(gcc) + gccVersion = gccVersion[:len(gccVersion)-1] npm := program.FindProgram("npm") if npm != nil { stdout, _, _, _ := npm.Run("--version") nodeVersion = stdout + nodeVersion = nodeVersion[:len(nodeVersion)-1] } node := program.FindProgram("node") if node != nil { stdout, _, _, _ := node.Run("--version") npmVersion = stdout + npmVersion = npmVersion[:len(npmVersion)-1] } str.WriteString("\n| Name | Value |\n| ----- | ----- |\n") @@ -70,9 +78,9 @@ To help you in this process, we will ask for some information, add Go/Wails deta str.WriteString(fmt.Sprintf("| Platform | %s |\n", runtime.GOOS)) str.WriteString(fmt.Sprintf("| Arch | %s |\n", runtime.GOARCH)) str.WriteString(fmt.Sprintf("| GO111MODULE | %s |\n", gomodule)) - str.WriteString(fmt.Sprintf("| Gcc | %s |\n", gccVersion)) - str.WriteString(fmt.Sprintf("| Npm | %s |\n", npmVersion)) - str.WriteString(fmt.Sprintf("| Node | %s |\n", nodeVersion)) + str.WriteString(fmt.Sprintf("| GCC | %s |\n", gccVersion)) + str.WriteString(fmt.Sprintf("| Npm | %s |\n", npmVersion)) + str.WriteString(fmt.Sprintf("| Node | %s |\n", nodeVersion)) fmt.Println() fmt.Println("Processing template and preparing for upload.") From 3f657b34cfe9be3b1b22740e427425782ed0e076 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Tue, 30 Jul 2019 02:12:51 +0300 Subject: [PATCH 3/6] darwin working --- cmd/wails/9_issue.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index a4c64c7e..afb2404e 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -53,10 +53,18 @@ To help you in this process, we will ask for some information, add Go/Wails deta // gccVersion = stdout //} - gccCmd := "gcc --version | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/' | grep -m1 ''" - gcc, _ := exec.Command("bash", "-c", gccCmd).Output() - gccVersion = string(gcc) - gccVersion = gccVersion[:len(gccVersion)-1] + switch runtime.GOOS { + case "darwin": + gccCmd := "gcc -dumpversion | cut -f1,2,3 -d." + gcc, _ := exec.Command("bash", "-c", gccCmd).Output() + gccVersion = string(gcc) + //gccVersion = gccVersion[:len(gccVersion)-1] + case "linux": + gccCmd := "gcc --version | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/' | grep -m1 ''" + gcc, _ := exec.Command("bash", "-c", gccCmd).Output() + gccVersion = string(gcc) + gccVersion = gccVersion[:len(gccVersion)-1] + } npm := program.FindProgram("npm") if npm != nil { From b9b42c059e8677c95733cdf9c87700e8ad96e552 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Tue, 30 Jul 2019 15:57:51 +0300 Subject: [PATCH 4/6] feat: show gcc, node, npm version on issue report --- cmd/wails/9_issue.go | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index afb2404e..77ee8de8 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -6,7 +6,6 @@ import ( "net/http" "net/url" "os" - "os/exec" "runtime" "strings" @@ -47,23 +46,24 @@ To help you in this process, we will ask for some information, add Go/Wails deta program := cmd.NewProgramHelper() var gccVersion, nodeVersion, npmVersion string - //gcc := program.FindProgram("gcc") - //if gcc != nil { - // stdout, _, _, _ := gcc.Run("--version", "|", "sed", "'s/[^0-9.]*\\([0-9.]*\\).*/\\1/'", "|", "grep", "-m1", "''") - // gccVersion = stdout - //} - switch runtime.GOOS { case "darwin": - gccCmd := "gcc -dumpversion | cut -f1,2,3 -d." - gcc, _ := exec.Command("bash", "-c", gccCmd).Output() - gccVersion = string(gcc) - //gccVersion = gccVersion[:len(gccVersion)-1] + gcc := program.FindProgram("gcc") + if gcc != nil { + stdout, _, _, _ := gcc.Run("-dumpversion") + gccVersion = stdout + // TODO: check if linefeed needs stripping or what kind + // gccVersion = gccVersion[:len(nodeVersion)-1] + } case "linux": - gccCmd := "gcc --version | sed 's/[^0-9.]*\\([0-9.]*\\).*/\\1/' | grep -m1 ''" - gcc, _ := exec.Command("bash", "-c", gccCmd).Output() - gccVersion = string(gcc) - gccVersion = gccVersion[:len(gccVersion)-1] + gcc := program.FindProgram("gcc") + if gcc != nil { + stdout, _, _, _ := gcc.Run("-dumpfullversion") + gccVersion = stdout + gccVersion = gccVersion[:len(nodeVersion)-1] + } + + // TODO: windows support } npm := program.FindProgram("npm") From 6c8d34dfd3876e80b8aedda4aec54cc33711ab36 Mon Sep 17 00:00:00 2001 From: "admin_3.exe" Date: Tue, 30 Jul 2019 16:00:16 +0300 Subject: [PATCH 5/6] Delete npm-debug.log --- .../angular-template/frontend/npm-debug.log | 46 ------------------- 1 file changed, 46 deletions(-) delete mode 100644 cmd/templates/angular-template/frontend/npm-debug.log diff --git a/cmd/templates/angular-template/frontend/npm-debug.log b/cmd/templates/angular-template/frontend/npm-debug.log deleted file mode 100644 index 64c9f05c..00000000 --- a/cmd/templates/angular-template/frontend/npm-debug.log +++ /dev/null @@ -1,46 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'build' ] -2 info using npm@3.5.2 -3 info using node@v8.10.0 -4 verbose run-script [ 'prebuild', 'build', 'postbuild' ] -5 info lifecycle my-app@0.0.0~prebuild: my-app@0.0.0 -6 silly lifecycle my-app@0.0.0~prebuild: no script for prebuild, continuing -7 info lifecycle my-app@0.0.0~build: my-app@0.0.0 -8 verbose lifecycle my-app@0.0.0~build: unsafe-perm in lifecycle true -9 verbose lifecycle my-app@0.0.0~build: PATH: /usr/share/npm/bin/node-gyp-bin:/home/bh90210/wails-angular/frontend/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/local/go/bin:/usr/local/go/bin:/home/bh90210/go/bin -10 verbose lifecycle my-app@0.0.0~build: CWD: /home/bh90210/wails-angular/frontend -11 silly lifecycle my-app@0.0.0~build: Args: [ '-c', -11 silly lifecycle 'npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false' ] -12 silly lifecycle my-app@0.0.0~build: Returned: code: 3 signal: null -13 info lifecycle my-app@0.0.0~build: Failed to exec build script -14 verbose stack Error: my-app@0.0.0 build: `npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false` -14 verbose stack Exit status 3 -14 verbose stack at EventEmitter. (/usr/share/npm/lib/utils/lifecycle.js:232:16) -14 verbose stack at emitTwo (events.js:126:13) -14 verbose stack at EventEmitter.emit (events.js:214:7) -14 verbose stack at ChildProcess. (/usr/share/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:126:13) -14 verbose stack at ChildProcess.emit (events.js:214:7) -14 verbose stack at maybeClose (internal/child_process.js:925:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5) -15 verbose pkgid my-app@0.0.0 -16 verbose cwd /home/bh90210/wails-angular/frontend -17 error Linux 4.18.0-22-generic -18 error argv "/usr/bin/node" "/usr/bin/npm" "run" "build" -19 error node v8.10.0 -20 error npm v3.5.2 -21 error code ELIFECYCLE -22 error my-app@0.0.0 build: `npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false` -22 error Exit status 3 -23 error Failed at the my-app@0.0.0 build script 'npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false'. -23 error Make sure you have the latest version of node.js and npm installed. -23 error If you do, this is most likely a problem with the my-app package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error npx ng build --single-bundle true --output-hashing none --prod --bundle-styles false -23 error You can get information on how to open an issue for this project with: -23 error npm bugs my-app -23 error Or if that isn't available, you can get their info via: -23 error npm owner ls my-app -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] From 6c945a4eede9f5ff09d4d9c03f2935734032c715 Mon Sep 17 00:00:00 2001 From: bh90210 Date: Tue, 30 Jul 2019 16:11:18 +0300 Subject: [PATCH 6/6] fix: crashing typo --- cmd/wails/9_issue.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/wails/9_issue.go b/cmd/wails/9_issue.go index 77ee8de8..c74d350e 100644 --- a/cmd/wails/9_issue.go +++ b/cmd/wails/9_issue.go @@ -53,14 +53,14 @@ To help you in this process, we will ask for some information, add Go/Wails deta stdout, _, _, _ := gcc.Run("-dumpversion") gccVersion = stdout // TODO: check if linefeed needs stripping or what kind - // gccVersion = gccVersion[:len(nodeVersion)-1] + // gccVersion = gccVersion[:len(gccVersion)-1] } case "linux": gcc := program.FindProgram("gcc") if gcc != nil { stdout, _, _, _ := gcc.Run("-dumpfullversion") gccVersion = stdout - gccVersion = gccVersion[:len(nodeVersion)-1] + gccVersion = gccVersion[:len(gccVersion)-1] } // TODO: windows support