GoLand, debugger hangs when starting a debug session apple m1 - go

It doesn't hang Goland, but I can't use step into, step over and other debug buttons. When starting debugging, it prints:
GOPATH=/Users/a/go:/Users/a/sdk/go1.16.3 #gosetup
/Users/a/sdk/go1.16.3/bin/go build -o /private/var/folders/xg/45g_0kp96gj_11cftvnq919r0000gn/T/___go_build_Mur_go -gcflags all=-N -l /Users/a/GoProjects/Main/Mur.go #gosetup
"/Users/a/Library/Application Support/JetBrains/Toolbox/apps/Goland/ch-0/211.7142.13/GoLand.app/Contents/plugins/go/lib/dlv/macarm/dlv" --listen=0.0.0.0:54550 --headless=true --api-version=2 --check-go-version=false --only-same-user=false exec /private/var/folders/xg/45g_0kp96gj_11cftvnq919r0000gn/T/___go_build_Mur_go --
API server listening at: [::]:54550
debugserver-#(#)PROGRAM:LLDB PROJECT:lldb-1205.0.27
for arm64.
Got a connection, launched process /private/var/folders/xg/45g_0kp96gj_11cftvnq919r0000gn/T/___go_build_Mur_go (pid = 97777).

It's a known issue, please see GO-11011.
You can download GoLand Nightly via Toolbox App with the fix or compile Delve manually and specify a path to it, please see the corresponding issue.

Related

What is the message when it is building on Golang?

When I build source on Golang, I saw the warning message, but I couldn't find answer about it.
$ go build --mod=mod -o main main.go
# command-line-arguments
ld: warning: -no_pie is deprecated when targeting new OS versions
specs
version : go version go1.18 darwin/amd64
os : Monterey 12.6
build command : go build --mod=mod -o [binary name] main.go
From GitHub: link
There are a few options:
- wait for the next Go 1.19.x and 1.18.x releases, probably early next month
- build Go from the master branch
- pass -buildmode=pie flag to go build and go test for a workaround
- use older version of the system linker
This seems to be a known issue. See Github for more information.
As a workaround you can pass the -buildmode=pie flag to your go build command.

Unable to locate adb on macOS Catalina

I am starting to learn how to do mobile programming with ReactNative on an android environment. I’m using MacOS Catalina and I’ve installed android studio and react-native-cli. I ran react-native init ShoppingList which passed
Downloading template,
Copying template,
Processing template
but failed at Installing CocoaPods dependencies because I wasn't at the latest OS yet(I hope this is not part of the problem because I don’t have enough memory to upgrade OS)
I’ve referred to a suggestion inside this issue, which asks me to run
npm uninstall -g react-native react-native-cli
npm install -g react-native react-native-cli
react-native start --reset-cache
I’ve also deleted the node_modules and npm install at the root of the project. Then at the root of the project I ran react-native run-android.
Which gave me the following error
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 967 file(s) to forward-jetify. Using 8 workers...
info Starting JS server...
/bin/sh: adb: command not found
info Launching emulator...
error Failed to launch emulator. Reason: No emulators found as an output of `emulator -list-avds`.
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
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.2/userguide/command_line_interface.html#sec:command_line_warnings
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
> SDK location not found. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/Users/prashin/Test/ShoppingList/android/local.properties'.
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 2s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
Inside Android Studio, the following are installed
Android 11.0(R),
Android SDK Build-Tools,
Android Emulator 30.2.6,
Android SDK-Platform-Tools 30.0.5,
Intel x86 Emulator Accelerator (HAXM installer) 7.5.1
I created a Pixel 2 Device with Release name R(API Level 30), and pressed the Play button countless times, it gives me the error of AVD Manager: Unable to locate ADB.
This is my .bash_profile file.
source ~/.profile
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
##
# Your previous /Users/prashin/.bash_profile file was backed up as /Users/prashin/.bash_profile.macports-saved_2019-10-23_at_18:32:04
##
# MacPorts Installer addition on 2019-10-23_at_18:32:04: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
export ANDROID_HOME=/Users/prashin/Library/Android/sdk
export ANDROID_SDK_ROOT=$ANDROID_HOME
export PATH="$PATH:$ANDROID_HOME/emulator:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools"
# export PATH="$PATH:/Users/$USER/Library/Android/sdk/platform-tools"
# export PATH=${PATH}:/usr/local/mysql-5.7.31-macos10.14-x86_64/bin
# Finished adapting your PATH environment variable for use with MacPorts.
And I do see an adb executable inside platform-tools according to this post.
What could I be missing here which is preventing me from running my basic application on the simulator? Do inform me if more information is needed.
Edit
A suggested solution of switching to .zprofile changed the error message instead. It got stuck at info launching emulator for 30s before producing the error below.
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Task :app:stripDebugDebugSymbols UP-TO-DATE
Compatible side by side NDK version was not found.
> Task :app:installDebug FAILED
Skipping device 'emulator-5554' (emulator-5554): Device is OFFLINE.
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.2/userguide/command_line_interface.html#sec:command_line_warnings
27 actionable tasks: 2 executed, 25 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:installDebug'.
> com.android.builder.testing.api.DeviceException: No online devices found.
* 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.
* Get more help at https://help.gradle.org
BUILD FAILED in 4s
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
With Catalina, Apple has changed the default shell to zsh. Therefore you have to rename your configuration files. .bashrc is now .zshrc and .bash_profile is now .zprofile. Move the contents of your .bash_profile to a new .zprofile file and restart your terminal. Run the app again with new environment variables in place.
Simply restarting the terminal made the trick for me...

Unable to debug Go code: could not launch process: decoding dwarf section info at offset 0x0: too short

we are trying to debug Go code and getting this error:
could not launch process: decoding dwarf section info at offset 0x0: too short
our settings:
WITSC02X6385JGH:orderer sjain68$ uname -a
Darwin WITSC02X6385JGH 17.7.0 Darwin Kernel Version 17.7.0: Fri Jul 6 19:54:51 PDT 2018; root:xnu-4570.71.3~2/RELEASE_X86_64 x86_64
WITSC02X6385JGH:orderer sjain68$ go version
go version go1.11 darwin/amd64
WITSC02X6385JGH:orderer sjain68$ dlv version
Delve Debugger
Version: 1.1.0
Build: $Id: 1990ba12450cab9425a2ae62e6ab988725023d5c
Things we have tried:
Update dlv using VS Code -> Go: Install/Update Tools
Try running from command line:
WITSC02X6385JGH:orderer sjain68$ /Users/sjain68/go/bin/dlv debug github.com/hyperledger/fabric/orderer --headless=true --listen=127.0.0.1:41305 --api-version=2 --log=true --
API server listening at: 127.0.0.1:41305
INFO[0002] launching process with args: [/Users/sjain68/go/src/github.com/hyperledger/fabric/orderer/debug] layer=debugger
debugserver-#(#)PROGRAM:debugserver PROJECT:debugserver-902.0.79.7
for x86_64.
Got a connection, launched process /Users/sjain68/go/src/github.com/hyperledger/fabric/orderer/debug (pid = 9278).
Exiting.
could not launch process: decoding dwarf section info at offset 0x0: too short
Note that the binary that we are trying to debug does gets executed. Its just that the debugger does not launch.
Another thing we tried from this link:
WITSC02X6385JGH:orderer sjain68$ export GOFLAGS="-ldflags=-compressdwarf=false"; dlv debug
could not launch process: decoding dwarf section info at offset 0x0: too short
Someone said to run GOCACHE=off go build ... and output of that is pasted here.
How can we fix this?
I had the same issue after updateing Go.
Updating Delve package from console helped:
go get -u github.com/go-delve/delve/cmd/dlv
The solution that worked for us was to upgrade Go version
$ go version
go version go1.13.3 darwin/amd64
So Go 1.11 is the culprit.
make sure you aren't using flags that remove the debug info from your build ie -ldflags="-s -w" .
https://lukeeckley.com/post/useful-go-build-flags/

Error while running make command using Fabric 1.0.6 after all the 15 steps

I am installing fabric in a custom path $HOME//gopath/src/github.com/hyperledger/fabric using the make command but after installing all the 15 steps, I am getting the following error
Step 15/15 : LABEL org.hyperledger.fabric.version=1.0.2 org.hyperledger.fabric.base.version=0.3.2
---> Running in ed05a67810db
Removing intermediate container ed05a67810db
---> 99b4b0b28957
Successfully built 99b4b0b28957
Successfully tagged hyperledger/fabric-javaenv:latest
docker tag hyperledger/fabric-javaenv hyperledger/fabric-javaenv:x86_64-1.0.2
build/bin/peer
CGO_CFLAGS=" " GOBIN=/root/gopath/src/github.com/hyperledger/fabric/build/bin go install -tags "" -ldflags "-X github.com/hyperledger/fabric/common/metadata.Version=1.0.2 -X github.com/hyperledger/fabric/common/metadata.BaseVersion=0.3.2 -X github.com/hyperledger/fabric/common/metadata.BaseDockerLabel=org.hyperledger.fabric -X github.com/hyperledger/fabric/common/metadata.DockerNamespace=hyperledger -X github.com/hyperledger/fabric/common/metadata.BaseDockerNamespace=hyperledger" github.com/hyperledger/fabric/peer
go build github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11: invalid flag in #cgo LDFLAGS: -Wl,--no-as-needed
Makefile:227: recipe for target 'build/bin/peer' failed
make: *** [build/bin/peer] Error 1
Docker version 17.12.0-ce, build c97c6d6
docker-compose version 1.18.0, build 8dd22a9
go version go1.9.4 linux/amd64
OS : Ubuntu 16.04
I have set the following path also
$ mkdir $HOME/gopath
$ export GOPATH=$HOME/gopath
$ export GOROOT=$HOME/go
$ export PATH=$PATH:$GOROOT/bin
Jira Link: https://jira.hyperledger.org/browse/FAB-2218 which I have already done
It is a known issue in go 1.9.4:
https://github.com/golang/go/issues/23739
While go people are fixing it, you can manually whitelist the flags before starting make:
$ export CGO_LDFLAGS_ALLOW='-Wl,--no-as-needed'
$ make
Alternatively you can just downgrade to go 1.9.3
as far as I know you don't need to build the fabric itself.
You just need to have sources in the gopath, as your chaincode will need this, when you are building your chaincode for the blockchain itself.
In addition you will probably also need to install the fabric-ca for your chaincode to build successfully, if you use the certificate-stuff.
This is sufficient to check if you installed fabric correctly:
cd $GOPATH/src/github.com/hyperledger/fabric
make unit-test
Keep going if this works.
I found this confusing at first as well ;)
I'd assume you switch to golang 1.9.4 or greater hence I belive this actually related to following issue, to solve it you need to update vendor dependencies:
govendor fetch github.com/hyperledger/fabric/vendor/github.com/miekg/pkcs11
Next continue to build binaries and run tests.

Building iOS app for iPhone works from xCode but not from command line (xcodebuild)

I am currently trying to streamline our build and release process with an automated build which runs on an OSX server machine , a MacMini running OSX 10.6.7 with xCode 4.0.1 and iOS SDK 4.3 installed (latest release from Apple).
I have followed Mike Nachbaur's excellent guide and it feels like I'm almost there but I still have one final obstacle to overcome.
So. We have our app which build fine on:
a) My laptop from within xCode
b) My laptop from command line with xcodebuild
c) the build machine from within xCode
BUT it does not work on
d) the build machine from the command line with xcodebuild.
Here is the end of the console output:
CreateUniversalBinary build/Distribution-iphoneos/CallControl.app/CallControl normal "armv6 armv7"
cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/usr/bin/lipo -create /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Callcontrol.build/Distribution-iphoneos/CallControl.build/Objects-normal/armv6/CallControl /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Callcontrol.build/Distribution-iphoneos/CallControl.build/Objects-normal/armv7/CallControl -output /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl
GenerateDSYMFile build/Distribution-iphoneos/CallControl.app.dSYM build/Distribution-iphoneos/CallControl.app/CallControl
cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/dsymutil /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl -o /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app.dSYM
ProcessProductPackaging "/Users/ainutveckling/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
cd /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/Users/ainutveckling/Jenkins/tools/jdk6/bin:/usr/bin:/bin:/usr/sbin:/sbin"
<com.apple.tools.product-pkg-utility> "/Users/ainutveckling/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" -o /Users/ainutveckling/Jenkins/workspace/CallControl_iPhoneContiousBuild/Callcontrol/build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
** BUILD FAILED **
+ failed build
+ echo 'Failed: build'
Failed: build
+ exit 1
Notifying upstream projects of job completion
Finished: FAILURE
On my machine, it looks almost the same:
GenerateDSYMFile build/Distribution-iphoneos/CallControl.app.dSYM build/Distribution-iphoneos/CallControl.app/CallControl
cd /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/anders/Utveckling/android-sdk-mac_x86/tools:/Users/anders/Utveckling/android-sdk-mac_x86/platform-tools:"
/Developer/usr/bin/dsymutil /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app/CallControl -o /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app.dSYM
ProcessProductPackaging "/Users/anders/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
cd /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/Users/anders/Utveckling/android-sdk-mac_x86/tools:/Users/anders/Utveckling/android-sdk-mac_x86/platform-tools:"
<com.apple.tools.product-pkg-utility> "/Users/anders/Library/MobileDevice/Provisioning Profiles/F792F2E5-45DB-43C7-969C-6012C59BF778.mobileprovision" -o /Users/anders/Utveckling/CallControl/iphone/totala_samtalslistan/Callcontrol/build/Distribution-iphoneos/CallControl.app/embedded.mobileprovision
** BUILD SUCCEEDED **
But success...
It does not matter if I start the build directly from the command line on the build machine or if it is started by Hudson, same result.
The certificate pointed out above seems to be in place.
I'm almost ready to give up on this, so I would very much appreciate any help to shed some light upon the matter!
Best regards,
Anders
I encountered the exact error that you showed above on my build machine after updating to a new distribution certificate and provisioning profile. After the ProcessProductPackaging step, it would just display the ** BUILD FAILED ** message.
However, when running the build manually on the build machine, I encountered the KeyChain permission dialog. Hitting "Allow Always" fixed the problem.
That in addition to unlocking in the build script:
security unlock -p $PASSWORD
Add this line of code to your script:
security list-keychains -s $KEYCHAINFILE
This has fixed the issue for me.

Resources