-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
code-oss: init at 1.89.1 #318673
code-oss: init at 1.89.1 #318673
Conversation
Did you explore how hard it would be to do this for vscodium? |
VSCodium seems to be a set of patches (which aims to remove some MS branding stuff) combined with a LOT of scripts. Patches: https://github.com/VSCodium/vscodium/tree/master/patches maybe for nixpkgs we can just apply their patches, but not reusing their scripts. Some of them basically look scary: |
}; | ||
|
||
meta = { | ||
description = '' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta.description should fit on a single line without being to long to fit in on search.nixos.org
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta.description should fit on a single line without being to long to fit in on search.nixos.org
These are copied from previous nixpkgs version.
Open source source code editor developed by Microsoft for Windows, |
Should I update this then?
Linux and macOS | ||
''; | ||
longDescription = '' | ||
Open source source code editor developed by Microsoft for Windows, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
longDescription should not repeat description, as they are often displayed very close to each other.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, these words have already presented in nixpkgs before:
Open source source code editor developed by Microsoft for Windows, |
}: | ||
|
||
let | ||
inherit (nodePackages) node-gyp; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Task for another PR: we should package this package outside of nodePackages
''; | ||
|
||
outputHashMode = "recursive"; | ||
outputHashAlgo = "sha256"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant with outputHash
"out" | ||
|
||
# Remote extension host, for vscode remote development | ||
"reh" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would write those out, then the outputs are longer but it is easier to understand what they are. As a long term vscode user that fiddled a lot with remote extensions in nixos wsl, i have never seen this abbreviation before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would write those out, then the outputs are longer but it is easier to understand what they are. As a long term vscode user that fiddled a lot with remote extensions in nixos wsl, i have never seen this abbreviation before.
Could you suggest a new name? maybe "remote-extension-host" ?
I don't have strong opinion about this but personally I want to keep the name because there are same abbreviation in VSCodium community, and VSCode gulp task. (Yes, microsoft just named it reh
)
xorg.libxkbfile | ||
] ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa ]; | ||
|
||
patches = map (name: ./vscode-oss/patches/${name}) ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we might need to use filterSource here to not copy the entire tree again. There should be an issue about this.
licenseFileName = "LICENSE.txt"; | ||
reportIssueUrl = "https://github.com/microsoft/vscode/issues/new"; | ||
nodejsRepository = "https://nodejs.org"; | ||
urlProtocol = "code-oss"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't this break erb links from eg gitlab?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what's the meaning of this field actually, basically reading some comments from microsoft/vscode-docs#5215. As per my understanding, it seems to be OK with code-oss
, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can attest that this does break some extensions. Please override it to make it vscode
(or at the least, a parameter to override it would be greatly appreciated!)
extensionAllowedBadgeProvidersRegex = [ | ||
"^https:\\/\\/github\\.com\\/[^/]+\\/[^/]+\\/(actions\\/)?workflows\\/.*badge\\.svg" | ||
]; | ||
extensionEnabledApiProposals = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems rather aggressive to put this into nix code. Can't we read that from the downloaded source file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we read that from the downloaded source file?
The source file is rather empty, and these items listed mainly comes from VSCodium community.
https://github.com/microsoft/vscode/blob/main/product.json
Bump nodejs and electron version according to https://code.visualstudio.com/updates/v1_90#_electron-29-update
This reverts commit c738881. code-oss> [05:53:03] 'compile-extensions-build' errored after 2.71 s code-oss> [05:53:03] Error: Command failed: yarn list --prod --json code-oss> at genericNodeError (node:internal/errors:984:15) code-oss> at wrappedFn (node:internal/errors:538:14) code-oss> at ChildProcess.exithandler (node:child_process:422:12) code-oss> at ChildProcess.emit (node:events:518:28) code-oss> at ChildProcess.emit (node:domain:551:15) code-oss> at maybeClose (node:internal/child_process:1105:16) code-oss> at Socket.<anonymous> (node:internal/child_process:457:11) code-oss> at Socket.emit (node:events:518:28) code-oss> at Socket.emit (node:domain:551:15) code-oss> at Pipe.<anonymous> (node:net:337:12) code-oss> error Command failed with exit code 1.
1.90.0 cannot be built from linux, revert it for now. |
Does this work with both extensions installed from nix and the market at the same time? |
Yes. |
Hey @inclyc, apparently this stalled? |
Hi, I'm testing this package in my own flake, it is on 1.93.1 |
Because microsoft/vscode 1.94.0 has migrated to npm again, currently it is impossible to package vscode from source. Reasons are:
I'd like to find out a workaround and file another PR, since the build system has changed significantly. |
The "Code - OSS" repository has altered its dependency manager to "npm" which caused numerous issues for nixpkgs. The most critical issue is the offline cache produced by npm is completely non-reproducible. As a result, it is currently challenging to update the version of "code-oss" (build-from-source version). For now, I am switching from "code-oss" to "vscodium" the binary releases maintained by the community. Link: microsoft/vscode#196795 Link: microsoft/vscode#226927 Link: NixOS/nixpkgs#318673
Description of changes
This PR adds a package named
vscode-oss
that build https://github.com/microsoft/vscode from source. (Currently we have vscode + vscodium but they are not built by nix).Not only does this provide vscode desktop, but also remote-ssh server and web server in separated outputs. That is, users of this package can use
vscode-oss.reh
for their remote-ssh extension host, instead of downloading a large unknown binary from microsoft.Electron, nodejs, are reused from nixpkgs.
The package also allows user changing the product.json, to customize their own vscode variant.
I don't know how to use by-name technology as well as reusing vscode directory, sorry ;)
Initially when I wrote these expressions, vscode is on 1.89.1 and I tested it. Automatic version bump,
1.90.0,I think I can file another subsequent PRs.Fixes: #26698
Closes: #86122
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.