Why are you calling make if you don’t have any rule to make the target?
The argument of the build wrapper should be the actual build command that you use to build your project.
It should build your project from scratch if you call it without build-wrapper. in your case make clean all is obviously not your build command since it fails. please replace it with your build command.
The first step is to try to figure out how to fully build your project from the command line(without build-wrapper). I cannot help with that because it is project-specific.
Once you succeed in doing it, you can pass this command to build-wrapper and it should work. If the command doesn’t work without build-wrapper it will not work with it.
I was able to create a bitbucket pipeline yml file for building the project for STM32
# This is an example Starter pipeline configuration
# Use a skeleton to build, test and deploy using manual and parallel steps
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image:
name: lpodkalicki/stm32-toolchain
username: simogaspa84
password: **********
email: simogaspa84@gmail.com
pipelines:
default:
- parallel:
- step:
name: 'Build and Test'
script:
- sed -i -E 's/[A-Z]:\\.*\\workspace_[^\\]+\\[^\\]+\\/..\//' Debug/makefile
- make -C Debug all
- step:
name: 'Lint'
script:
- echo "Your linting"
- step:
name: 'Security scan'
script:
- echo "Your security scan goes here..."
# The following deployment steps will be executed for each pipeline run. To configure your steps and conditionally deploy see https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/
- step:
name: 'Deployment to Staging'
deployment: staging
script:
- echo "Your deployment to staging script goes here..."
- step:
name: 'Deployment to Production'
deployment: production
trigger: 'manual'
script:
- echo "Your deployment to production script goes here..."
Now what I want it is to add the sonarcloud integration… I made 2 tests…
the first one
image: gcc:6.5
clone:
depth: full # SonarCloud scanner needs the full history to assign issues properly
definitions:
caches:
sonar: ~/.sonar/cache # Caching SonarCloud artifacts will speed up your build
steps:
- step: &build-test-sonarcloud
name: Build, test and analyze on SonarCloud
caches:
- sonar
script:
- export SONAR_SCANNER_VERSION=4.4.0.2170
- export SONAR_SCANNER_HOME=$HOME/.sonar/sonar-scanner-$SONAR_SCANNER_VERSION-linux
- export BW_OUTPUT=$HOME/.sonar/bw-output
- mkdir -p $BW_OUTPUT
- curl --create-dirs -sSLo $HOME/.sonar/sonar-scanner.zip https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$SONAR_SCANNER_VERSION-linux.zip
- unzip -o $HOME/.sonar/sonar-scanner.zip -d $HOME/.sonar/
- export PATH=$SONAR_SCANNER_HOME/bin:$PATH
- curl --create-dirs -sSLo $HOME/.sonar/build-wrapper-linux-x86.zip https://sonarcloud.io/static/cpp/build-wrapper-linux-x86.zip
- unzip -o $HOME/.sonar/build-wrapper-linux-x86.zip -d $HOME/.sonar/
- export PATH=$HOME/.sonar/build-wrapper-linux-x86:$PATH
- sed -i -E 's/[A-Z]:\\.*\\workspace_[^\\]+\\[^\\]+\\/..\//' Debug/makefile
- build-wrapper-linux-x86-64 --out-dir $BW_OUTPUT make -C Debug all
- sonar-scanner -Dsonar.cfamily.build-wrapper-output=$BW_OUTPUT
pipelines: # More info here: https://confluence.atlassian.com/bitbucket/configure-bitbucket-pipelines-yml-792298910.html
branches:
feature/DEVOPS-17-modify-confi-file-of-pipeline-:
- step: *build-test-sonarcloud
pull-requests:
'**':
- step: *build-test-sonarcloud