Jenkins can't open make


Jenkins can't open make
I have recently installed Jenkins 2.89.2 on Ubuntu 17.10 and I am trying to set up my first project. So far I've managed to get Jenkins to download the source code from my repository but I'm having trouble calling make. I configured to call make in the Project > Configure > Build Environment > Build (Execute Shell) with the command make
. After calling make it returns the error make: not found
.
make
make: not found
I have tried the solution to related questions below relating to adding the correct directory to the $PATH environment variable. I have tried adding it to the system settings under Manage Jenkins > Configure System > Environment variables, as well as under Project > Configure > Build Environment > Build (Execute Shell), setting PATH to $PATH:/usr/bin
. I was sure that I managed to set the Path correctly, as I was echoing $PATH before calling but then tried calling make with its fully qualified path which resulted in the same error: sh: /usr/bin/make: not found
. Which leads me to believe I am not calling make correctly.
$PATH:/usr/bin
sh: /usr/bin/make: not found
I experimented calling make with the command sh make
and sh /usr/bin/make
and the error changed to Can't open make
and Can't open /usr/bin/make
sh make
sh /usr/bin/make
Can't open make
Can't open /usr/bin/make
This lead me to believe the access rights to make were incorrect, but it seems that it is.
-rwxr-xr-x 1 root root 222792 Feb 1 2017 /usr/bin/make
Perhaps the jenkins user needs to be added a group?
I'm running out of ideas on what it could be and doubt if I come to the right conclusion about the way I am calling make.
Some other details:
make works correctly at the command linewhich make
returns /usr/bin/make
which make
/usr/bin/make
I hereby declare my allegiance to Koalemos and ask the gods of Jenkins to have mercy on my soul.
Since posting I tried installing Jenkins on Ubuntu 16.04 and this doesn't have any trouble executing make. I'm guessing there's something in the Ubuntu 17.10 installation of Jenkins that it doesn't like. The permissions on the make executable are the same
-rwxr-xr-x 1 root root 207528 Feb 15 2016 /usr/bin/make
– drong0
Jan 8 at 11:15
-rwxr-xr-x 1 root root 207528 Feb 15 2016 /usr/bin/make
The paths of the Jenkins install are vastly different between 17.10 and 16.04. For example, the home directory is
/var/snap/jenkins/6
while on 16.04 is /var/lib/jenkins
. Found this about snap in Ubuntu. Tried installing jenkins via snap on 17.10 but Jenkins wasn't able to run as a service. I'm giving up trying to solve this. I'm declaring it "broken" :-) Back to Ubuntu 16.04 for me! That will teach me that the latest and greatest is not always the best.– drong0
Jan 8 at 11:51
/var/snap/jenkins/6
/var/lib/jenkins
Actually, it does install as a service. The result is the same if installed via snap.
– drong0
Jan 9 at 8:33
1 Answer
1
if you are using the Jenkins docker image, note that the image provided by Jenkins does not include this (make) along with other deps you may need.
What you can do is run a docker exec against that container with the user of root, and install all the deps with apt-get and then your build will run.
docker-machine env jenkins
#paste the env to set the docker-machine context
docker exec -it --user root <container-name> /bin/bash
#terminal session as root starts
apt-get update
apt-get install build-essentials
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
I've even tried following the tutorial in github.com/jbankes/Hello_Jenkins to the letter and even that fails when make is called. Looks like I'm missing something in the installation of Jenkins. I followed these instructions to install:
– drong0
Jan 7 at 2:04