Bug 1367585

Summary: glibc: Port away from Lua for %posttrans
Product: [Fedora] Fedora Reporter: Colin Walters <walters>
Component: glibcAssignee: glibc team <glibc-bugzilla>
Status: CLOSED WORKSFORME QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 31CC: arjun.is, codonell, dj, dustymabe, fweimer, jakub, law, mfabian, pfrankli, siddhesh
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-30 14:22:34 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1352154    

Description Colin Walters 2016-08-16 20:56:41 UTC
From 9a171b220f992fa0ce2aa46da4eef2669882544b Mon Sep 17 00:00:00 2001
From: Colin Walters <walters>
Date: Tue, 16 Aug 2016 16:41:56 -0400
Subject: [PATCH] Port away from Lua for %posttrans

Since we know we have a shell, there's no good reason to use Lua
here.  This ensures we work with rpm-ostree, which doesn't implement
Lua right now, and I'd like to avoid doing so as long as possible.

http://lists.rpm.org/pipermail/rpm-ecosystem/2016-August/000391.html
---
 glibc.spec | 35 +++++++++++++++--------------------
 1 file changed, 15 insertions(+), 20 deletions(-)

diff --git a/glibc.spec b/glibc.spec
index f9d8ca7..7813fd6 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -1,6 +1,6 @@
 %define glibcsrcdir  glibc-2.24-47-gf792117
 %define glibcversion 2.24.90
-%define glibcrelease 2%{?dist}
+%define glibcrelease 42.nolua%{?dist}
 # Pre-release tarballs are pulled in from git using a command that is
 # effectively:
 #
@@ -2064,26 +2064,21 @@ end
 
 %postun -p /sbin/ldconfig
 
-%posttrans all-langpacks -e -p <lua>
--- If at the end of the transaction we are still installed
--- (have a template of non-zero size), then we rebuild the
--- locale cache (locale-archive) from the pre-populated
--- locale cache (locale-archive.tmpl) i.e. template.
-if posix.stat("%{_prefix}/lib/locale/locale-archive.tmpl", "size") > 0 then
-  pid = posix.fork()
-  if pid == 0 then
-    posix.exec("%{_prefix}/sbin/build-locale-archive", "--install-langs", "%%{_install_langs}")
-  elseif pid > 0 then
-    posix.wait(pid)
-  end
-end
+# If at the end of the transaction we are still installed
+# (have a template of non-zero size), then we rebuild the
+# locale cache (locale-archive) from the pre-populated
+# locale cache (locale-archive.tmpl) i.e. template.
+%posttrans all-langpacks -e
+if test -s "%{_prefix}/lib/locale/locale-archive.tmpl"; then
+  %{_prefix}/sbin/build-locale-archive --install-langs "%%{_install_langs}"
+fi
 
-%postun all-langpacks -p <lua>
--- In the postun we always remove the locale cache.
--- We are being uninstalled and if this is an upgrade
--- then the new packages template will be used to
--- recreate a new copy of the cache.
-os.remove("%{_prefix}/lib/locale/locale-archive")
+# In the postun we always remove the locale cache.
+# We are being uninstalled and if this is an upgrade
+# then the new packages template will be used to
+# recreate a new copy of the cache.
+%postun all-langpacks
+rm -f %{_prefix}/lib/locale/locale-archive
 
 %if %{with docs}
 %post devel
-- 
2.7.4

Comment 1 Fedora End Of Life 2017-02-28 10:07:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 26 development cycle.
Changing version to '26'.

Comment 2 Colin Walters 2017-07-07 16:54:54 UTC
Can someone review this please?

Comment 3 Carlos O'Donell 2017-07-07 17:48:53 UTC
(In reply to Colin Walters from comment #2)
> Can someone review this please?

Sure, we can review and test this. When do you need this fixed by?

Comment 4 Colin Walters 2017-07-07 17:53:42 UTC
It's not an immediate need, but it blocks https://github.com/projectatomic/rpm-ostree/issues/729
and also `rpm-ostree ex container`, which can be dramatically faster than traditional dnf/yum rootfs assembly - the primary target is using it for buildroots.

Comment 5 Dusty Mabe 2017-08-04 02:20:59 UTC
(In reply to Carlos O'Donell from comment #3)
> (In reply to Colin Walters from comment #2)
> > Can someone review this please?
> 
> Sure, we can review and test this. When do you need this fixed by?

Any ETA?

Comment 6 Carlos O'Donell 2017-08-04 19:03:04 UTC
(In reply to Dusty Mabe from comment #5)
> (In reply to Carlos O'Donell from comment #3)
> > (In reply to Colin Walters from comment #2)
> > > Can someone review this please?
> > 
> > Sure, we can review and test this. When do you need this fixed by?
> 
> Any ETA?

Probably some time in the next rawhide cycle we'll cleanup a few of these outstanding patches.

Do you have a workaround for this? Is it blocking your progress?

Comment 7 Jan Kurik 2017-08-15 08:14:28 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 27 development cycle.
Changing version to '27'.

Comment 8 Colin Walters 2017-09-08 13:35:07 UTC
https://github.com/projectatomic/rpm-ostree/pull/980

Comment 9 Fedora End Of Life 2018-02-20 15:22:34 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 28 development cycle.
Changing version to '28'.

Comment 10 Ben Cotton 2019-05-02 22:08:02 UTC
This message is a reminder that Fedora 28 is nearing its end of life.
On 2019-May-28 Fedora will stop maintaining and issuing updates for
Fedora 28. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora 'version' of '28'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 28 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Ben Cotton 2019-05-28 19:26:54 UTC
Fedora 28 changed to end-of-life (EOL) status on 2019-05-28. Fedora 28 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 12 Ben Cotton 2019-08-13 16:56:07 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to '31'.

Comment 13 Ben Cotton 2019-08-13 19:17:24 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 31 development cycle.
Changing version to 31.

Comment 14 Florian Weimer 2019-10-30 14:00:32 UTC
We need one Lua %posttrans for backwards compatibility with older glibc packages. This is not an issue for your use-case, though? I think it will work just to ignore the script.

Comment 15 Colin Walters 2019-10-30 14:11:22 UTC
> We need one Lua %posttrans for backwards compatibility with older glibc packages. This is not an issue for your use-case, though? I think it will work just to ignore the script.

Sounds fine, yeah - rpm-ostree always constructs a *new* rootfs today, there's no live mutation of an existing root.

Do you have a link to the (proposed?) code change though?

Comment 16 Florian Weimer 2019-10-30 14:22:34 UTC
The change went into Fedora 31, as bug 1715891.