C++ bitbucket-pipeline doesn't recognize pre-built library file

Avanthi Busireddy August 25, 2023

I have set up the bitbucket-pipeline for our project,  with custom GCC installation on docker space. ,we could build bootloader but when it comes to build the application code all our c source code mentioned in cmake were built, but bitbucket doesn't link the pre-built library files mentioned in cmake though the files located in the folder. Bitbucket throws no such file or folder.

 

bitbucket-pipeline.yml file:

image: gcc:10.2

pipelines:
pull-requests:
'**':
- step:
name: build 
script:
- apt-get update
- apt-get install -y cmake
- chmod +x install_crosstoolchain.sh
- ./install_crosstoolchain.sh
- make

 

snippet of cmake file where our .a file is located on main directory

DXXXLIB = DXXXXX/XXX.a

 

bitbucket error:

arm-none-eabi-gcc: DXXXXX/XXX.a: No such file or directory
184 make[1]: *** [Makefile.general:1237: Application] Error 1
Please guide us to fix this.
It was the same issue with other library files but with building source code for it generated new library for it and problem vanished. 
This particular library file we can't generate it and its a from third party.

 

1 answer

0 votes
Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 28, 2023

Hi Avanthi,

Welcome to Atlassian Community!

Can you let us know if you were using an absolute or relative path? When you execute a build the repository's content gets mounted to the following directory:

/opt/atlassian/pipelines/agent/build

Can you try to refer the library to this path and let us know if that makes any difference?

Avanthi Busireddy August 28, 2023

I tried with the absolute path /opt/atlassian/pipelines/agent/build but still it didn't work. 

The problem here is with linking the library files generated by another compiler I guess. I had the same issue with another library file, but since we have source code for it I made it compiled here within bitbucket and the linker could locate the generated file.

 

 

 

Avanthi Busireddy August 29, 2023

@Norbert Csupka Norbert Do you have any solution for this?

Norbert Csupka
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 30, 2023

Looking at the error, I'm wondering if this is caused by the architecture

What I can see is that you're trying to compile for arm

arm-none-eabi-gcc: DXXXXX/XXX.a: No such file or directory

But Pipelines is running on amd64 infrastructure. Do you know if you can compile this code in an amd64 arch?
Also I would like to ask if you could try to reproduce this build in a Docker container? Do you have the same behavior?

Steps to do it is
git clone https://<user_name>@bitbucket.org/xxxxx/xxxxx.web
cd xxxxxxx
git checkout <commit sha>
docker run -it --volume=<Local_Repo_Dir>:/xxxxxx --workdir="/xxxxxx" --memory=8g --memory-swap=8g --memory-swappiness=0 --entrypoint=/bin/bash gcc:10.2
####once you're in the conatiner
- apt-get update
- apt-get install -y cmake
- chmod +x install_crosstoolchain.sh
- ./install_crosstoolchain.sh
- make

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events