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

kitty0.24.4 : "ld: -stack_size option can only be used when linking a main executable" in aarch64-darwin #165387

Closed
ghost opened this issue Mar 23, 2022 · 7 comments · Fixed by #166661
Labels
0.kind: bug 6.topic: darwin Running or building packages on Darwin 6.topic: python

Comments

@ghost
Copy link

ghost commented Mar 23, 2022

Describe the bug

Can't build kitty 0.24.4 in aarch64-darwin.

Steps To Reproduce

nix build ./nixpkgs#kitty

Expected behavior

Sourcing python-remove-tests-dir-hook
Sourcing python-catch-conflicts-hook.sh
Sourcing python-remove-bin-bytecode-hook.sh
Sourcing python-imports-check-hook.sh
Using pythonImportsCheckPhase
Sourcing python-namespaces-hook
@nix { "action": "setPhase", "phase": "unpackPhase" }
unpacking sources
unpacking source archive /nix/store/181f5jiqivbw5lz3ng9qz47fb2612kwm-source
source root is source
setting SOURCE_DATE_EPOCH to timestamp 315619200 of file source/update-on-ubuntu
@nix { "action": "setPhase", "phase": "patchPhase" }
patching sources
applying patch /nix/store/crkc2hadcrrkk68h8w3bhcbp46w1n76b-fix-zsh-completion-test-1.patch
patching file kitty_tests/shell_integration.py
applying patch /nix/store/9kirvfylq19rphrja772l59vzq992vj9-fix-zsh-completion-test-2.patch
patching file kitty_tests/shell_integration.py
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "buildPhase" }
building
CC: ['clang'] (11, 1)
[65/65] Compiling kitty/gl-wrapper.c ... done
[6/6] Linking kittens/choose/subseq_matcher ... done
Linking kittens/unicode_input/unicode_names ...
clang -Wextra -Wfloat-conversion -Wno-missing-field-initializers -Wall -Wstrict-prototypes -std=c11 -O3 -fwrapv -fstack-protector-strong -pipe -fvisibility=hidden -D_FORTIFY_SOURCE=2 -DKITTY_HAS_RS_SIG_ARGS -Ikitty -I/nix/store/mqdppmn4n37dkqwx71g88a8pa5h676gj-python3-3.9.10/include/python3.9 -Wall -O3 -shared build/unicode_names-unicode_names.c.o -ldl -lncurses -framework CoreFoundation -L/nix/store/mqdppmn4n37dkqwx71g88a8pa5h676gj-python3-3.9.10/lib -lpython3.9 -Wl,-stack_size,1000000 -framework CoreFoundation -o build/kittens/unicode_input/unicode_names.so
ld: -stack_size option can only be used when linking a main executable
clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

Notify maintainers

@tex @rvolosatovs @Luflosi

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"aarch64-darwin"`
 - host os: `Darwin 21.4.0, macOS 12.3`
 - multi-user?: `yes`
 - sandbox: `no`
 - version: `nix-env (Nix) 2.7.0`
 - channels(root): `"nixpkgs"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@ghost ghost added the 0.kind: bug label Mar 23, 2022
@ghost
Copy link
Author

ghost commented Mar 23, 2022

kovidgoyal/kitty#289

@ghost
Copy link
Author

ghost commented Mar 23, 2022

I apply the patch work:

diff --git a/setup.py b/setup.py
index 688e770..fcfe52b 100755
--- a/setup.py
+++ b/setup.py
@@ -199,7 +199,7 @@ def get_python_flags(cflags: List[str]) -> List[str]:
         ldlib = sysconfig.get_config_var('VERSION')
         if ldlib:
             libs += [f'-lpython{ldlib}{sys.abiflags}']
-        libs += (sysconfig.get_config_var('LINKFORSHARED') or '').split()
+        libs += sysconfig.get_config_var('LINKFORSHARED').replace('-Wl,-stack_size,1000000', '').split()
     return libs

@veprbl veprbl added the 6.topic: darwin Running or building packages on Darwin label Mar 23, 2022
@leungbk
Copy link
Member

leungbk commented Mar 25, 2022

This might be worth a PR.

azuwis added a commit to azuwis/nix-config that referenced this issue Mar 25, 2022
@Luflosi
Copy link
Contributor

Luflosi commented Mar 27, 2022

This seems to be a problem recently introduced in Nixpkgs. I don't yet know when exactly it was introduced.

@malob
Copy link
Member

malob commented Mar 29, 2022

This is a brutal git bisect, my guess is that this started to break due to a change that landed on a staging branch first.

@malob
Copy link
Member

malob commented Mar 31, 2022

Alrighty, I've narrowed things down. The root cause is from #157775, in particular c7c3187.

@veprbl, thoughts on reverting that commit? If so, any chance it could make it into the current staging-next push #165406?

@malob
Copy link
Member

malob commented Mar 31, 2022

(cc @FRidh)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug 6.topic: darwin Running or building packages on Darwin 6.topic: python
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants