rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
97.19k stars 12.56k forks source link

1.49 seems to have bumped required macOS version #80804

Closed pkgw closed 3 years ago

pkgw commented 3 years ago

After the release at 1.49, we at conda-forge are seeing some new build failures on macOS builds due to a missing _linkat symbol:

error: linking with `x86_64-apple-darwin13.4.0-clang` failed: exit code: 1
  |
  = note: "x86_64-apple-darwin13.4.0-clang" "-m64" "-arch" "x86_64" [... long command line ...]
  = note: Undefined symbols for architecture x86_64:
            "_linkat", referenced from:
                std::sys::unix::fs::link::had1f447ad1437b53 in libstd-518979da66993550.rlib(std-518979da66993550.std.byn0lf9c-cgu.0.rcgu.o)
          ld: symbol(s) not found for architecture x86_64
          clang-11: error: linker command failed with exit code 1 (use -v to see invocation)

linkat is only availabe starting in macOS 10.10, while on conda-forge our targeted minimum version is 10.9. It looks like this may have been introduced unintentionally in #78026.

I'm filing this as a regression because I don't see any documentation of a bump in the minimum macOS version for 1.49.

CC @isuruf @bollwyvl conda-forge/rust-feedstock#73.

jyn514 commented 3 years ago

https://github.com/rust-lang/rust/pull/78026#issuecomment-712227232

What if an OS doesn't have support for this?

Good question. linkat is in POSIX.1-2008 and pretty widely supported, but it appears at least VxWorks and Redox don't support it, so I've now added a patch special-casing those two platforms.

Is there a way to tell if we're compiling on MacOS 10.9 or lower and special case it if so?

ehuss commented 3 years ago

Is there a way to tell if we're compiling on MacOS 10.9 or lower and special case it if so?

I think the weak macro is normally used for runtime detection of a symbol.

pkgw commented 3 years ago

@jyn514 In the interest of generating portable binaries, one could make the argument for not using the API even if one is compiling on a newer macOS. For precompiled stdlib in particular, I'd guess that somewhere there's a specification for the minimum supported OS version?

Mark-Simulacrum commented 3 years ago

We can't really compile on old macos feasibly in CI, but it should be fairly straightforward to use linkat via the weak macro (which performs runtime detection of availability). I think we'll likely want to land using weak on nightly for testing, and then follow up with a beta backport. We can consider a stable backport as well, since this seems like a major problem for (all?) users targeting older macs.

apiraino commented 3 years ago

Assigning P-high as discussed as part of the Prioritization Working Group procedure and removing I-prioritize.

Mark-Simulacrum commented 3 years ago

@sunfishcode would you be up for filing a PR to fix this?

aeiouaeiouaeiouaeiouaeiouaeiou commented 3 years ago

Still broken in 1.51. Does this mean that support for older systems has been discontinued after all? According to this commit a OS X <10.10 detection should also be added, but target_os cannot detect the kernel version.

inquisitivecrystal commented 3 years ago

I have a draft for this. I'm getting some comments on Zulip before I open a PR.

@rustbot claim

joshtriplett commented 3 years ago

We're merging https://github.com/rust-lang/rust/pull/85953 to fix this issue for the time being.

We also plan to start the conversation about when to drop support for older versions of macOS. But for now, this should restore support for older macOS.

pkgw commented 3 years ago

Thanks! Should we expect this fix to appear in 1.54, or will it take longer than that to make it to stable?

inquisitivecrystal commented 3 years ago

It will definitely be in 1.55. It will only be in 1.54 if the libs team decides to backport it to beta. I personally think that might be a good idea, but I'm not on the team, I just happened to be the one who who wrote the fix PR.

inquisitivecrystal commented 3 years ago

@pkgw Quick update: unfortunately, this won't hit stable till 1.55.

pkgw commented 3 years ago

@inquisitivecrystal Thanks, that's good to know!