marlin-build icon indicating copy to clipboard operation
marlin-build copied to clipboard

problem to compile .env with personalized firmware names

Open ils15 opened this issue 3 years ago • 4 comments

hi i'm trying to use your awesome script to compile firmware to env: mks_robin_nano35 But i have a trouble:

Cause this env generate a personalized name such mks.robin_nano35.bin to firmware i cannot finish md5 checksuM (file not found)

look at this error: Copying compiled firmware to output folder.. /home/platformio/build-marlin.sh: line 76: [: ./firmware.bin: unary operator expected MD5 Checksum Validation: Firmware file with bin file extension not found

Build failed! Check the output above for errors Error: Process completed with exit code 1.

ils15 avatar Jun 29 '21 10:06 ils15

The script looks for files with the firmware file extension in the build output folder https://github.com/frealmyr/marlin-build/blob/master/build-marlin.sh#L78

/home/platformio/build-marlin.sh: line 76: [: ./firmware.bin: unary operator expected
MD5 Checksum Validation: Firmware file with bin file extension not found

Could you post how ran the script and the OS you are using? Looks like a shell related problem where the if statement for md5sum fails.

frealmyr avatar Jul 06 '21 06:07 frealmyr

Could it be that you don't have md5sum installed which fails the if statement? 🤔

frealmyr avatar Jul 06 '21 06:07 frealmyr

hello. i ran your docker directly inside git

ils15 avatar Jul 06 '21 10:07 ils15

I'm getting this same error...

/home/platformio/build-marlin.sh: line 76: [: ./firmware.bin: unary operator expected

I'm using the github action method of building and the compile is successful based on the log, but errors at the end.

# This a Github Action for automatically building Marlin Firmware when you push a commit to master.

name: Build Marlin Firmware

on:
  push:
    branches:
      - rambo
      - mks_robin_nano35
    paths:
      - 'Firmware/Configuration/**.h'
  workflow_dispatch:

jobs:
  build_and_push:
    name: Build and push firmware
    runs-on: ubuntu-latest
    env:
      USE_REPO: https://github.com/jneilliii/Marlin
      USE_BRANCH: jneilliii
    steps:
      - name: Check out repo
        uses: actions/checkout@v2
      - name: Set board name based on branch
        run: |
          echo "BOARD=${GITHUB_REF##*/}" >> $GITHUB_ENV
          if [${GITHUB_REF##*/} == 'rambo']; then echo "FW_EXTENSION=hex" >> $GITHUB_ENV ; fi
          if [${GITHUB_REF##*/} == 'mks_robin_nano35']; then echo "FW_EXTENSION=bin" >> $GITHUB_ENV ; fi
      - name: Compile firmware
        run: |
          docker run \
            -u root:root \
            -e BOARD \
            -e USE_REPO \
            -e USE_BRANCH \
            -e FW_EXTENSION \
            -v $(pwd)/Firmware/Builds:/home/platformio/build \
            -v $(pwd)/Firmware/Configuration:/home/platformio/CustomConfiguration \
            frealmyr/marlin-build:latest
      - name: Push firmware
        run: |
          git config user.name github-actions
          git config user.email [email protected]
          git add .
          git commit -m "Compiled firmware"
          git push

Additional context: image

jneilliii avatar Sep 09 '21 05:09 jneilliii