-
-
Notifications
You must be signed in to change notification settings - Fork 14k
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
sbcl: read memory from envvar #303891
sbcl: read memory from envvar #303891
Conversation
Looks good, actually. I guess I should test it on Linux, though. In general this is basically what we try to achieve with any of the flexible wrappers in any case… |
@7c6f434c I didn't get any traction on this patch on sbcl-devel ("https://sourceforge.net/p/sbcl/mailman/sbcl-devel/thread/2cf20df7-01d0-44f2-8551-0df01fe55f1a%400brg.net/"). Shall we prefix the envvar with NIX_ and keep this patch alive just in nixpkgs? |
also pinging @catap I think you've been active around this stuff in guix and you might be interested? |
Yeah, we probably don't consider «withPackages» mandatory enough to put this there, and the patch looks fine to me. |
@aadcg how does this sound to you ? does this help you at all? |
@hraban seems reasonable to me, thanks! |
200e237
to
40bc44c
Compare
@7c6f434c open questions for you:
My intuition is to leave both of these as-is but I'm curious what you think. I also added some unit tests to this PR for the patched behavior. |
Re: overriding whatever command-line allows to override: very much yes Re: X-: I do not think this applies here, as Or do you have a strong preference for no |
Fair, to be honest I think doing bare |
40bc44c
to
abe17bb
Compare
abe17bb
to
2712181
Compare
Running full cl-nix-lite test-suite here https://github.com/hraban/cl-nix-lite/actions/runs/9037546275 if that passes we should be good. |
thanks for ping! I never used guix but I've reimplemented something similar for lisp inside MacPorts. |
Nice, I'd love to see the patch. Do you have a link? |
On Fri, 10 May 2024 21:26:49 +0100, Hraban ***@***.***> wrote:
> I never used guix but I've reimplemented something similar for lisp inside MacPorts.
Nice, I'd love to see the patch. Do you have a link?
Similar means "another lisp package manager" like guix or nix if we compare
it with quicklisp.
Not a similar patch.
Sorry for confusion.
…--
wbr, Kirill
|
@hraban I do not understand the title of the linked job; overall — is there any pending testing? I am fine merging now. |
It all seems to work great 👍 I say it's ready to merge |
There apparently was some interaction between staging* changes (PR #309297) and this PR, resulting into sbcl build being broken on x86_64-linux (and thus all of The failure "first appeared" on an automatic merge from master to staging-next (42828a7). The packages build and are in cache.nixos.org for both parents, but broken at that commit - and that's how it's in the current nixpkgs master now :-/ (I was now testing with sbclPackages.cl-colors2 in particular, but sbcl build itself gets broken.) |
I'm not sure what to do here. If you have no ideas, I'd probably suggest to revert this merge until more is known. |
Oh, after a few retries the build did succeed 🤦🏽 so I don't know. |
Do you have the failed log before retries in easy access? I guess I could at least try to see if there is an obvious reason for flakiness… |
No, I'm afraid I don't know of a log now. I wasn't careful. |
No problem and moving forward the filling of the cache is always valuable! It was just an «if it's cheap, why not try» question. I guess sooner or later we will hit the same builder again … (If it is something e.g. about CPU generations and availability of some instructions) |
|
Ah interesting, thanks! |
It's unfortunate. Otherwise I'd have the log. |
Description of changes
Allow controlling SBCL memory through a
SBCL_DYNAMIC_SPACE_SIZE
envvar which has the same format as the--dynamic-space-size
cli flag.I have tried this locally and on https://github.com/hraban/cl-nix-lite and it significantly simplifies a few hokey workarounds I had. It might also address the concerns from #298034 depending on their circumstances. And would it help clean up the ugly wrapping we do in
all-packages.nix
at the moment? https://github.com/NixOS/nixpkgs/blob/200e237951a35168aff3af66965c08667b4833af/pkgs/top-level/all-packages.nix#L25547 etc.The idea being that memory is set from the first value found in this order:
Notably this means that memory can be set on a per-package basis and big packages can reuse build cache from smaller packages and vice-versa. Concretely: in
cl-nix-lite
the3d-math
package requires >3GiB of heap to build, but this meant setting the dynamic space size to 3GiB for all packages built by SBCL on CI, effectively disabling the build cache for SBCL.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.