Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@doronbehar
Copy link
Contributor

@doronbehar doronbehar commented Feb 23, 2025

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 23, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 23, 2025
@doronbehar doronbehar marked this pull request as draft February 23, 2025 21:38
@doronbehar doronbehar requested a review from bryango February 23, 2025 21:38
@doronbehar
Copy link
Contributor Author

This fixes this build error:

It builds now with this update, but the tectonic.passthru.tests is failing.. Haven't found time now to fix this.

@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Feb 23, 2025
@nix-owners nix-owners bot requested a review from lluchs February 23, 2025 21:41
@bryango
Copy link
Member

bryango commented Feb 24, 2025

We probably only need to change the added --web-bundle flag to --bundle. Testing build...

P.S. for the 0.15.0 release a possible fix may be to simply use clangStdenv for linux, but I have no experience doing this before.

Update: nope, upstream changed the cli such that our wrapper no longer works... Now that's tricky. Let me see what we can do...

@bryango
Copy link
Member

bryango commented Feb 24, 2025

Clang works! See patch 2 below (patch 1 is the darwin cleanup which applies nonetheless):

From d9731ee1ba8fe948a02862a88b4fdc58bf89e999 Mon Sep 17 00:00:00 2001
From: Doron Behar <[email protected]>
Date: Sun, 23 Feb 2025 23:32:34 +0200
Subject: [PATCH 1/2] tectonic: cleanup Darwin specific apple_sdk usage

---
 .../by-name/te/tectonic-unwrapped/package.nix | 22 +++++--------------
 1 file changed, 6 insertions(+), 16 deletions(-)

diff --git a/pkgs/by-name/te/tectonic-unwrapped/package.nix b/pkgs/by-name/te/tectonic-unwrapped/package.nix
index e9b9dcb2c815..197568c236d5 100644
--- a/pkgs/by-name/te/tectonic-unwrapped/package.nix
+++ b/pkgs/by-name/te/tectonic-unwrapped/package.nix
@@ -11,7 +11,6 @@
   stdenv,
   fetchFromGitHub,
   rustPlatform,
-  darwin,
   fontconfig,
   harfbuzzFull,
   openssl,
@@ -56,21 +55,12 @@ rustPlatform.buildRustPackage rec {
 
   buildFeatures = [ "external-harfbuzz" ];
 
-  buildInputs =
-    [
-      icu
-      fontconfig
-      harfbuzzFull
-      openssl
-    ]
-    ++ lib.optionals stdenv.hostPlatform.isDarwin (
-      with darwin.apple_sdk.frameworks;
-      [
-        ApplicationServices
-        Cocoa
-        Foundation
-      ]
-    );
+  buildInputs = [
+    icu
+    fontconfig
+    harfbuzzFull
+    openssl
+  ];
 
   postInstall =
     ''

From c606661d563a61d51fb875b99b250226ea0e6a5b Mon Sep 17 00:00:00 2001
From: Bryan Lai <[email protected]>
Date: Mon, 24 Feb 2025 15:37:48 +0800
Subject: [PATCH 2/2] tectonic, tectonic-unwrapped: fix linux build

---
 pkgs/by-name/te/tectonic-unwrapped/package.nix | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/pkgs/by-name/te/tectonic-unwrapped/package.nix b/pkgs/by-name/te/tectonic-unwrapped/package.nix
index 197568c236d5..50d64c8416e1 100644
--- a/pkgs/by-name/te/tectonic-unwrapped/package.nix
+++ b/pkgs/by-name/te/tectonic-unwrapped/package.nix
@@ -8,7 +8,7 @@
 
 {
   lib,
-  stdenv,
+  clangStdenv,
   fetchFromGitHub,
   rustPlatform,
   fontconfig,
@@ -19,7 +19,17 @@
   fetchpatch2,
 }:
 
-rustPlatform.buildRustPackage rec {
+let
+
+  buildRustPackage = rustPlatform.buildRustPackage.override {
+    # use clang to work around build failure with GCC 14
+    # see: https://github.com/tectonic-typesetting/tectonic/issues/1263
+    stdenv = clangStdenv;
+  };
+
+in
+
+buildRustPackage rec {
   pname = "tectonic";
   version = "0.15.0";
 
@@ -67,7 +77,7 @@ rustPlatform.buildRustPackage rec {
       # Makes it possible to automatically use the V2 CLI API
       ln -s $out/bin/tectonic $out/bin/nextonic
     ''
-    + lib.optionalString stdenv.hostPlatform.isLinux ''
+    + lib.optionalString clangStdenv.hostPlatform.isLinux ''
       substituteInPlace dist/appimage/tectonic.desktop \
         --replace Exec=tectonic Exec=$out/bin/tectonic
       install -D dist/appimage/tectonic.desktop -t $out/share/applications/

@doronbehar shall we roll with clang for now and worry about 0.15.0-unstable-... later? Because that one is tricky and I need to think about our options...

@doronbehar
Copy link
Contributor Author

Yes I won't mind worry about the update later. I took a small glance at what needed for the next version regarding the bundle URL and it seemed it requires a non-trivial understand of how upstream manages the bundles, and I hope it'd be easier to figure it out once upstream will make a release and publish release notes.

Could you please open a PR with the patches changes you pasted? It seems it'd be easier for you as you have those committed already :).

@bryango
Copy link
Member

bryango commented Feb 24, 2025

@doronbehar doronbehar closed this Feb 24, 2025
@bryango
Copy link
Member

bryango commented Mar 1, 2025

If we fetchpatch my pending PR upstream:

... I can fix the passthru.tests on tectonic/master (build log). Let's hope that upstream picks that up, then our job for the next release would be easy. The experimental package.nix is here:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants