Unable to build lix-2.92.0-dev-pre20241115-c859d03 on Intel based Mac #588

Closed
opened 2024-11-30 05:28:38 +00:00 by dstcruz · 8 comments

Describe the bug

Building lix-2.92.0-dev-pre20241115-c859d03 fails with:

error: builder for '/nix/store/h3jmfd92bp7ql33a9qf8np7gzjqhrl4s-lix-2.92.0-dev-pre20241115-c859d03.drv' failed with exit code 1;
       last 25 log lines:
       >                 this->uploadData.reset(fmemopen(const_cast<char *>(uploadData->data()), uploadData->size(), "r"));
       >                                        ^~~~~~~~
       >                                        freopen
       > /nix/store/9l0nxr441n8qr0dk5n48m38dz4dswmg5-apple-sdk-10.12.2/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:248:7: note: 'freopen' declared here
       > FILE    *freopen(const char * __restrict, const char * __restrict,
       >          ^
       > ../src/libstore/filetransfer.cc:151:89: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'size_type' (aka 'unsigned long')
       >                 this->uploadData.reset(fmemopen(const_cast<char *>(uploadData->data()), uploadData->size(), "r"));
       >                                                                                         ^~~~~~~~~~~~~~~~~~
       > /nix/store/9l0nxr441n8qr0dk5n48m38dz4dswmg5-apple-sdk-10.12.2/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:248:63: note: passing argument to parameter here
       > FILE    *freopen(const char * __restrict, const char * __restrict,
       >                                                                  ^
       > 2 errors generated.
       > [105/515] Compiling C++ object src/libstore/liblixstore.dylib.p/export-import.cc.o
       > [106/515] Compiling C++ object src/libstore/liblixstore.dylib.p/local-binary-cache-store.cc.o
       > [107/515] Compiling C++ object src/libstore/liblixstore.dylib.p/http-binary-cache-store.cc.o
       > [108/515] Compiling C++ object src/libstore/liblixstore.dylib.p/lock.cc.o
       > [109/515] Compiling C++ object src/libstore/liblixstore.dylib.p/local-fs-store.cc.o
       > [110/515] Compiling C++ object src/libstore/liblixstore.dylib.p/legacy-ssh-store.cc.o
       > [111/515] Compiling C++ object src/libstore/liblixstore.dylib.p/daemon.cc.o
       > [112/515] Compiling C++ object src/libstore/liblixstore.dylib.p/gc.cc.o
       > [113/515] Compiling C++ object src/libstore/liblixstore.dylib.p/derivations.cc.o
       > [114/515] Compiling C++ object src/libstore/liblixstore.dylib.p/globals.cc.o
       > [115/515] Compiling C++ object src/libstore/liblixstore.dylib.p/local-store.cc.o
       > ninja: build stopped: subcommand failed.
       For full logs, run 'nix log /nix/store/h3jmfd92bp7ql33a9qf8np7gzjqhrl4s-lix-2.92.0-dev-pre20241115-c859d03.drv'.

Steps To Reproduce

Run darwin-rebuild switch --flake .

Lix: https://git.lix.systems/api/v1/repos/lix-project/lix/archive/c859d03013712b349d82ee6223948d6d03e63a8d.tar.gz?rev=c859d03013712b349d82ee6223948d6d03e63a8d

Lix-module: https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/15b999f9c958c475f71fb8c543b9fc2f36ae8730.tar.gz?rev=15b999f9c958c475f71fb8c543b9fc2f36ae8730

Expected behavior

A successful build

nix --version output

nix --version
nix (Lix, like Nix) 2.92.0-dev-pre20241109-b967f1d
## Describe the bug Building lix-2.92.0-dev-pre20241115-c859d03 fails with: ``` error: builder for '/nix/store/h3jmfd92bp7ql33a9qf8np7gzjqhrl4s-lix-2.92.0-dev-pre20241115-c859d03.drv' failed with exit code 1; last 25 log lines: > this->uploadData.reset(fmemopen(const_cast<char *>(uploadData->data()), uploadData->size(), "r")); > ^~~~~~~~ > freopen > /nix/store/9l0nxr441n8qr0dk5n48m38dz4dswmg5-apple-sdk-10.12.2/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:248:7: note: 'freopen' declared here > FILE *freopen(const char * __restrict, const char * __restrict, > ^ > ../src/libstore/filetransfer.cc:151:89: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'size_type' (aka 'unsigned long') > this->uploadData.reset(fmemopen(const_cast<char *>(uploadData->data()), uploadData->size(), "r")); > ^~~~~~~~~~~~~~~~~~ > /nix/store/9l0nxr441n8qr0dk5n48m38dz4dswmg5-apple-sdk-10.12.2/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/stdio.h:248:63: note: passing argument to parameter here > FILE *freopen(const char * __restrict, const char * __restrict, > ^ > 2 errors generated. > [105/515] Compiling C++ object src/libstore/liblixstore.dylib.p/export-import.cc.o > [106/515] Compiling C++ object src/libstore/liblixstore.dylib.p/local-binary-cache-store.cc.o > [107/515] Compiling C++ object src/libstore/liblixstore.dylib.p/http-binary-cache-store.cc.o > [108/515] Compiling C++ object src/libstore/liblixstore.dylib.p/lock.cc.o > [109/515] Compiling C++ object src/libstore/liblixstore.dylib.p/local-fs-store.cc.o > [110/515] Compiling C++ object src/libstore/liblixstore.dylib.p/legacy-ssh-store.cc.o > [111/515] Compiling C++ object src/libstore/liblixstore.dylib.p/daemon.cc.o > [112/515] Compiling C++ object src/libstore/liblixstore.dylib.p/gc.cc.o > [113/515] Compiling C++ object src/libstore/liblixstore.dylib.p/derivations.cc.o > [114/515] Compiling C++ object src/libstore/liblixstore.dylib.p/globals.cc.o > [115/515] Compiling C++ object src/libstore/liblixstore.dylib.p/local-store.cc.o > ninja: build stopped: subcommand failed. For full logs, run 'nix log /nix/store/h3jmfd92bp7ql33a9qf8np7gzjqhrl4s-lix-2.92.0-dev-pre20241115-c859d03.drv'. ``` ## Steps To Reproduce Run `darwin-rebuild switch --flake .` Lix: <https://git.lix.systems/api/v1/repos/lix-project/lix/archive/c859d03013712b349d82ee6223948d6d03e63a8d.tar.gz?rev=c859d03013712b349d82ee6223948d6d03e63a8d> Lix-module: <https://git.lix.systems/api/v1/repos/lix-project/nixos-module/archive/15b999f9c958c475f71fb8c543b9fc2f36ae8730.tar.gz?rev=15b999f9c958c475f71fb8c543b9fc2f36ae8730> ## Expected behavior A successful build ## `nix --version` output ```shell nix --version nix (Lix, like Nix) 2.92.0-dev-pre20241109-b967f1d ```
dstcruz added the
bug
label 2024-11-30 05:28:38 +00:00
Owner

apparently 10.12 is too old to have this function, it appeared only in 10.13. are you really running on an eight year old OS image or is it just choosing the wrong sdk version for some reason?

apparently 10.12 is too old to have this function, it appeared only in 10.13. are you really running on an eight year old OS image or is it just choosing the wrong sdk version for some reason?
Author

I'm not sure how that SDK is being chosen. I'm definitely not running an old OS image—the OS is up to date with the latest version. I'm running nix-darwin, though I'm not sure if that's relevant. Any guidance on determining why this SDK is being used, and how to change that, would be much appreciated.

I'm not sure how that SDK is being chosen. I'm definitely not running an old OS image—the OS is up to date with the latest version. I'm running `nix-darwin`, though I'm not sure if that's relevant. Any guidance on determining why this SDK is being used, and how to change that, would be much appreciated.

If you're on 24.11, you can try including apple-sdk_11 into lix's buildInputs. The x86_64 sdk is still behind to the aarch64 one in 24.11. That's going to be fixed in 25.05.

If you're on `24.11`, you can try including `apple-sdk_11` into lix's `buildInputs`. The x86_64 sdk is still behind to the aarch64 one in `24.11`. That's going to be fixed in `25.05`.
Author

Can you show me how to add this buildInputs for lix to my nix-darwin flake config? After googling around, I'm still not sure how to do that. Here is my flake.nix.

Can you show me how to add this `buildInputs` for `lix` to my `nix-darwin` flake config? After googling around, I'm still not sure how to do that. Here is my [flake.nix](https://github.com/dstcruz/nixfiles/blob/main/flake.nix).
Owner

I would opine that this is still our bug, if everything involved is up to date. I am building a reproducer right now.

I would opine that this is still our bug, if everything involved is up to date. I am building a reproducer right now.
jade referenced this issue from a commit 2024-12-05 23:33:54 +00:00
Owner

alright yes, i can repro this. this is a lix bug. unfortunately i think fixing it is blocked on us upgrading to nixos-24.11, since the attribute names all got shuffled around and i do not want to write bad compat code.

we have a CL for it, it just needs some love.

alright yes, i can repro this. this is a lix bug. unfortunately i think fixing it is blocked on us upgrading to nixos-24.11, since the attribute names all got shuffled around and i do not want to write bad compat code. we have a CL for it, it just needs some love.
jade referenced this issue from a commit 2024-12-05 23:46:06 +00:00
jade referenced this issue from a commit 2024-12-06 01:20:19 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/2283 ("build: fix on x86_64-darwin")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/2283", "number": 2283, "kind": "commit message"}], "cl_meta": {"2283": {"change_title": "build: fix on x86_64-darwin"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/2283](https://gerrit.lix.systems/c/lix/+/2283) ("build: fix on x86_64-darwin")
Owner

Verified fixed in that CL :)

Verified fixed in that CL :)
Sign in to join this conversation.
No milestone
No project
No assignees
5 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#588
No description provided.