Меню

Ошибка make 127 игнорирование

This semester I got this new subject where we get to work with Discovery STM32 F4, and we are still in the phase of setting it up. But I have this problem in the beginning.

When I try to compile this «blink» code I get this error:

Error 127

So, as I got it so far, we are using this shortcut command «make» to compile code, and we were given instruction to set it up as it’s shown in images below:

Setup]

Can anyone see what’s the problem here?

Paolo's user avatar

Paolo

17.8k6 gold badges32 silver badges60 bronze badges

asked Apr 1, 2016 at 20:59

Emir's user avatar

4

Error 127 means one of two things:

  1. file not found: the path you’re using is incorrect. double check that the program is actually in your $PATH, or in this case, the relative path is correct — remember that the current working directory for a random terminal might not be the same for the IDE you’re using. it might be better to just use an absolute path instead.
  2. ldso is not found: you’re using a pre-compiled binary and it wants an interpreter that isn’t on your system. maybe you’re using an x86_64 (64-bit) distro, but the prebuilt is for x86 (32-bit). you can determine whether this is the answer by opening a terminal and attempting to execute it directly. or by running file -L on /bin/sh (to get your default/native format) and on the compiler itself (to see what format it is).

if the problem is (2), then you can solve it in a few diff ways:

  1. get a better binary. talk to the vendor that gave you the toolchain and ask them for one that doesn’t suck.
  2. see if your distro can install the multilib set of files. most x86_64 64-bit distros allow you to install x86 32-bit libraries in parallel.
  3. build your own cross-compiler using something like crosstool-ng.
  4. you could switch between an x86_64 & x86 install, but that seems a bit drastic ;).

answered Apr 2, 2016 at 1:02

Mike Frysinger's user avatar

Mike FrysingerMike Frysinger

2,6901 gold badge21 silver badges24 bronze badges

2

I am trying to teach myself gnuMake after learning the basics of C++

I am running Ubuntu 14.04 equivalent (elementary os)

And I am getting the error (full output of make run):

g++ ./main.o -w  -o test
This is a test!
/bin/sh: 1: This: not found
make: *** [exe] Error 127

My Makefile:

CC=g++
SRC=$(shell find -name '*.cpp')
OBJS= $(SRC:.cpp=.o)
EXEC=test
FLAGS= -w
LINKS=

%.o: %.cpp
    $(CC) -c $*.cpp -o $*.o

$(EXEC): $(OBJS)
    $(CC) $(OBJS) $(FLAGS) $(LINKS) -o $(EXEC)

all: $(EXEC)

exe: 
    $(shell ./$(EXEC))

run: all exe

clean: 
    rm -rf *.o $(EXEC)

This is a combination of taking basic make tutorials and reading Makefiles in github

main.cpp:

#include <iostream>

using namespace std;

int main()
{
    cout << "This is a test!" << endl;

    return 0;
}

Pretty Basic, but will be extending it to help learn to use and extend my Makefile. Now I can see the program compiles and runs, but I get the error after the run.

I searched for Make error 127 and that seems to output that error for many things, but I did not see a definition for the error, or a similar issue to mine.

I am trying to teach myself gnuMake after learning the basics of C++

I am running Ubuntu 14.04 equivalent (elementary os)

And I am getting the error (full output of make run):

g++ ./main.o -w  -o test
This is a test!
/bin/sh: 1: This: not found
make: *** [exe] Error 127

My Makefile:

CC=g++
SRC=$(shell find -name '*.cpp')
OBJS= $(SRC:.cpp=.o)
EXEC=test
FLAGS= -w
LINKS=

%.o: %.cpp
    $(CC) -c $*.cpp -o $*.o

$(EXEC): $(OBJS)
    $(CC) $(OBJS) $(FLAGS) $(LINKS) -o $(EXEC)

all: $(EXEC)

exe: 
    $(shell ./$(EXEC))

run: all exe

clean: 
    rm -rf *.o $(EXEC)

This is a combination of taking basic make tutorials and reading Makefiles in github

main.cpp:

#include <iostream>

using namespace std;

int main()
{
    cout << "This is a test!" << endl;

    return 0;
}

Pretty Basic, but will be extending it to help learn to use and extend my Makefile. Now I can see the program compiles and runs, but I get the error after the run.

I searched for Make error 127 and that seems to output that error for many things, but I did not see a definition for the error, or a similar issue to mine.

I am trying to install shc on Ubuntu 18.04

wget http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.9b.tgz
tar xvfz shc-3.8.9.tgz
cd shc-3.8.9
make

But receive the following error:

cc -Wall  shc.c -o shc
make: cc: Command not found
makefile:31: recipe for target 'shc' failed
make: *** [shc] Error 127

The makefile:

# Makefile
#

INSTALL_PATH = /usr/local

# For SCO
CFLAGS = -b elf -O -D_SVID

# For IRIX
CFLAGS = -xansi -fullwarn -O3 -g0

# For Solaris
CFLAGS = -fast -xO4 -s -v -Xa

# For HPUX
CFLAGS = -Wall -O -Ae

# For OSF1
CFLAGS = -w -verbose -fast -std1 -g0

# For GNU C compiler
CFLAGS = -Wall # -O6 -pedantic

#SHELL = /bin/sh

SHCFLAGS = -v -T # Add -T option to allow binary to be traceable

all: shc ask_for_test

shc: shc.c
    $(CC) $(CFLAGS) $@.c -o $@

ask_for_test:
    @echo '***  �Do you want to probe shc with a test script?'
    @echo '***  Please try...   make test'

test: make_the_test ask_for_strings

make_the_test: match.x
    @echo '***  Running a compiled test script!'
    @echo '***  It must show files with substring "sh" in your PATH...'
    ./match.x sh

match.x: shc match
    @echo '***  Compiling script "match"'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -f match

ask_for_strings:
    @echo '***  �Do you want to see strings in the generated binary?'
    @echo '***  Please try...   make strings'

strings: make_the_strings ask_for_expiration

make_the_strings: match.x
    @echo '***  Running: "strings -n 5 'match.x'"'
    @echo '***  It must show no sensible information...'
    strings -n 5 match.x

ask_for_expiration:
    @echo '***  �Do you want to probe expiration date?'
    @echo '***  Please try...   make expiration'

expiration: til_yesterday ask_for_install

til_yesterday: shc match
    @echo '***  Compiling "match" to expired date'
    CFLAGS="$(CFLAGS)" ./shc $(SHCFLAGS) -vv -e `date "+%d/%m/%Y"` -f match
    @echo '***  Running a compiled test script!'
    @echo '***  It must fail showing "./match.x: has expired!"'
    ./match.x

ask_for_install:
    @echo '***  �Do you want to install shc?'
    @echo '***  Please try...   make install'

install: shc
    @echo '***  Installing shc and shc.1 on '$(INSTALL_PATH)
    @echo -n '***   �Do you want to continue? '; read ANS; case "$$ANS" in y|Y|yes|Yes|YES) ;; *) exit 1;; esac;
    install -c -s shc $(INSTALL_PATH)/bin/
    install -c -m 644 shc.1 $(INSTALL_PATH)/man/man1/

clean:
    rm -f *.o *~ *.x.c

cleanall: clean
    rm -f shc *.x

I have no idea how to fix this error. Can anyone help?

mature's user avatar

mature

3,7199 gold badges29 silver badges64 bronze badges

asked Nov 22, 2018 at 17:24

2

cc is an alias for the GNU C compiler (gcc). You can install it as follows:

 sudo apt install gcc

If, for some reason, the gcc compiler is already installed, but the symbolic link /usr/bin/cc is missing, you can also do:

 make CC=gcc

answered Nov 22, 2018 at 18:07

Peter Selinger's user avatar

1

sudo apt install build-essential

This will install a C compiler (providing the cc command) as well as other tools that you may need for building software from source.

answered Nov 22, 2018 at 19:39

Mark's user avatar

MarkMark

5724 silver badges13 bronze badges

What are the steps to reproduce this issue?

  1. Open Git Bash (MINGW64) on Windows 10 Pro
  2. Run git clone https://github.com/sobolevn/git-secret.git git-secret
  3. Run cd git-secret
  4. Run make build
  5. Run PREFIX="/usr/local" make install

What happens?

Error 127 shows up:

bn@BENNY-RYZEN MINGW64 /c/dev/projects/git-secret (master)
$ make build
make: Nothing to be done for 'build'.

bn@BENNY-RYZEN MINGW64 /c/dev/projects/git-secret (master)
$ PREFIX="/usr/local" make install
C:/Program Files/Git/usr/bin/sh.exe ./utils/install.sh "C:/Program Files/Git/usr/local"
/usr/bin/sh: C:/Program: No such file or directory
make: *** [Makefile:25: install] Error 127

What were you expecting to happen?

The git-secret tool should be installed successfully.

What versions of software are you using?

Operating system: MINGW64_NT-10.0-19042 BENNY-RYZEN 3.1.7-340.x86_64 2020-10-23 13:08 UTC x86_64 Msys (Windows 10 Pro)

git-secret path: no git-secret

git-secret version: no git-secret

git version: git version 2.29.2.windows.3

Shell type and version: GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)

gpg version: gpg (GnuPG) 2.2.25

Содержание

  1. Getting «Build Error 127» when updating #2837
  2. Comments
  3. Background
  4. Your environment
  5. Steps to reproduce
  6. Expected behaviour
  7. Actual behaviour
  8. Makefile install error 127 when running MINGW64 #722
  9. Comments
  10. What are the steps to reproduce this issue?
  11. What happens?
  12. What were you expecting to happen?
  13. What versions of software are you using?
  14. make: *** [generate] Error 127
  15. 1. Fast solution
  16. 2. Reproduce the problem
  17. Step 1: Clone a GO operator-sdk project from GitHub
  18. Step 2: Run make generate and get the error
  19. Step 3: Verify operator-sdk version
  20. 3. Fix the problem for now
  21. Step 1: Uninstall operator-sdk we installed with brew
  22. make: gcc : Command not found make:*** [oracle_fdw.o] Error 127
  23. Thread: makefile problem (error 127)
  24. makefile problem (error 127)
  25. Re: makefile problem (error 127)

Getting «Build Error 127» when updating #2837

Background

I am attempting to upgrade my installed version of LND and getting this error:

Your environment

version of lnd lnd version 0.5.2-99-beta commit=v0.5.1-beta-814- g2a652455aaea661b147b6adca0ff51edcd268508

which operating system ( uname -a on *Nix)
Ubuntu 16.04.6 x86_64

version of btcd , bitcoind , or other backend
bitcoind

Steps to reproduce

Tell us how to reproduce this issue. Please provide stacktraces and links to code in question.

To update your version of lnd to the latest version run the following commands:

Expected behaviour

I expect to be update to update LND without error message.

Actual behaviour

I get the error message indicated above.

The text was updated successfully, but these errors were encountered:

The go binary is not in your PATH .

@wpaulino why isn’t it? I followed the instructions exactly as written in this repo.

Check your PATH , you may have installed Go in a slightly different directory. Also you can do which go to find where it’s pointing to atm.

As @Roasbeef suggested, use the following command to check your path setting:

I also use Ubuntu so I know the struggle when configuring the Go. If all the above not working, I suggest you remove and install Go again, directly installing tar package. Installation guide here. Following is tested and worked perfectly fine on my Ubuntu 18.04

Источник

Makefile install error 127 when running MINGW64 #722

What are the steps to reproduce this issue?

  1. Open Git Bash (MINGW64) on Windows 10 Pro
  2. Run git clone https://github.com/sobolevn/git-secret.git git-secret
  3. Run cd git-secret
  4. Run make build
  5. Run PREFIX=»/usr/local» make install

What happens?

Error 127 shows up:

What were you expecting to happen?

The git-secret tool should be installed successfully.

What versions of software are you using?

Operating system: MINGW64_NT-10.0-19042 BENNY-RYZEN 3.1.7-340.x86_64 2020-10-23 13:08 UTC x86_64 Msys (Windows 10 Pro)

git-secret path: no git-secret

git-secret version: no git-secret

git version: git version 2.29.2.windows.3

Shell type and version: GNU bash, version 4.4.23(1)-release (x86_64-pc-msys)

gpg version: gpg (GnuPG) 2.2.25

The text was updated successfully, but these errors were encountered:

This might be different on Win. Can you please try to use this command instead (make sure to use tabs for indentation, Makefile requires that):

Will this work for you?

I exchanged the lines of code but running make build still returns:

Try make git-secret

Ok, then the problem is in build , not in git-secret 🤔

For now, you can just replace make build with make git-secret . But, I will provide a fix right now! 👍

@bennycode please, reopen if that still does not work for you 🙏

Hi @sobolevn and thank you for taking immediate action. Unfortunately, I still cannot install git-secret .

Here is what I did:

1. Running git pull :

2. Running make git-secret :

3. Running make build :

4. Running PREFIX=»/usr/local» make install :

Am I holding it wrong? 🤔

Looks like it happens due to spaces in your path:

C:/Program Files/Git/usr/bin/sh.exe ./utils/install.sh «C:/Program Files/Git/usr/local»
/usr/bin/sh: C:/Program: No such file or directory

I am not sure what to do here 🤔

I will try to google some solutions. In the meantime can you try to create an alias for sh without spaces?

Thank you @sobolevn. I think I am beginning to understand what happens here. I am passing PREFIX=»/usr/local» to make install and /usr/local becomes «C:/Program Files/Git/usr/local» with MINGW64 on my machine.

The Makefile then executes $ ./utils/install.sh «$$» where PREFIX is C:/Program Files/Git/usr/local . Since this is wrapped in quotation marks it should be okay. The assumption now is that SHELL resolves to C:/Program Files/Git/usr/bin/sh.exe which seems to break. Would it help putting $ also in quotation marks?

@bennycode I don’t have any win system to test this, so you tell me 🙂

I tested it and actually it does the trick (find my PR here: #724)! 😀

Now we are one step further. 🥳

The errors I am receiving now are related to directory permissions (another Windows-specific issue):

Thanks a lot, @bennycode! Would you be interested in helping us setting up windows CI? 🙏

Hey @sobolevn, I am very happy that you haven’t let me down and that you want to create a pleasant user experience for Windows users. I will think about how to extend your CI setup to include Windows in the testing matrix. 💭

For now, I just want to confirm that I can install «git-secret» just fine when starting my Git Bash with administrator privileges (to get write permissions to «‘C:/Program Files/Git/usr/local»):

Here is everything that it takes:

Now that my problem is resolved, I am closing this issue. See you in another PR! 😀

Источник

make: *** [generate] Error 127

Maybe you will get the following error when you try to work with a go operator-sdk project you cloned from GitHub.

Here we see that simply the bin directory with the needed controller-gen , kustomize and setup-envtest files, wasn’t created by operator-sdk commands.

This blog post does address that topic for a macOS operating system and is structured in following sections:

  1. Fast solution
  2. Reproduce the problem
  3. Fix the problem

1. Fast solution

In short words we need just to copy the bin directory from an existing operator-sdk project we have on our machine and past it into the cloned project and it will work for our cloned project.

But we will have problems, when we create new projects with that installation setup using brew install operator-sdk .
(even when this is my preferred way 😦 because I want to avoid FATA[0009] failed to create API: unable to run post-scaffold tasks of “base.go.kubebuilder.io/v3”: exit status 2)

2. Reproduce the problem

We are using the currently available operator SDK version 19.1.0 which we installed using brew as described in the operator-sdk documentation.

Step 1: Clone a GO operator-sdk project from GitHub

Step 2: Run make generate and get the error

As we will see, there are files and bin folder missing.

bin/controller-gen: No such file or directory

Step 3: Verify operator-sdk version

Ensure you have operator-sdk version: «v1.19.1» installed.

3. Fix the problem for now

We are using an Operator SDK version that worked before, in my case I used 18.0.0 successfully some time ago. As far as I remember, golang version 1.17.6 was related to operator-sdk 18.0.0 version.

Note: If you want to install an older Operator SDK version with brew, that won’t work as there is only one brew formulae, as I found out. I hope that the brew installation will be fixed in the future.

So, we will do the following sequence to fix the problem:

  1. Uninstall the operator-sdk we installed with brew
  2. Install operator-sdk 18.0.0 using the binaries and install golang in version go 1.17.6
  3. Verify does the creation of a new operator project now include the bin and the related files

Step 1: Uninstall operator-sdk we installed with brew

Follow the steps outlined in one of my blog posts, but only for uninstalling. The current version of the operator-sdk in brew is 1.19.1 .

Источник

make: gcc : Command not found make:*** [oracle_fdw.o] Error 127

Sometimes the standard installation is not sufficient for the extension package you want to install. The reason for this is that the extension has different dependencies.

If you get the error as follows when you run the Make command without installing the dependencies, it is because there are no required packages.

gcc -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong –param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_SCORE_ADJ=0 -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fPIC -I/sdk/include -I/oci/include -I/rdbms/public -I/usr/include/oracle/18.3/client -I/usr/include/oracle/18.3/client64 -I/usr/include/oracle/12.2/client -I/usr/include/oracle/12.2/client64 -I/usr/include/oracle/12.1/client -I/usr/include/oracle/12.1/client64 -I/usr/include/oracle/11.2/client -I/usr/include/oracle/11.2/client64 -I/usr/include/oracle/11.1/client -I/usr/include/oracle/11.1/client64 -I/usr/include/oracle/10.2.0.5/client -I/usr/include/oracle/10.2.0.5/client64 -I/usr/include/oracle/10.2.0.4/client -I/usr/include/oracle/10.2.0.4/client64 -I/usr/include/oracle/10.2.0.3/client -I/usr/include/oracle/10.2.0.3/client64 -I. -I. -I/usr/include/pgsql/server -I/usr/include/pgsql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o oracle_fdw.o oracle_fdw.c

make: gcc: Command not found

make: *** [oracle_fdw.o] Error 127

You need to install the following package to solve the above error.

Источник

Thread: makefile problem (error 127)

Thread Tools
Display

makefile problem (error 127)

And everything works fine with it. When I try to add a new target «remake» which should essentially execute «clean» first and then «run», I get error 127.

I tried to switch «run» for «$(APP)» and got the same error. As far as I understand make executes the clean instruction, and then go on to execute the second (either run, whose first line is $(APP), or $(APP)). The problem, I think, is that it searches for a file named $(APP) instead of executing the target $(APP).

From a more general point of view, my real problem is that sometimes my program needs to change some macro value, which means to rewrite a certain header, and to recompile itself, but make does not care if an header has been modified, it only recompiles if a source has been. Also, I do not want to call «system()» twice from my program (C++), I would like to learn to do things more elegantly, which is why I want to create the «remake» target.

Last edited by Dirich; May 7th, 2013 at 01:22 PM .

Re: makefile problem (error 127)

I think the problem with how you’re trying to do it is that ‘run’ is a target, not an action — you could possibly achieve the same effect by using a recursive make

but there may be a better way using an additional phony target — I’m not a makefile expert (there are one or two on here though — so hopefully they will chime in)

I don’t really understand your second question — however there’s nothing to stop you having header files as well as source files as prerequisites for your build targets

Источник

Увидели сообщение с непонятной ссылкой, спам, непристойность или оскорбление?
Воспользуйтесь ссылкой «Сообщить модератору» рядом с сообщением!

  • Форум русскоязычного сообщества Ubuntu »
  • Поддержка »
  • Настройка системы (Модераторы: Дмитрий Бо, www777) »
  • make Error 127
  • Печать

Страницы: [1]   Вниз

Тема: make Error 127  (Прочитано 6795 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн
w2e

Ubuntu 12.04
трей
—————————————————————————

000@1000:~/dd/dir320$ make kernel_menuconfig
make[1]: Entering directory `/home/000/dd/dir320/target/linux'
make[2]: Entering directory `/home/000/dd/dir320/target/linux/brcm47xx'
if [ -s "/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27/patches/series" ]; then (cd "/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27"; if quilt --quiltrc=- next >/dev/null 2>&1; then quilt --quiltrc=- push -a; else quilt --quiltrc=- top >/dev/null 2>&1; fi ); fi
make[2]: *** [/home/000/dd/dir320/build_dir/linux-brcm47xx/linux-2.6.32.27/.quilt_checked] Error 127
make[2]: Leaving directory `/home/000/dd/dir320/target/linux/brcm47xx'
make[1]: *** [menuconfig] Error 2
make[1]: Leaving directory `/home/000/dd/dir320/target/linux'
make: *** [kernel_menuconfig] Ошибка 2
что  делать?  кто нить знает?


Пользователь решил продолжить мысль 30 Июня 2012, 16:59:41:


проблема решена  не хватала пакета quilt.

« Последнее редактирование: 30 Июня 2012, 16:59:41 от w2e »


Оффлайн
victor00000


  • Печать

Страницы: [1]   Вверх

  • Форум русскоязычного сообщества Ubuntu »
  • Поддержка »
  • Настройка системы (Модераторы: Дмитрий Бо, www777) »
  • make Error 127

SMF 2.0.19 |
SMF © 2011, Simple Machines | Карта форума

Страница сгенерирована за 0.115 секунд. Запросов: 25.

Maybe you will get the following error when you try to work with a go operator-sdk project you cloned from GitHub.

Here we see that simply the bin directory with the needed controller-genkustomize and setup-envtest files, wasn’t created by operator-sdk commands.

This blog post does address that topic for a macOS operating system and is structured in following sections:

  1. Fast solution
  2. Reproduce the problem
  3. Fix the problem

1. Fast solution

In short words we need just to copy the bin directory from an existing operator-sdk project we have on our machine and past it into the cloned project and it will work for our cloned project.

But we will have problems, when we create new projects with that installation setup using brew install operator-sdk.
(even when this is my preferred way 😦 because I want to avoid FATA[0009] failed to create API: unable to run post-scaffold tasks of “base.go.kubebuilder.io/v3”: exit status 2)

I created a GitHub issue.

2. Reproduce the problem

We are using the currently available operator SDK version 19.1.0 which we installed using brew as described in the operator-sdk documentation.

Step 1: Clone a GO operator-sdk project from GitHub

git clone https://github.com/thomassuedbroecker/multi-tenancy-frontend-operator.git
cd multi-tenancy-frontend-operator/frontendOperator

Step 2: Run make generate and get the error

  • Example output:

As we will see, there are files and bin folder missing. 

bin/controller-gen: No such file or directory

...
go: added sigs.k8s.io/yaml v1.3.0
/multi-tenancy-frontend-operator/frontendOperator/bin/controller-gen object:headerFile="hack/boilerplate.go.txt" paths="./..."
bash: /Users/thomassuedbroecker/Downloads/dev/verify/multi-tenancy-frontend-operator/frontendOperator/bin/controller-gen: No such file or directory
make: *** [generate] Error 127

Step 3: Verify operator-sdk version

  • Example output:

Ensure you have operator-sdk version: "v1.19.1" installed.

operator-sdk version: "v1.19.1", commit: "079d8852ce5b42aa5306a1e33f7ca725ec48d0e3", kubernetes version: "v1.23", go version: "go1.18.1", GOOS: "darwin", GOARCH: "amd64"

3. Fix the problem for now

We are using an Operator SDK version that worked before, in my case I used 18.0.0 successfully some time ago. As far as I remember, golang version 1.17.6 was related to operator-sdk 18.0.0 version.

Note: If you want to install an older Operator SDK version with brew, that won’t work as there is only one brew formulae, as I found out. I hope that the brew installation will be fixed in the future.

So, we will do the following sequence to fix the problem:

  1. Uninstall the operator-sdk we installed with brew
  2. Install operator-sdk 18.0.0 using the binaries and install golang in version go 1.17.6
  3. Verify does the creation of a new operator project now include the bin and the related files

Step 1: Uninstall operator-sdk we installed with brew

Follow the steps outlined in one of my blog posts, but only for uninstalling. The current version of the operator-sdk in brew is 1.19.1.

YOUR_USER=YOUR_USER
sudo go clean -cache
brew uninstall operator-sdk
brew uninstall go
sudo rm -rf /usr/local/Cellar/go
sudo rm -rf /usr/local/go
sudo rm -rf /Users/$YOUR_USER/go

Step 2: Install operator-sdk 18.0.0 and goland 1.17.6 using the binaries¶

Here we follow the related operator-sdk documentation.

1. Create a folder for your downloads

mkdir operator-sdk
cd operator-sdk

2. Set platform information

export ARCH=$(case $(uname -m) in x86_64) echo -n amd64 ;; aarch64) echo -n arm64 ;; *) echo -n $(uname -m) ;; esac)
export OS=$(uname | awk '{print tolower($0)}')

3. Download the binary for your platform

export OPERATOR_SDK_DL_URL=https://github.com/operator-framework/operator-sdk/releases/download/v1.18.0
curl -LO ${OPERATOR_SDK_DL_URL}/operator-sdk_${OS}_${ARCH}

4. Install the release binary in your PATH

chmod +x operator-sdk_${OS}_${ARCH} && sudo mv operator-sdk_${OS}_${ARCH} /usr/local/bin/operator-sdk

5. Download go 1.17.6

https://go.dev/dl/go1.17.6.darwin-amd64.pkg

6. Install go 1.17.6 using the downloaded file

7. Verify the installed operator-sdk and golang version

  • Example output:
operator-sdk version: "v1.18.0", commit: "c9c61b6921b29d731e64cd3cc33d268215fb3b25", kubernetes version: "1.21", go version: "go1.17.7", GOOS: "darwin", GOARCH: "amd64"

3. Confirm that creating a new operator project now contains the bin and associated files

Let us just create an example project problemfix.

Step 1: Create a new empty folder outside the cloned project¶

cd .. 
mkdir fixproblem
cd fixproblem

Step 2: Run operator-sdk init

operator-sdk init --domain myproblemfix.net --repo github.com/myproblemfix/myproblemfix

  • Example output:
...
go: downloading github.com/kr/text v0.2.0
go: downloading gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7
go: downloading github.com/cespare/xxhash v1.1.0
Next: define a resource with:
$ operator-sdk create api

Step 2: Create an API¶

operator-sdk create api --group myproblemfix --version v1alpha1 --kind Myproblemfix --resource --controller

  • Example output:
...
Next: implement your new API and generate the manifests (e.g. CRDs,CRs) with:
$ make manifests

Step 3: Run make generate

make generate
make manifest
make build

Step 3: Verify the bin folder and the needed files were created¶

fixproblem % tree
.
├── Dockerfile
├── Makefile
├── PROJECT
├── api
│   └── v1alpha1
│       ├── groupversion_info.go
│       ├── myproblemfix_types.go
│       └── zz_generated.deepcopy.go
├── bin
│   ├── controller-gen
│   ├── kustomize
│   └── manager
├── config
│   ├── crd
│   │   ├── bases
│   │   │   └── myproblemfix.myproblemfix.net_myproblemfixes.yaml
│   │   ├── kustomization.yaml
│   │   ├── kustomizeconfig.yaml
│   │   └── patches
│   │       ├── cainjection_in_myproblemfixes.yaml
│   │       └── webhook_in_myproblemfixes.yaml
│   ├── default
│   │   ├── kustomization.yaml
│   │   ├── manager_auth_proxy_patch.yaml
│   │   └── manager_config_patch.yaml
│   ├── manager
│   │   ├── controller_manager_config.yaml
│   │   ├── kustomization.yaml
│   │   └── manager.yaml
│   ├── manifests
│   │   └── kustomization.yaml
│   ├── prometheus
│   │   ├── kustomization.yaml
│   │   └── monitor.yaml
│   ├── rbac
│   │   ├── auth_proxy_client_clusterrole.yaml
│   │   ├── auth_proxy_role.yaml
│   │   ├── auth_proxy_role_binding.yaml
│   │   ├── auth_proxy_service.yaml
│   │   ├── kustomization.yaml
│   │   ├── leader_election_role.yaml
│   │   ├── leader_election_role_binding.yaml
│   │   ├── myproblemfix_editor_role.yaml
│   │   ├── myproblemfix_viewer_role.yaml
│   │   ├── role.yaml
│   │   ├── role_binding.yaml
│   │   └── service_account.yaml
│   ├── samples
│   │   ├── kustomization.yaml
│   │   └── myproblemfix_v1alpha1_myproblemfix.yaml
│   └── scorecard
│       ├── bases
│       │   └── config.yaml
│       ├── kustomization.yaml
│       └── patches
│           ├── basic.config.yaml
│           └── olm.config.yaml
├── controllers
│   ├── myproblemfix_controller.go
│   └── suite_test.go
├── go.mod
├── go.sum
├── hack
│   └── boilerplate.go.txt
└── main.go

Summary¶

With that we ensure you have a working version. Now you can try to install different operator-sdk binaries if they work with the golang 1.17.6 related to operator development.


I hope this was useful to you and let’s see what’s next?

Greetings,

Thomas

#operatorsdk, #macos, #golang, #operators

0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии

А вот еще интересные материалы:

  • Яшка сломя голову остановился исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного исправьте ошибки
  • Ясность цели позволяет целеустремленно добиваться намеченного где ошибка
  • Ошибка maintenance due soon
  • Ошибка maint reqd soon