]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph.spec.in: package .pyc files on el7 32608/head
authorKefu Chai <kchai@redhat.com>
Sun, 12 Jan 2020 09:59:11 +0000 (17:59 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 13 Jan 2020 03:09:37 +0000 (11:09 +0800)
commit567a94e63d837476dcf64dc547a17ce96d61206e
tree3b756803779059fd28f02fcc6d5a690411037037
parent6324cb2f02f6aba538611f464965efdaf977bf1b
ceph.spec.in: package .pyc files on el7

* package .pyc files on el7
  per
  https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_byte_compiling

  it's required to package .pyc files

* use python3 to bytecompile .py files on el7

  per
  https://fedoraproject.org/wiki/Changes/No_more_automagic_Python_bytecompilation#Status_quo,
  `brp-python-bytecompile` script bytecompile .py files automatically, the
  .py files under interpreter-specific directories, such as `/usr/lib/python3.6/`,
  are compiled using the appropriate compiler. but the mgr modules are
  located under `/usr/share/ceph/mgr/`. they are compiled using
  `${__python}`, which is still python2 in RHEL/CentOS 7. since we've
  dropped the support of python2 in octopus. we should either stop
  bytecompiling the .py source files or start using python3 to compile
  them. otherwise python2 will fail to compile source files using python3
  specific syntax like:

```
Compiling /home/jenkins-build/build/workspace/ceph-dev-new-build/ARCH/x86_64/AVAILABLE_ARCH/x86_64/AVAILABLE_DIST/centos7/DIST/centos7/MACHINE_SIZE/huge/release/15.0.0-9242-g400d98b/rpm/el7/BUILDROOT/ceph-15.0.0-9242.g400d98b.el7.x86_64/usr/share/ceph/mgr/telemetry/module.py
...
  File "/usr/share/ceph/mgr/telemetry/module.py", line 387
    anon_devid = f"{devid.rsplit('_', 1)[0]}_{uuid.uuid1()}"
                                                           ^
SyntaxError: invalid syntax

error: Bad exit status from /var/tmp/rpm-tmp.4oRsox (%install)
```

Signed-off-by: Kefu Chai <kchai@redhat.com>
ceph.spec.in