LinearTapeFileSystem / ltfs

Reference implementation of the LTFS format Spec for stand alone tape drive
BSD 3-Clause "New" or "Revised" License
255 stars 76 forks source link

"ambiguous python shebang" when build rpm package #424

Closed banjiaojuhao closed 1 year ago

banjiaojuhao commented 1 year ago

Describe the bug

error produced when build rpm package in rocky linux 8:

ambiguous python shebang in /usr/bin/ltfs_ordered_copy: #!/usr/bin/env python. Change it to python3 (or python2) explicitly.

To Reproduce the github action config like below:

name: build centos 8 stream rpm

on:
  push:
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest
    container: docker.io/rockylinux:8
    steps:
    - uses: actions/checkout@v2

    - name: intall deps
      run: |
        yum -y update && yum -y upgrade
        yum -y install automake autoconf libtool make icu libicu-devel libxml2-devel libuuid-devel fuse-devel net-snmp-devel git python3 wget rpm-build rpmdevtools yum-utils
        alternatives --set python /usr/bin/python3

    - name: build-rpm
      run: |
        rpmdev-setuptree
        cp ltfs.spec ~/rpmbuild/SPECS/
        wget -O ~/rpmbuild/SOURCES/ltfs-2.4.4.0.tar.gz https://github.com/LinearTapeFileSystem/ltfs/archive/v2.4.4.0-10470/ltfs-2.4.4.0.tar.gz
        yum-builddep -y ~/rpmbuild/SPECS/ltfs.spec
        rpmbuild -ba ~/rpmbuild/SPECS/ltfs.spec

    - name: Upload bin directory
      uses: actions/upload-artifact@main
      with:
        name: ltfs-2.4.4.0-10470.x86_64.rpm
        path: /github/home/rpmbuild/RPMS/x86_64/ltfs-2.4.4.0-10470.x86_64.rpm

Suggestion change this line to:

#!/usr/bin/env python3
piste-jp commented 1 year ago

Hmm, I don't think it is a bug. Because we need to handle various OSs in one source tree.

This kind of shebang stuff is a little bit specific for RHEL8/9 at this time. So I don't want to accept this. You need to replace the first line in your spec file. I believe it is the best option and it is definitely possible.

piste-jp commented 1 year ago

Close this because no activities from 8/31.