Cannot build on gitlab ci - toolchain-xtensa32 couldn't find crt1-sim.o and _vectors.o

Hello,

I’m trying to mak auto check and build with gitlab ci and i’m facing an issue with

toolchain-xtensa32

`/root/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find crt1-sim.o: No such file or directory`
`/root/.platformio/packages/toolchain-xtensa32/bin/../lib/gcc/xtensa-esp32-elf/5.2.0/../../../../xtensa-esp32-elf/bin/ld: cannot find _vectors.o: No such file or directory`

My .gitlab-ci.yml look like this:

image: ubuntu:latest
    stages:
      - deploy_pages
      - test_firmware
      - build_firmware
.before_script_template:
  before_script:
    - apt-get update && apt-get install -y python3 python3-venv curl git gcc g++
    - curl -fsSL https://raw.githubusercontent.com/platformio/platformio-core-installer/master/get-platformio.py -o get-platformio.py
    - python3 get-platformio.py
    - /root/.platformio/penv/bin/platformio upgrade
    - /root/.platformio/penv/bin/platformio update
pages:
  stage: deploy_pages
  only:
    - master_esp32
  before_script:
    - apt-get update && apt-get install -y doxygen
  script:
    - doxygen Doxyfile
  artifacts:
    paths:
      - public
  interruptible: true

test:
  stage: test_firmware
  extends: .before_script_template
  script:
    - /root/.platformio/penv/bin/platformio check -e esp32dev --skip-packages
  interruptible: true

build:
  stage: build_firmware
  only:
    - master_esp32
  extends: .before_script_template
  script:
    - /root/.platformio/penv/bin/platformio run -e esp32dev
  interruptible: true

This can help me?
https://docs.platformio.org/en/latest/faq.html#platformio-udev-rules

ps: block code with 4 spaces indentation and don’t allow copy/paste is very boring…

Do you have an ESP-IDF project? Yet the compiler version is 5.2.0? Sounds like ld.exe: cannot find crt1-sim.o: No such file or directory (IDFGH-2073) · Issue #4247 · espressif/esp-idf · GitHub

Does it work locally (checking and building)? What packages are displayed at the start of compilation?

Hello thx for super speed answer.

Everything works on local with pio core / pio home on vscode windows 10.

project is built, upload and work on device.

The project is on arduino-esp32 framework.

What is the full compilation log where it fails?

Especially regarding the packages. Example:

PACKAGES:
 - framework-arduinoespressif32 3.10005.210308 (1.0.5)
 - tool-esptoolpy 1.30000.201119 (3.0.0)
 - toolchain-xtensa32 2.50200.97 (5.2.0)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft

With what packages does it work on your local machine?

Also I’ve read here multiple times that PIO should not be used as root, but I’m not sure if that’s the cause of the problem here.

but in docker container the default user is root…

This is the full trace from gitlab ci is to much verbose…can’t post it here there is a limitation.

maybe you can access to it
https://storage.googleapis.com/gitlab-gprd-artifacts/e6/da/e6da995515f5bce95f5fd6e69c2a49780dc449a3af6b38566b331389a2af6b6a/2021_04_12/1172441699/1267794785/job.log?response-content-type=text%2Fplain%3B%20charset%3Dutf-8&response-content-disposition=inline&GoogleAccessId=gitlab-object-storage-prd@gitlab-production.iam.gserviceaccount.com&Signature=GlZF%2B2krmJ7xc7FpoOkcqVyISg%2BExAEEugHolzT62b0BgraFb2ii3pop0i8a zNg4%2B7yVdkrVOowQy97oxy01qWc1SbXSgzgH5EZBd1uX1RTuKkDLd2BzAEvq NmKKk73vHTFUUeA2T%2BjRkPidMPHEsgtaotrNljTz1RjlTKlqHqHOILHs%2FqNV CgfxsC5k9EROXtHTWCWMc0koaBV5tK4ksR%2BVjpV6E8TpuAV70GEiNp7CjlFF u7if8yMQ0URNoe9lfoCcpdqzx2Eft5dl1p%2BWo%2FxHcpCrqYXaiAGfsXx0wxA8 wFd8KriXxFYaIxxizAEMnaBFnUSzZCabcSqjUytRpw%3D%3D&Expires=1618240301

Hi there this topic answer to my issue:

the problem was in the platformio.ini

remove lines:

platform_packages = 
   platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git