From: Pablo Greco pablo@fliagreco.com.ar
If the kernel is being built for .el7, we don't have access to pathfix.py. --- kernel.spec | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/kernel.spec b/kernel.spec index da9d313..aaaa280 100644 --- a/kernel.spec +++ b/kernel.spec @@ -390,8 +390,10 @@ BuildRequires: kmod, patch, bash, tar, git-core BuildRequires: bzip2, xz, findutils, gzip, m4, perl-interpreter, perl-Carp, perl-devel, perl-generators, make, diffutils, gawk BuildRequires: gcc, binutils, redhat-rpm-config, hmaccalc, bison, flex BuildRequires: net-tools, hostname, bc, elfutils-devel, gcc-plugin-devel +%if 0%{?fedora} # Used to mangle unversioned shebangs to be Python 3 BuildRequires: /usr/bin/pathfix.py +%endif %if %{with_sparse} BuildRequires: sparse %endif @@ -1147,6 +1149,7 @@ find . ( -name "*.orig" -o -name "*~" ) -delete >/dev/null # remove unnecessary SCM files find . -name .gitignore -delete >/dev/null
+%if 0%{?fedora} # Mangle /usr/bin/python shebangs to /usr/bin/python3 # Mangle all Python shebangs to be Python 3 explicitly # -p preserves timestamps @@ -1156,6 +1159,7 @@ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/ pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/diffconfig pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/bloat-o-meter pathfix.py -pni "%{__python3} %{py3_shbang_opts}" scripts/show_delta +%endif
cd ..
From: Pablo Greco pablo@fliagreco.com.ar
--- kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel.spec b/kernel.spec index aaaa280..25ad968 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1228,7 +1228,7 @@ BuildKernel() {
# make sure EXTRAVERSION says what we want it to say # Trim the release if this is a CI build, since KERNELVERSION is limited to 64 characters - ShortRel=$(python3 -c "import re; print(re.sub(r'.pr.[0-9A-Fa-f]{32}', '', '%{release}'))") + ShortRel=$(perl -e "print "%{release}" =~ s/.pr.[0-9A-Fa-f]{32}//r") perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -${ShortRel}.%{_target_cpu}${Flav}/" Makefile
# if pre-rc1 devel kernel, must fix up PATCHLEVEL for our versioning scheme
On 1/15/19 1:44 AM, pablo@fliagreco.com.ar wrote:
From: Pablo Greco pablo@fliagreco.com.ar
kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel.spec b/kernel.spec index aaaa280..25ad968 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1228,7 +1228,7 @@ BuildKernel() {
# make sure EXTRAVERSION says what we want it to say # Trim the release if this is a CI build, since KERNELVERSION is limited to 64 characters
- ShortRel=$(python3 -c "import re; print(re.sub(r'.pr.[0-9A-Fa-f]{32}', '', '%{release}'))")
ShortRel=$(perl -e "print "%{release}" =~ s/.pr.[0-9A-Fa-f]{32}//r") perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -${ShortRel}.%{_target_cpu}${Flav}/" Makefile
# if pre-rc1 devel kernel, must fix up PATCHLEVEL for our versioning scheme
So I was seeing this cause a build failure when I tried a scratch build
https://koji.fedoraproject.org/koji/taskinfo?taskID=32051959
I've been having problems sometimes with line endings so it might have been a problem with how I applied the patch but did this work for you?
El 15/1/19 a las 21:02, Laura Abbott escribió:
On 1/15/19 1:44 AM, pablo@fliagreco.com.ar wrote:
From: Pablo Greco pablo@fliagreco.com.ar
kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel.spec b/kernel.spec index aaaa280..25ad968 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1228,7 +1228,7 @@ BuildKernel() { # make sure EXTRAVERSION says what we want it to say # Trim the release if this is a CI build, since KERNELVERSION is limited to 64 characters - ShortRel=$(python3 -c "import re; print(re.sub(r'.pr.[0-9A-Fa-f]{32}', '', '%{release}'))") + ShortRel=$(perl -e "print "%{release}" =~ s/.pr.[0-9A-Fa-f]{32}//r") perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -${ShortRel}.%{_target_cpu}${Flav}/" Makefile # if pre-rc1 devel kernel, must fix up PATCHLEVEL for our versioning scheme
So I was seeing this cause a build failure when I tried a scratch build
https://koji.fedoraproject.org/koji/taskinfo?taskID=32051959
I've been having problems sometimes with line endings so it might have been a problem with how I applied the patch but did this work for you?
I can't find where I built it, but I know I did (locally, not koji) I also tested a script comparing the output of both commands (python and perl) and neither of those print \r. Adding a fake \r to my test script creates the same output as I see in your build.log, but I can't confirm since I can't download the .src.rpm from koji. Either way, I'm doing a test build before going to sleep, I'll let you know tomorrow.
Pablo.
On Tue, 2019-01-15 at 06:44 -0300, pablo@fliagreco.com.ar wrote:
From: Pablo Greco pablo@fliagreco.com.ar
kernel.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel.spec b/kernel.spec index aaaa280..25ad968 100644 --- a/kernel.spec +++ b/kernel.spec @@ -1228,7 +1228,7 @@ BuildKernel() {
# make sure EXTRAVERSION says what we want it to say # Trim the release if this is a CI build, since KERNELVERSION is
limited to 64 characters
- ShortRel=$(python3 -c "import re; print(re.sub(r'.pr.[0-9A-Fa-
f]{32}', '', '%{release}'))")
- ShortRel=$(perl -e "print "%{release}" =~ s/.pr.[0-9A-Fa-
f]{32}//r") perl -p -i -e "s/^EXTRAVERSION.*/EXTRAVERSION = -${ShortRel}.%{_target_cpu}${Flav}/" Makefile
# if pre-rc1 devel kernel, must fix up PATCHLEVEL for our
versioning scheme
IMHO , you should use sed , not perl nor python3 .
Perl is not in buildroot anymore [1]
[1] https://fedoraproject.org/wiki/Changes/Build_Root_Without_Perl
Best regards,
kernel@lists.fedoraproject.org