Describe the bug
Building of tdesktop-2.2.0
(Telegram Desktop) on my NixOS unstable system fails with the message:
g++: error: unrecognized command line option '-Xarch_x86_64'; did you mean '-march=x86-64'?
Notify maintainers
@primeos @abbradar
Metadata
"x86_64-linux"
Linux 5.7.12, NixOS, 20.09.git.4254de4a41f (Nightingale)
yes
yes
nix-env (Nix) 2.3.7
"nixos-20.09pre237279.8e2b14aceb1"
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute: tdesktop
# a list of nixos modules affected by the problem
module:
Failing Hydra build: https://hydra.nixos.org/build/124793339
This is most likely due to the same problem as in https://github.com/NixOS/nixpkgs/pull/93761#issuecomment-670463209 and should affect multiple packages.
From the investigation of @orivej it seems to be caused by a recent CMake update (#93886).
Yes, I expect that all CMake packages that use target_precompile_headers
are affected. (Very few I suppose, since this feature was added in CMake 3.16.) Currently I'm bisecting CMake.
@orivej I had a quick look at the Git history of CMake and https://gitlab.kitware.com/cmake/cmake/-/commit/f593b354da2e9637e9b869688934f0ba2544ebed?expanded=1#6c9f77aa6e8d69a3b0b3ddcff14fb5312faa7b5a_2457_2469 seems like a good candidate.
Anyway, thanks a lot for investigating this :heart: :)
Indeed, this is caused by https://gitlab.kitware.com/cmake/cmake/-/merge_requests/4561
So I guess a quick workaround might be to only add the CMAKE_OSX_*
variables (especially CMAKE_OSX_ARCHITECTURES
) on macOS builds?
And according to https://cmake.org/cmake/help/latest/variable/CMAKE_OSX_ARCHITECTURES.html it should also be a CMake bug as it states:
This variable is ignored on platforms other than Apple.
Yes. I have reported it at https://gitlab.kitware.com/cmake/cmake/-/issues/21072
I've pushed e7987936c1b28b0de3d774731bc26cde47c24c44 as a temporary quick-fix for the tdesktop
build.
The fix for this issue was just merged into CMake master: https://gitlab.kitware.com/cmake/cmake/-/merge_requests/5118
Let's keep this open for anyone else stumbling such issues, until staging is merged to channels.
This issue has been mentioned on NixOS Discourse. There might be relevant details there:
Most helpful comment
I've pushed e7987936c1b28b0de3d774731bc26cde47c24c44 as a temporary quick-fix for the
tdesktop
build.