uraimo / run-on-arch-action

A Github Action that executes jobs/commands on non-x86 cpu architectures (ARMv6, ARMv7, aarch64, s390x, ppc64le, riscv64) via QEMU
BSD 3-Clause "New" or "Revised" License
687 stars 155 forks source link

CI Env not accesible in aarch64 container #29

Open rafal1137 opened 3 years ago

rafal1137 commented 3 years ago

When running aarch64 architecture in my case not sure if others are affected here.

Part of cmake code is checking for CI Env if("$ENV{CI}" STREQUAL "true")

Which can't seem to detect it because that code inside if does not get executed.

PS: As CI is on as default on virtual enviroments.

elijahr commented 3 years ago

@rafal1137 Can you provide a workflow yaml so we can reproduce the issue?

rafal1137 commented 3 years ago

@elijahr It starts from here: https://github.com/etlegacy/etlegacy/blob/new_actions_rpi/.github/workflows/build.yml#L104

Part of the CI Detection: https://github.com/etlegacy/etlegacy/blob/master/cmake/ETLVersion.cmake#L99 As described below:

message(STATUS "Detected build running in CI, using full version string instead")

But it does build as:

Scanning dependencies of target mod_pk3 [100%] Generating legacy/legacy_2.76-dirty.pk3

Sha commit should be included instead of -dirty

elijahr commented 3 years ago

@rafal1137 using the following simplified config in my own repo, I was able to see that the CI env var is passed as true:

Config:

name: test

on: push

jobs:
  test:
    runs-on: ubuntu-16.04
    strategy:
      matrix:
        include:
          - arch: armv7
            distro: buster
    steps:
      - uses: uraimo/run-on-arch-action@v2.0.5
        name: Build on ${{ matrix.arch }}
        with:
          arch: ${{ matrix.arch }}
          distro: ${{ matrix.distro }}
          run: |
            env

Output:

Sending build context to Docker daemon  36.86kB

Step 1/3 : FROM arm32v7/debian:buster
buster: Pulling from arm32v7/debian
4c2a0a79594a: Pulling fs layer
4c2a0a79594a: Verifying Checksum
4c2a0a79594a: Download complete
4c2a0a79594a: Pull complete
Digest: sha256:0db436c027eb321e2634fa43462126fd7aa6ac206b3591cf051c2324613597b2
Status: Downloaded newer image for arm32v7/debian:buster
 ---> cb4ead9bbfa5
Step 2/3 : COPY ./run-on-arch-install.sh /root/run-on-arch-install.sh
 ---> 36100f696f0d
Step 3/3 : RUN chmod +x /root/run-on-arch-install.sh && /root/run-on-arch-install.sh
Warning: rning] The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested
 ---> Running in 1ffaf2cbf9c6
Removing intermediate container 1ffaf2cbf9c6
 ---> fed70d0c28ff
Successfully built fed70d0c28ff
Successfully tagged run-on-arch-elijahr-lintball-test-armv7-buster:latest
WARNING: The requested image's platform (linux/arm) does not match the detected host platform (linux/amd64) and no specific platform was requested
_=/usr/bin/env
DEBIAN_FRONTEND=noninteractive
GITHUB_WORKFLOW=test
GITHUB_HEAD_REF=
CI=true
GITHUB_BASE_REF=
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
RUNNER_WORKSPACE=/home/runner/work/lintball
GITHUB_REPOSITORY=elijahr/lintball
RUNNER_TOOL_CACHE=/opt/hostedtoolcache
SHLVL=1
GITHUB_SERVER_URL=https://github.com
TERM=xterm
GITHUB_GRAPHQL_URL=https://api.github.com/graphql
GITHUB_ACTOR=elijahr
GITHUB_RUN_ID=577318931
GITHUB_EVENT_NAME=push
GITHUB_EVENT_PATH=/home/runner/work/_temp/_github_workflow/event.json
RUNNER_TEMP=/home/runner/work/_temp
GITHUB_API_URL=https://api.github.com
HOME=/root
GITHUB_REF=refs/heads/run-on-arch-test
GITHUB_SHA=0ff7945361ba32b0421866905b861b530430fb2d
GITHUB_ACTIONS=true
***
GITHUB_RUN_NUMBER=312
GITHUB_ACTION=uraimorun-on-arch-action
HOSTNAME=a7ede40cb195
GITHUB_WORKSPACE=/home/runner/work/lintball/lintball

The issue might be in the makefile or easybuild.sh.

rafal1137 commented 3 years ago

@elijahr Pipeline:

easybuild.sh -> cmake -> make

Other containers so to speak have no such issue and build is correct

Scanning dependencies of target mod_pk3 [100%] Generating legacy/legacy_v2.76-1620-g0cf1042.pk3

Meaby its related to architechture ?

PS: I did run another rpi container on my local machine and yeah I can confirm that arch is somehow involved in it.