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

vscode: Make it so that it places the .app in $out/Applications on macOS #70486

Merged
merged 1 commit into from Oct 5, 2019

Conversation

AmandaCameron
Copy link
Contributor

Motivation for this change

vscode and vscodium when installed under nix-darwin don't appear in the ~/Applications/Nix Apps folder, due to how the $out is placed.

Things done

Make it so that on macOS instead of extracting the contents of the app into $out/lib/vscode it goes into $out/Applications/${longName}.app which will then be linked to the correct place by nix-darwin

  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
Notify maintainers

cc @eadwu @Synthetica

@ofborg ofborg bot added the 6.topic: darwin Running or building packages on Darwin label Oct 5, 2019
Copy link
Member

@eadwu eadwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't verify it builds since I don't have a Macintosh but looking at the changes and file structure of the download this looks fine.

@AmandaCameron
Copy link
Contributor Author

Worth noting, this will fix #47553 in theory.

ln -s $out/lib/vscode/Contents/Resources/app/bin/${executableName} $out/bin
mkdir -p "$out/Applications/${longName}.app" $out/bin
cp -r ./* "$out/Applications/${longName}.app"
ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/code" $out/bin/${executableName}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/code" $out/bin/${executableName}
ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${executableName}" $out/bin/${executableName}

Why was that ^ changed? Is that not important for the macos build artifact?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was done because for whatever reason the vscodium macOS release .zip doesn't have the code utility renamed to codium

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, can you add a comment? This installPhase is already completely uncommented, and if I were to notice this not using executableName I would for sure change that and break things.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be surprised to see a PR that changes working code from a static path reference to using a variable. I agree that a comment is probably a good idea, but my first impression upon reading this code is simply that the app includes a binary named app/bin/code, and I wouldn't question that.

@worldofpeace
Copy link
Contributor

Just requesting review of people I'm aware of that use darwin for testing.
Hope that's ok 👍

Copy link
Contributor

@marsam marsam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @AmandaCameron, tested on Darwin

@marsam marsam merged commit 6106e8d into NixOS:master Oct 5, 2019
AmandaCameron added a commit to DarkDNA/nixpkgs that referenced this pull request Oct 16, 2019
Artturin pushed a commit to Artturin/nixpkgs that referenced this pull request Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants