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: Fix vscode-with-extensions with #70486 #71264

Closed

Conversation

AmandaCameron
Copy link
Contributor

Motivation for this change

Make it so that under nix-darwin the vscode-with-extensions package appears inside ~/Applications/Nix Apps

Things done

This appliea #70486 to the vscode-with-extensions package as well.

In addition, I added a suggested comment from the original MR that didn't . make it through before it got merged.

  • 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

@@ -71,6 +71,8 @@ in
if system == "x86_64-darwin" then ''
mkdir -p "$out/Applications/${longName}.app" $out/bin
cp -r ./* "$out/Applications/${longName}.app"

# vscodium's macOS release zip dosn't rename the code exectuable properly.
Copy link
Contributor

Choose a reason for hiding this comment

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

this applies to vscode also right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

vscode also has the executable named code yes.

Copy link
Contributor

Choose a reason for hiding this comment

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

I was just asking because it says vscodium

Suggested change
# vscodium's macOS release zip dosn't rename the code exectuable properly.
# macOS release zip dosn't rename the code exectuable properly.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The rename only applies to vscodium, and only for the macOS release zip. The vscode package doesn't need the rename, nor does the linux package of vscodium, so I felt it better to err on the side of verbosity.

@eadwu
Copy link
Member

eadwu commented Oct 17, 2019

Conflicts will arise from #71251, otherwise, the changes for x86 look fine, can't really test the darwin changes.

@worldofpeace
Copy link
Contributor

cc @lilyball @marsam. Could you test this as well?

I think I'm going to prefer to merge this first and then consolidate #71251.

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.

Sorry for the delay. LGTM, just a suggestion

mkdir -p "$out/Applications/${longName}.app/Contents/MacOS"

for path in PkgInfo Frameworks Resources _CodeSignature Info.plist; do
cp -r "${vscode}/Applications/${longName}.app/Contents/$path" "$out/Applications/${longName}.app/Contents/"
Copy link
Contributor

Choose a reason for hiding this comment

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

let's just link these paths, otherwise it would end up duplicating the package closure size

Suggested change
cp -r "${vscode}/Applications/${longName}.app/Contents/$path" "$out/Applications/${longName}.app/Contents/"
ln -s "${vscode}/Applications/${longName}.app/Contents/$path" "$out/Applications/${longName}.app/Contents/"

btw, not blocking for this PR, can we replace this runCommand with buildEnv?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm having some trouble testing this with nix-review wip -- not sure if I'm not understanding the tool properly, or what. I'm not sure if macOS will handle those directories being a symlink though.

nix-review wip run (with the suggested change applied):

``` ❯ nix-shell -p nix-review --run 'nix-review wip' $ git fetch --force https://github.com/NixOS/nixpkgs master:refs/nix-review/0 $ git worktree add /Users/amanda/.cache/nix-review/rev-75537715afe7df4e599da483399e63aabb358b66-dirty-3/nixpkgs 22b0be5 Preparing worktree (detached HEAD 22b0be5) Updating files: 100% (20075/20075), done. HEAD is now at 22b0be5 Merge pull request #70509 from doronbehar/package-snzip $ nix-env -f /Users/amanda/.cache/nix-review/rev-75537715afe7df4e599da483399e63aabb358b66-dirty-3/nixpkgs -qaP --xml --out-path --show-trace error: while querying the derivation named 'libcutl-1.10.0': while evaluating the attribute 'majmin' of the derivation 'libcutl-1.10.0' at /Users/amanda/.cache/nix-review/rev-75537715afe7df4e599da483399e63aabb358b66-dirty-3/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:191:11: invalid regular expression '([[:digit:]].[[:digit:]]*+).*', at /Users/amanda/.cache/nix-review/rev-75537715afe7df4e599da483399e63aabb358b66-dirty-3/nixpkgs/pkgs/development/libraries/libcutl/default.nix:21:28 Applying `nixpkgs` diff... error: patch failed: pkgs/applications/editors/vscode/with-extensions.nix:70 error: pkgs/applications/editors/vscode/with-extensions.nix: patch does not apply Failed to apply diff in /Users/amanda/.cache/nix-review/rev-75537715afe7df4e599da483399e63aabb358b66-dirty-3/nixpkgs $ git worktree prune ```

Copy link
Contributor

Choose a reason for hiding this comment

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

it's an error unrelated to this PR. I've created another issue #71544.

Copy link
Contributor

Choose a reason for hiding this comment

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

@AmandaCameron are you still hitting the same error on nix-review wip ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I tried committing the change instead of just using it from a dirty tree, but now it's just saying "No diffs detected"? I'm confused, and not sure if I'm just overly tired today or if nix-review wip isn't behaving how I'd think it should?

Copy link
Contributor

@marsam marsam Oct 24, 2019

Choose a reason for hiding this comment

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

[nix-review wip is] just saying "No diffs detected"?

If you staged your changes, you need to add --staged flag

Copy link
Contributor

@worldofpeace worldofpeace left a comment

Choose a reason for hiding this comment

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

Please incorporate #71264 (comment)

@stale
Copy link

stale bot commented Jun 1, 2020

Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the
    related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse. 3. Ask on the #nixos channel on
    irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 1, 2020
@Artturin
Copy link
Member

i was resolving the conflict and the feedback but couldn't push straight to it so made a new pr #133407

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 10, 2021
@Artturin Artturin closed this Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants