-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fedora 28 support #1820
Fedora 28 support #1820
Conversation
2e25321
to
6a6dc30
Compare
@wcohen would it be possible to get your opinion on the content of these changes? I'm not quite an expert yet in building compatible spec files. |
Hi, As some sanity check I took the srpm from the git repo and did some $ koji build --scratch rawhide ./bcc-0.6.0-34.git.6a6dc30.src.rpm $ koji build --scratch f28 ./bcc-0.6.0-34.git.6a6dc30.src.rpm The existing srpm built fine. Also built the bcc package locally and ran rpmlint on the result. $ rpmlint *.rpm|grep E: Lots of warning aboug manpages not being compressed like: The bcc.spec should default to building python3-bcc by default rather than python2-bcc. If a piece of software supports python3, it MUST be packaged for python3. The following sentences says: If it supports python2 as well, it MAY be packaged for python2. So it looks like the rpm should produce both python2-bcc AND For determining whether to build python3 version of things could use the %{!?with_python3: %global with_python3 0%{?fedora} >= 23 || 0%{?rhel} > 7} Static linking of Fedora packages is discouraged as mentioned in Why the need for local_clang_static? Is the rpm alway building with the llvm code? |
Switch to printb in killsnoop and wakeuptime
In some python implementations, time.sleep uses select instead of nanosleep and hence won't trigger the bpf kprobe.
Use an ambiguous python invocation in the shebang line. Instead, rely on packaging stage to mangle the line to specify a python version.
This adds an option to specify that only the dynamic libraries should be used to link bcc. This is most likely to be used in systems that don't build/provide the llvm-static and clang-static package options (fedora-based).
Enable rpm packaging with two new features: - shared-only packaging (no static linking) - python3 To enable these build features (off by default), run: RPM_WITH_OPTS="--with llvm_shared --with python3" ./scripts/build-rpm.sh
Don't define python3-bcc if --with python3 isn't explicitly specified.
- Enable llvm_shared and python3 --with options by default in new fedora - Fix string quoting - Update spec changelog
6a6dc30
to
c2738e9
Compare
@wcohen Thanks for the thorough review.
Added a compression step during manpage installation. This will affect all targets.
I believe we are already building both python2/python3. I don't anticipate disabling the python2 package build at any point.
I've done this, for both the with_python3 and with_llvm_shared conditions, albeit with a slightly more complex syntax in order to retain the --with option. The default will be to enable both python3 and dynamic linking in fc28/rhel8 and newer. I prefer to leave the old approach for earlier versions in order to keep the same behavior in packages that have already shipped.
At some point in the past, it was not possible to find an llvm package that included bpf support (llvm 3.7.1 and newer), and I didn't want to include a runtime dependency on packages that weren't shipping yet. So, we were building llvm statically in the buildbots and linking against those statically. The situation has since improved, and so it makes sense to depend on the official llvm builds. The local_clang_static option also makes sense if some developers are working on newer unavailable llvm versions, and want to link those in statically. However, we are not doing that in any of our builds and so I would consider this option legacy. |
@yonghong-song I think this is ready to merge. |
Done. Thanks! |
* tools: use printb for more python3 compat Switch to printb in killsnoop and wakeuptime * tests: use subproceess sleep to trigger test In some python implementations, time.sleep uses select instead of nanosleep and hence won't trigger the bpf kprobe. * tools: remove explicit python3 shebang Use an ambiguous python invocation in the shebang line. Instead, rely on packaging stage to mangle the line to specify a python version. * cmake: add ENABLE_LLVM_SHARED option This adds an option to specify that only the dynamic libraries should be used to link bcc. This is most likely to be used in systems that don't build/provide the llvm-static and clang-static package options (fedora-based). * rpm: enable llvm_shared and python3 build options Enable rpm packaging with two new features: - shared-only packaging (no static linking) - python3 To enable these build features (off by default), run: RPM_WITH_OPTS="--with llvm_shared --with python3" ./scripts/build-rpm.sh * rpm: protect python3-bcc package declaration Don't define python3-bcc if --with python3 isn't explicitly specified. * specs: only build python3 if requested * man: compress man pages * specs: enable python3 by default in fc28+/rh8+ - Enable llvm_shared and python3 --with options by default in new fedora - Fix string quoting - Update spec changelog
This PR contains a series of fixes to enable a working fedora28 build.
patches 1-3: python3 compat fixes
patch 4: shared-only cmake option
patch 5: rpm packaging updates