-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
bun: init at 0.1.1 #180299
bun: init at 0.1.1 #180299
Conversation
224fec1
to
57f691e
Compare
Alright @sudosubin that should do it I think |
Why are we not building this from source? |
For one, the nature of bun makes that very difficult to do. But besides that zig on Darwin is broken which would make that impossible to build for now. Additionally @sudosubin pointed out:
|
It's probably possible and a good idea to get it building under nix but I think that would be a not insignificant undertaking over a not insignificant amount of time. |
Yeah I've been playing with a source build and it's a bit of a faff |
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.
the vast majority of this looks shared across darwin and linux
Alrighty folks, hows this? |
2da35a6
to
2c47474
Compare
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.
Looking very good. I'd advise a handful of minor tweaks
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 you just build it from source instead of just downloading the binaries from GitHub releases?
@leapofazzam123, this was discussed previously in the resolved convos in the thread. TL;DR: it is extremely complex and difficult to build, nix doesn't have the ability to build it native on darwin right now (zig is marked broken on darwin), and the build relies on cross compilation in a way that does not lend itself to being built from source right now. Thusly @06kellyjac @sudosubin myself and other decided it was best to use the binaries for now. |
Yeah. We can always swap to a source build once we get it working but it is a mess getting all the pieces together |
Should we use the |
Personally I think that makes things more confusing then necessary for people looking for the bun package. Bun is a new project that will take some real for it's build system etc to get more polished. Once it becomes more possible down the line, I don't think it's that big of a deal to rewrite the derivation, but again I think it might be a bit before that's even possible and or reasonable. |
I dont think there's much of a standard here. I think the source provenance marking it as a binary is fine for now 🤷 |
@lucasew 's suggestions plus a license tweak diff --git a/pkgs/development/web/bun/default.nix b/pkgs/development/web/bun/default.nix
index 1a9c16d587b..04124379b14 100644
--- a/pkgs/development/web/bun/default.nix
+++ b/pkgs/development/web/bun/default.nix
@@ -30,16 +30,16 @@ stdenvNoCC.mkDerivation rec {
sha256 = dist.sha256;
};
- sourceRoot = ".";
- unpackCmd = "unzip bun-${dist.shortName}-${dist.arch}.zip";
+ strictDeps = true;
+ nativeBuildInputs = [ unzip ] ++ lib.optionals stdenvNoCC.isLinux [ autoPatchelfHook ];
+ buildInputs = [ openssl ];
+
dontConfigure = true;
dontBuild = true;
- nativeBuildInputs = if stdenvNoCC.isLinux then [ autoPatchelfHook ] else [];
- buildInputs = [ unzip openssl ];
installPhase = ''
runHook preInstall
- install -Dm 755 ./bun-${dist.shortName}-${dist.arch}/bun $out/bin
+ install -Dm 755 ./bun $out/bin/bun
runHook postInstall
'';
@@ -52,8 +52,8 @@ stdenvNoCC.mkDerivation rec {
All in one fast & easy-to-use tool. Instead of 1,000 node_modules for development, you only need bun.
'';
license = with licenses; [
- mit #bun core
- lgpl2 #javascriptcore and webkit
+ mit # bun core
+ lgpl21Only # javascriptcore and webkit
];
maintainers = with maintainers; [ DAlperin jk ];
platforms = builtins.attrNames dists; |
@06kellyjac applied the patch, thank you! @lucasew take a look. Think we can get this merged? |
|
||
src = fetchurl { | ||
url = "https://github.com/Jarred-Sumner/bun-releases-for-updater/releases/download/bun-v${version}/bun-${dist.shortName}-${dist.arch}.zip"; | ||
sha256 = dist.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.
inherit (dist) sha256;
dist = dists.${stdenvNoCC.hostPlatform.system} or (throw "Unsupported system: ${stdenvNoCC.hostPlatform.system}"); | ||
in | ||
stdenvNoCC.mkDerivation rec { | ||
version = "0.1.1"; |
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.
The latest version right now is 0.1.2
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.
Whenever ofborg is happy good to go IMO. No need to update to 0.1.2 in this PR, you can do that in a follow up
@Mindavi ofborg seems happy. Can we go ahead and merge. I can update after in a quick follow up. |
Successfully created backport PR #180900 for |
Description of changes
Add a package for https://bun.sh
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)nixos/doc/manual/md-to-db.sh
to update generated release notes