Skip to content
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

TeXLive-texmf does not install on macOS 15 - Sequoia #1188

Open
sth0 opened this issue Dec 1, 2024 · 9 comments · May be fixed by #1192
Open

TeXLive-texmf does not install on macOS 15 - Sequoia #1188

sth0 opened this issue Dec 1, 2024 · 9 comments · May be fixed by #1192

Comments

@sth0
Copy link
Contributor

sth0 commented Dec 1, 2024

This is the old problem mentioned in issue #533 that luajittex and luajithbtex die with a segfault in macOS 15. I can reuse the patch that was done for that, but how does one create a conditional patch? The patch script does not seem to allow bourne shell syntax. So should the following patch script work to only patch macOS >=15 or do I need to make two separate distributions for texlive-texmf? One for 15.0 and on for 9->14?

It appears the patch script executes each line to its own shell?

PatchScript: <<
 
sed 's|@PREFIX@|%p|g' < %{PatchFile} | patch -p 1
# luajittex & luajithbtex segfault on macOS >= 15
# remove from fmtutil.cnf
 export MajorVersion=`sw_vers --productVersion | cut -d. -f1`
 if [ $MajorVersion -ge 15 ]
  patch -d texmf-dist -p1 < %{PatchFile2}
 fi
# Copying README into current dir ...
 cp    texmf-dist/README README.texmf-dist
 
# Removing a compiled *.el file ...
 rm -f texmf-dist/source/latex/rcs/src/style/rcs.elc
<<
@nieder
Copy link
Member

nieder commented Dec 1, 2024

You need to make a separate texlive-texmf-15.0.info file that applies the luajittex patch (applying the patch doesn't need to be conditionalized then). This .info file needs to have a Revision: value that's significantly higher than the existing %r (100 is a good rule of thumb) in order to (1) force the update for 15.0 people, and (2) allow for bumps in %r of the 10.9-14.0 .info if an update is needed there. Once you're done with texlive-texmf, texlive itself will also need to have a -15.0.info copy that Depends on the patched version-revision of texlive-texmf (The revision issues is why we need separate .info files for 15.0).

@nieder
Copy link
Member

nieder commented Dec 1, 2024

For cross-finding, here's the original thread on fink-users if people find one or the other: https://sourceforge.net/p/fink/mailman/fink-users/thread/E0A2991A-8669-4079-8B96-B8ADC899FC3A%40gmail.com/#msg58838145

@sth0
Copy link
Contributor Author

sth0 commented Dec 2, 2024

@nieder you are right. I figured that out overnight (sleep helps). So I don't need a distribution list for the non 15.0-info file? Because I just use a big revision number so it takes precedent? And also for the texlive dependancy. I get it.
But the current texlive, version 20240312-2, has dependency on texlive-texmf (>= 6.5) so how does that work? Is that an error? Should I make that (>=20240312-100) for the 15.0 version and (>=20240312-2) for the default version.

@nieder
Copy link
Member

nieder commented Dec 2, 2024

Texlive is only at 20240312-1 and the v6.5 dependency is for texinfo:

Info2: <<
Package: texlive%type_pkg[-nox]
Type: -nox (boolean)
Version: 20240312
Revision: 1
GCC: 4.0
Description: Bundle package for TeX Live
Depends: <<
%N-base (= %v-%r),
debianutils,
texinfo (>= 6.5)

The texlive-texmf dependency is further down and versioned accordingly:

teckit-shlibs (>= 2.5.11-1),
nkf,
texlive-texmf (>= %v),
zziplib13-shlibs
<<

You're right that for the non-15.0 .info files you don't need a Distribution: list because texlive-texmf-15.0.info with a higher %r will dominate.

@dhomeier
Copy link
Contributor

dhomeier commented Dec 4, 2024

It appears the patch script executes each line to its own shell?

Yes, it does execute them all independently, though running it under #!/bin/sh -ev should work, as should the one-liner

[ `sw_vers --productVersion | cut -d. -f1` -ge 15 ] && patch -d texmf-dist -p1 < %{PatchFile2}

Don't know if that would make things easier than maintaining a separate Distribution version... Has anyone tested this on Sonoma?
FWIW I could not reproduce the segfaults on 15.1/arm64, in fact cannot see any calls of luajittex or luajithbtex when building with tests enabled, but directly calling either of the binaries does not produce any crashes (don't have any suitable input files to actually test them though).

@nieder
Copy link
Member

nieder commented Dec 4, 2024

As @dhomeier said, {Patch/Compile/Test/Install}Script are evaluated as system() invocations per line unless everything is wrapped with a #!.

Here's the documentation
https://www.finkproject.org/doc/packaging/reference.php?phpLang=en#scripts

Because we're turning off luajittex on 15.0, someone installing texlive-texmf on 14.0, then upgrading to 15, will have a broken texlive-texmf that will crash any attempt to install texlive (and I believe any other package that uses the texlive-texmf configurations) in PostInstScript. If they all have the same %v-%r (because they share a common .info), then the only way out is to rebuild texlive-texmf. By having a separate .info with a higher %r, an upgrader will still have a broken texlive-texmf and texlive until they install the new %r, but the reason why and fix will be clear from the .info rather than relying on someone remembering that bug reporters must rebuild to kill the bug.

@sth0 if @dhomeier is not seeing the the problem on arm64, the new 15.0 info for texlive-texmf and texlive, can be set to have Architecture: x86_64. arm64 people will use the lower %r info that are currently present, and there's no need to get them to rebuild to get a fix that's not needed.

@sth0
Copy link
Contributor Author

sth0 commented Dec 5, 2024

I think I have a valid texlive-texmf-15.0.info and am testing the texlive-15.0.info at the moment. I have set the revision value to 100 to force a rebuild for already installed versions on an upgrade. I was trying to bootstrap a new fink on my arm64 machine, but ran into problems with the latest Xcode.

I will set the architecture value for both texlive-texmf-15.0.info and texlive-15.0.info to Architecture: x86_64

@sth0
Copy link
Contributor Author

sth0 commented Dec 5, 2024

Building TexLive has one failing test now. Not sure how to tell the test setup to skip this one:
FAIL: mfluajitdir/mfluajittraptest.test
Try removing it before running tests? texk/web2c/mfluajitdir/mfluajittraptest.test

@sth0
Copy link
Contributor Author

sth0 commented Dec 6, 2024

Seems to be working and passes all tests see PR 1192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants