CircleCI-Public / circleci-cli

Use CircleCI from the command line
https://circleci-public.github.io/circleci-cli/
MIT License
411 stars 232 forks source link

CircleCI local build fails when file name contains UTF-8 symbol #419

Closed ChameleonTartu closed 4 years ago

ChameleonTartu commented 4 years ago

Do you want to request a feature or report a bug? Bug

What is the current behavior? When a file name contains utf-8 symbol local run of CircleCI circleci local execute --job example fails.

Can you provide an example?

The name of the file is exømple.py

Example output:

The redacted variables listed above will be masked in run step output.====>> Checkout code
  #!/bin/bash -eo pipefail
mkdir -p /home/circleci/project && cd /tmp/_circleci_local_build_repo && git ls-files | tar -T - -c | tar -x -C /home/circleci/project && cp -a /tmp/_circleci_local_build_repo/.git /home/circleci/project
tar: "app/exømple.py": Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
Error: 
Exited with code exit status 2

Step failed
Error: runner failed (exited with 101)
Task failed

What is the expected behavior? It should work as a CircleCI server build which ignores the nature of symbols and doesn't fail.

Which version of the CLI and OS are you using? Did this work in previous versions?

$ circleci version
0.1.7340+b62ffd3
$ circleci diagnostic

---
CircleCI CLI Diagnostics
---
Debugger mode: false
Config found: /Users/dmytro/.circleci/cli.yml
API host: https://circleci.com
API endpoint: graphql-unstable
Error: please set a token with 'circleci setup'
You can create a new personal API token here:
https://circleci.com/account/api

~OS~:

macOS Catalina
Version 10.15.4
marcomorain commented 4 years ago

Hi @ChameleonTartu - can you share the config.yml that you were using please? In particular, what docker image are you using for the job?

ChameleonTartu commented 4 years ago

@marcomorain

My .circleci/config.yml looks:

version: 2.1

orbs:
  python: circleci/python@0.3.0

jobs:
  build-and-test:
    executor: 
      name: python/default
      tag: '3.7'
    steps:
      - checkout
      - python/load-cache
      - python/install-deps
      - python/save-cache
      - run:
          name: Run Python tests
          command: |
            python tests/run.py

workflows:

  # The build-and-test we will run EVERYTIME a piece of code changes
  build-and-test-workflow:
    jobs:
      - build-and-test

As far as I checked this orb depends on the cimg/python docker image.

ganezasan commented 4 years ago

@ChameleonTartu Hello, we updated the build-agent for fixing this issue. We added -c quotePath=false option to checkout files with the Unicode filename.

https://git-scm.com/docs/git-config#Documentation/git-config.txt-corequotePath

You can update your build-agent version to run the following command.

circleci update build-agent