Skip to content

lmstudio: 0.3.5 -> 0.3.6#372738

Merged
FliegendeWurst merged 1 commit intoNixOS:masterfrom
crertel:lmstudio-0.3.6
Jan 12, 2025
Merged

lmstudio: 0.3.5 -> 0.3.6#372738
FliegendeWurst merged 1 commit intoNixOS:masterfrom
crertel:lmstudio-0.3.6

Conversation

@crertel
Copy link
Contributor

@crertel crertel commented Jan 10, 2025

Updates to 0.3.6 rev 8.

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)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

@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 Jan 10, 2025
@nix-owners nix-owners bot requested review from cig0 and eeedean January 10, 2025 20:25
@crertel
Copy link
Contributor Author

crertel commented Jan 10, 2025

Works on Linux, tested via nixpkgs-review pr 372738.

@crertel
Copy link
Contributor Author

crertel commented Jan 10, 2025

@NixOS/nixpkgs-merge-bot merge

@nixpkgs-merge-bot
Copy link
Contributor

@crertel merge not permitted (#305350):
CommitterPR: pr author is not committer
R-Ryantm Maintainer merge: pr author is not r-ryantm

@crertel
Copy link
Contributor Author

crertel commented Jan 10, 2025

D'oh. @eeedean I forgot that the mergebot isn't working. Can you kick the tires on this for mac?

@eeedean
Copy link
Contributor

eeedean commented Jan 10, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 372738


aarch64-darwin

❌ 1 package failed to build:
  • lmstudio

I'm kinda puzzled, that's not from this change, obviously:

Running phase: unpackPhase
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking source archive /nix/store/jxpdx1rhwxnhxry1gqlg3cqxny08jv1v-LM-Studio-0.3.6-8-arm64.dmg
error: only HFS file systems are supported.
do not know how to unpack source archive /nix/store/jxpdx1rhwxnhxry1gqlg3cqxny08jv1v-LM-Studio-0.3.6-8-arm64.dmg

@eeedean
Copy link
Contributor

eeedean commented Jan 10, 2025

Looks like LM Studio did a thing. DMGs may be HFS or APFS and undmg only supports HFS.

I'm trying to provide a fix.

@crertel
Copy link
Contributor Author

crertel commented Jan 10, 2025

Bless 🙏

@drupol
Copy link
Contributor

drupol commented Jan 10, 2025

Should we wait for the fix or... ?

@eeedean
Copy link
Contributor

eeedean commented Jan 10, 2025

Should we wait for the fix or... ?

It wouldn't build on darwin. Using 7zz results in a corrupted App Bundle on macOS, which wont start.

It's unfortunate, but I think, we should wait for a fix. Who really needs the most recent version (on Linux anyways), might be fine with overriding the src in an Overlay imho.

@eeedean
Copy link
Contributor

eeedean commented Jan 10, 2025

I'm honestly not entirely sure about my proposed solution, but first the issues:
7zz does not work well with signed (notarized) App Bundles. It seems to mess up the Structure entirely and does not add the required xattr.
See the brief diff, I created from comparing dmg extracted by 7zz x LM\ Studio.app and using the Finder, which invokes native handling (mounting and opening a finder and then copying by drag'n'drop):
diff.txt
That's off and I cannot tell, if we can do a smart thing to make it work.

Anway: Insomnia.app seems to have had a similar challenge and they went as you can see here. They are invoking /usr/bin/hdiutil for mounting the dmg and then copy the binary from there. I'm not a big fan of that, but it works.

My proposed change (for darwin.nix):

  # LM Studio ships Scripts inside the App Bundle, which may be messed up by standard fixups
  dontFixup = true;

  # undmg doesn't support APFS and 7zz does break the xattr. Took that approach from https://github.com/NixOS/nixpkgs/blob/a3c6ed7ad2649c1a55ffd94f7747e3176053b833/pkgs/by-name/in/insomnia/package.nix#L52
  unpackCmd = ''
    echo "Creating temp directory"
    mnt=$(TMPDIR=/tmp mktemp -d -t nix-XXXXXXXXXX)
    function finish {
      echo "Ejecting temp directory"
      /usr/bin/hdiutil detach $mnt -force
      rm -rf $mnt
    }
    # Detach volume when receiving SIG "0"
    trap finish EXIT
    # Mount DMG file
    echo "Mounting DMG file into \"$mnt\""
    /usr/bin/hdiutil attach -nobrowse -mountpoint $mnt $curSrc
    # Copy content to local dir for later use
    echo 'Copying extracted content into "sourceRoot"'
    cp -a $mnt/LM\ Studio.app $PWD/
  '';

How do you feel about that?

@crertel
Copy link
Contributor Author

crertel commented Jan 11, 2025

Sounds like a plan! Want me to add that to this PR and squash it in if you can verify that it would work?

@eeedean
Copy link
Contributor

eeedean commented Jan 11, 2025

Yes, please -- If there are no objections, may that's the way for now.

@wegank wegank added the 12.approvals: 2 This PR was reviewed and approved by two persons. label Jan 11, 2025
@crertel
Copy link
Contributor Author

crertel commented Jan 12, 2025

Alright @eeedean , should be good to try again.

@wegank wegank removed the 12.approvals: 2 This PR was reviewed and approved by two persons. label Jan 12, 2025
@eeedean
Copy link
Contributor

eeedean commented Jan 12, 2025

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 372738


aarch64-darwin

✅ 1 package built:
  • lmstudio

Let's go! :)

@wegank wegank added 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. 12.approvals: 3+ This PR was reviewed and approved by three or more persons. labels Jan 12, 2025
@FliegendeWurst FliegendeWurst merged commit eb00662 into NixOS:master Jan 12, 2025
23 of 27 checks passed
@crertel crertel deleted the lmstudio-0.3.6 branch January 13, 2025 04:48
@wegank wegank mentioned this pull request Jun 14, 2025
13 tasks
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. 12.approvals: 3+ This PR was reviewed and approved by three or more persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants