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

mpv: fix build with clang 16 and on x86_64-darwin #245452

Merged
merged 2 commits into from
Jul 27, 2023

Conversation

reckenrode
Copy link
Contributor

Description of changes

mpv was failing to build with the clang 16 stdenv because clang 16 changes arm_neon.h in a way that’s not compatible with the clang 15 used by Swift. Switching to Swift’s stdenv fixes that problem and also allows mpv to build on x86_64-darwin. The deployment target is set to 10.15 to ensure that x86_64-darwin also uses the system Swift libraries.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

This fixes an issue where headers from the stdenv’s clang are being used
by Swift’s clang. That does not cause issues when the stdenv on Darwin
uses clang 11, but the build will fail on aarch64-darwin with a stdenv
that uses clang 16 (due to changes in `arm_neon.h` that are not
compatible with clang 15).
Copy link
Member

@AndersonTorres AndersonTorres left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If no Darwin user merge this in two days, ping me.

Swift support doesn’t seem to work with back-deployed dylibs, so set the
deployment target to 10.15 to force Swift to link against the system
Swift libraries. The change to use the Swift stdenv fixes the errors
reported in NixOS#214944.
@fpletz fpletz merged commit e8d63b1 into NixOS:master Jul 27, 2023
7 of 8 checks passed
@reckenrode reckenrode deleted the mpv-fixes branch July 27, 2023 13:35
@andersk andersk mentioned this pull request Aug 7, 2023
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants