Installing Go Language - installation

I'm trying to install Go language, but at the end, I got these errors (I won't copy all because are a lot of lines):
$>=========== fixedbugs/bug359.go
> BUG: errchk: fixedbugs/bug359.go:19: missing expected error: '"unexported field"'
> errchk: fixedbugs/bug359.go:25: missing expected error: '"a redeclared"'
> errchk: unmatched error messages:
> ==================================================
> fixedbugs/bug359.go:12: import /home/anju/go/pkg/linux_386/container/list.a:
object is [linux 386 release.r56 9441] expected [linux 386 release.r60.3 10088+]
> ==================================================
0 known bugs; 78 unexpected bugs; test output differs
FAILED
I've followed step by step the instructions, but always I get the same results. I edited my .bashrc with ne next lines:
export GOROOT=$HOME/go
export GOARCH=386
export GOOS=linux
export GOBIN=$HOME/bin
export PATH=$GOBIN:$PATH
But when I execute the command uname -a, I get these:
$Linux Anju 2.6.32-35-generic #78-Ubuntu SMP Tue Oct 11 15:27:15 UTC 2011 i686 GNU/Linux.
So, GOARCH=386 it's ok or maybe I should use another value?
Thanks for the attention and excuse me my bad english.

The standard default for $GOBIN is:
export GOBIN=$GOROOT/bin
You probably have multiple versions of Go installed. For example, [linux 386 release.r56 9441] and [linux 386 release.r60.3 10088+]. Therefore, you probably have multiple versions of Go binaries such as 8g, perhaps in both $HOME/bin and $GOROOT/bin ($HOME/go/bin).

i found a tutorial but i am not comfortable with terminal so can't figure it. http://www.kelvinwong.ca/2009/11/12/installing-google-go-on-mac-os-x-leopard/

Related

Golang build cannot find module for path _/mnt/c/XXXXX

My system is WSL 2 in Windows 10.
OS: Debian 10 buster
Kernel: x86_64 Linux 4.19.104-microsoft-standard
Shell: zsh 5.7.1
CPU: AMD Ryzen 9 4900HS with Radeon Graphics # 16x 2.994GHz
Golang info:
go version go1.15.2 linux/amd64
GOROOT="/usr/local/go"
GOPATH="/mnt/c/workspace/6.824"
And I met a problem when I build a project by plugin model:
$ go build -buildmode=plugin ../mrapps/wc.go
build command-line-arguments: cannot find module for path _/mnt/c/workspace/6.824/src/mr
It is so strange that "_/mnt"
How can I solve it?
Why has a "_" before the path?
Help me, please.
I would try and use go mod instead of relying on GOPATH
unset GOPATH
cd /mnt/c/workspace/6.824/
go mod init "yourProject"
go build -buildmode=plugin mrapps/wc.go
You are using go mod. And you can try the following command to fix:
cd 6.824
go mod init "6.824-golabs-2020"
# change file src/mrapps/wc.go line9 to `import "6.824-golabs-2020/src/mr"`
cd src
go build -buildmode=plugin mrapps/wc.go
More details about mod you can refer to https://golang.org/ref/mod

How do I execute autoconf on Windows as installed with Cygwin?

I'm trying to build a Linux-developed C++ project on a Windows 7 machine, and I figured that Cygwin would be one of the easiest ways to run the necessary build and compilation scripts (in my case, autoconf, make, and g++). I'm starting to run into problems, and I'd appreciate it if someone could showing me if I'm installing or doing something incorrectly.
I can install Cygwin with Chocolatey with the command
choco install -y cygwin
which places Cygwin in the C:\tools\cygwin directory. For convenience, I add C:\tools\cygwin\bin to my PATH.
Next I install the necessary packages in quiet mode with
C:\tools\cygwin\cygwin_setup.exe -q -P autoconf,make,gcc-g++
If I enter the command make, then that program runs and gives me the expected error message. But if I enter autoconf, then I get the following error:
'autoconf' is not recognized as an internal or external command, operable program or batch file.
I assume the reason is because, unlike most of the scripts in Cygwin's bin directory (such as make), this one is not a .exe file. When check the contents of autoconf in a text editor, I see just a single garbled line:
㰡祳汭湩㹫/usr/share/autotools/ac-wrapper.sh
The initial characters seem pretty suspect, but my guess is that the script is supposed to call the C:\tools\cygwin\usr\share\autotools\ac-wrapper.sh script.
So I tried to run that script as an executable with
C:\tools\cygwin\usr\share\autotools\ac-wrapper.sh
The first time I did this, it successfully generated the configure executable. I thought I had everything solved. But after I cleaned up the autoconf outputs and tried again, nothing happened. Even if I close the shell window and try again, a window briefly appears with a message and disappears, but nothing else happens.
I can see the message if I run the wrapper script with
sh C:\tools\cygwin\usr\share\autotools\ac-wrapper.sh
The message turns out to be the following error:
ac-wrapper: Unable to locate any usuable version of autoconf.
I tried these versions: 2.69:2.5 2.68:2.5 9999:2.5 2.99:2.5 2.98:2.5 2.97:2.5 2.96:2.5 2.95:2.5 2.94:2.5 2.93:2.5 2.92:2.5 2.91:2.5 2.90:2.5 2.89:2.5 2.88:2.5 2.87:2.5 2.86:2.5 2.85:2.5 2.84:2.5 2.83:2.5 2.82:2.5 2.81:2.5 2.80:2.5 2.79:2.5 2.78:2.5 2.77:2.5 2.76:2.5 2.75:2.5 2.74:2.5 2.73:2.5 2.72:2.5 2.71:2.5 2.70:2.5 2.69:2.5 2.68:2.5 2.67:2.5 2.66:2.5 2.65:2.5 2.64:2.5 2.63:2.5 2.62:2.5 2.61:2.5 2.60:2.5 2.59:2.5 2.5x:2.5 2.13:2.1
C:\tools\cygwin\usr\share\autotools\ac-wrapper.sh: line 19: printf: missing unicode digit for \u
With a base name of 'C: ools\cygwin\usr\shareutotoolsc-wrapper.sh'.
I assume that last Unicode-related error is due to the CJK characters in the autoconf file, but the issue with finding a usable version of autoconf is more concerning. What's going on here? Shouldn't I be able to run autoconf from the Windows command-line with Cygwin installed?
Most of the cygwin programs are implemented as special link, that works only
from a cygwin shell (like bash):
$ cd /usr/bin
$ ls -l autoconf
lrwxrwxrwx 1 Marco Kein 34 Oct 15 2018 autoconf -> /usr/share/autotools/ac-wrapper.sh
$ autoconf --version
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David J. MacKenzie and Akim Demaille.
These links for not-cygwin programs are normal files and they can not use them
D:\cygwin32T\bin>dir /a:s autoconf.*
Datenträger in Laufwerk D: ist DATA
Volumeseriennummer: D603-FB6E
Verzeichnis von D:\cygwin32T\bin
15.10.2018 08:53 82 autoconf
1 Datei(en), 82 Bytes
0 Verzeichnis(se), 662.133.735.424 Bytes frei
The best way to use cygwin effectively is to run the provided Cygwin Terminal (aka Mintty) that will start a cygwin shell. Running Cygwin programs from windows CMD could cause unexpected results.

Error message:protoc-gen-go: Plugin failed with status code 1

This is not a duplicate question
First, I made sure I have the following configuration:
1 export GOPATH=/Users/chezixin/go
2 export GOBIN=/Users/chezixin/go/bin
3
4 export GO111MODULE=on
5 # 123
6 export GOPROXY=https://goproxy.cn
7
8
9 export PATH="$PATH:/Applications/Postgres.app/Contents/Versions/12/bin:/Users/chezixin/flutterSDK/flutter/bin:/usr/local/go/bin:$GOPATH:$GOBIN"
10
czxmac:~ chezixin$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:
/sbin:/Applications/VMwareFusion.app/Contents/Public:
/Applications/Postgres.app/Contents/Versions/latest/bin:
/Applications/Postgres.app/Contents/Versions/12/bin:
/Users/chezixin/flutterSDK/flutter/bin:/usr/local/go/bin:
/Users/chezixin/go:/Users/chezixin/go/bin':
/Users/chezixin/Go/bin:/Applications/Postgres.app/Contents/Versions/12/bin:
/Users/chezixin/flutterSDK/flutter/bin:
/usr/local/go/bin:/Users/chezixin/go:
/Users/chezixin/go/bin:/Users/chezixin/Go/bin
Already installed:
go get -u google.golang.org/grpc
look protoc:
czxmac:~ chezixin$ protoc --version
libprotoc 3.11.1
Protoc-gen-go is installed and exists in $ GOPATH/bin
go get -u github.com/golang/protobuf/protoc-gen-go
problem:
When I execute the following command
$ protoc --go_out=plugins=grpc:. *.proto
An error occurred:
protoc-gen-go: program not found or is not executable
Please specify a program using absolute path or make sure the program is available in your PATH system variable
--go_out: protoc-gen-go: Plugin failed with status code 1.
Where is the problem, please master guidance.
This issue is related with your PATH variable, please set it again.
I can see a typo of an extra trailing apostrophe(') in this line of PATH variable. /Users/chezixin/go:/Users/chezixin/go/bin':
Try updating it to
/Users/chezixin/go:/Users/chezixin/go/bin:
For anyone facing a similar issue, but it was not the case of an invalid PATH variable, I very much sympathize with you.
I realized that I had to install the compiler (again?) before it started working. I hadn't installed it before, but it appeared to already be downloaded. I guess I had to install it again or update it.
I personally was using betterproto, and I followed the instructions here to install it with the protoc plugin and try out their example.

stack is not working after upgrading platform to 8.0.2 from 8.0.1

After upgrading haskell platform package, stack command does not work.
$ stack path
No compiler found, expected minor version match with ghc-8.0.1 (x86_64) (based on resolver setting in /home/eii/exercism/haskell/linked-list/stack.yaml).
To install the correct GHC into /home/eii/.stack/programs/x86_64-linux/, try running "stack setup" or use the "--install-ghc" flag.
$
I tried stack setup but it is trying to download an old GHC (ghc-8.0.1). I just installed Haskell platform 8.0.2 (haskell-platform-8.0.2-unknown-posix--full-x86_64.tar.gz). I am using a 64 bit Linux.
$ stack setup
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
ghc-8.0.1: 15.69 MiB / 108.01 MiB ( 14.52%) downloaded...^Cuser interrupt
$
I can compile with ghc-8.0.2 and ghci is working fine.. but I can't use stack nor install new packages.
$ stack update
Downloading package index from https://s3.amazonaws.com/hackage.fpcomplete.com/00-index.tar.gz
Updating package index Hackage (mirrored at https://s3.amazonaws.com/hackage.fpcomplete.com/00-index.tar.gz) ...
$ stack upgrade
Current Stack version: 1.3.2, available download version: 1.3.2
Skipping binary upgrade, your version is already more recent
$ which stack
/usr/local/bin/stack
$ ls -la /usr/local/bin/stack
lrwxrwxrwx. 1 root root 45 Feb 1 18:39 /usr/local/bin/stack -> /usr/local/haskell/ghc-8.0.2-x86_64/bin/stack
$ which ghc
/usr/local/bin/ghc
$ ls -la /usr/local/bin/ghc
lrwxrwxrwx. 1 root root 43 Feb 1 18:39 /usr/local/bin/ghc -> /usr/local/haskell/ghc-8.0.2-x86_64/bin/ghc
$
Please help.
I encountered this the other day on Arch Linux 4.17.4. The error was:
No setup information found for ghc-8.4.3 on your platform.
This probably means a GHC bindist has not yet been added for OS key 'linux64-ncurses6', 'linux64-tinfo6'.
Supported versions: ghc-7.8.4, ghc-7.10.2, ghc-7.10.3, ghc-8.0.1, ghc-8.0.2, ghc-8.2.1, ghc-8.2.2, ghc-8.4.1, ghc-8.4.2
As a workaround, I edited stack.yml to change
lts-12.0
to
lts-11.15

Error during execution of scripts in Darwin machine

I'm getting the following error on a Darwin machine:
awk: cannot execute [Interrupted system call]
This is the OS version:
Darwin ...... 9.8.0 Darwin Kernel Version 9.8.0: Wed Jul 15 16:57:01
PDT 2009; root:xnu-1228.15.4~1/RELEASE_PPC Power Macintosh
Do you know what it might be?
The error message is giving you a clue. Somewhere a system call is being made by awk which is not working and the calling script is consequently being "interrupted". You'll need to narrow down the scope of the question by finding which cron scripts are failing with this error. Use grep to look through your cron scripts for suspects.
From the information you've provided I'd guess that a script that uses awk is making a system call (the code will be system(some_shell_cmd) ) to a utility that doesn't exist; is installed in an unusual location; is not on your $PATH; is not executable; or is itself a perl, python, or sh ($SHELL) script for which the interpreter has either not been installed or is not functioning properly.

Resources