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

1.49 seems to have bumped required macOS version #80804

Closed
pkgw opened this issue Jan 8, 2021 · 13 comments · Fixed by #85953
Closed

1.49 seems to have bumped required macOS version #80804

pkgw opened this issue Jan 8, 2021 · 13 comments · Fixed by #85953
Assignees
Labels
O-macos Operating system: macOS P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Milestone

Comments

@pkgw
Copy link
Contributor

pkgw commented Jan 8, 2021

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.

@Mark-Simulacrum Mark-Simulacrum added T-libs Relevant to the library team, which will review and decide on the PR/issue. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. labels Jan 8, 2021
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Jan 8, 2021
@jyn514 jyn514 added the O-macos Operating system: macOS label Jan 8, 2021
@jyn514
Copy link
Member

jyn514 commented Jan 8, 2021

#78026 (comment)

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
Copy link
Contributor

ehuss commented Jan 8, 2021

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
Copy link
Contributor Author

pkgw commented Jan 8, 2021

@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
Copy link
Member

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
Copy link
Contributor

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

@Mark-Simulacrum
Copy link
Member

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

@aeiouaeiouaeiouaeiouaeiouaeiou

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.

@Mark-Simulacrum Mark-Simulacrum added this to the 1.49.0 milestone Mar 29, 2021
@inquisitivecrystal
Copy link
Contributor

inquisitivecrystal commented Jun 3, 2021

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

@rustbot claim

@joshtriplett
Copy link
Member

We're merging #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
Copy link
Contributor Author

pkgw commented Jul 7, 2021

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

@inquisitivecrystal
Copy link
Contributor

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.

JohnTitor added a commit to JohnTitor/rust that referenced this issue Jul 7, 2021
…s-hardlink, r=joshtriplett

Fix linker error

Currently, `fs::hard_link` determines whether platforms have `linkat` based on the OS, and uses `link` if they don't. However, this heuristic does not work well if a platform provides `linkat` on newer versions but not on older ones. On old MacOS, this currently causes a linking error.

This commit fixes `fs::hard_link` by telling it to use `weak!` on macOS This means that, on  that operating system, we now check for `linkat` at runtime and use `link` if it is not available.

Fixes rust-lang#80804.

`@rustbot` label T-libs-impl
JohnTitor added a commit to JohnTitor/rust that referenced this issue Jul 7, 2021
…s-hardlink, r=joshtriplett

Fix linker error

Currently, `fs::hard_link` determines whether platforms have `linkat` based on the OS, and uses `link` if they don't. However, this heuristic does not work well if a platform provides `linkat` on newer versions but not on older ones. On old MacOS, this currently causes a linking error.

This commit fixes `fs::hard_link` by telling it to use `weak!` on macOS This means that, on  that operating system, we now check for `linkat` at runtime and use `link` if it is not available.

Fixes rust-lang#80804.

``@rustbot`` label T-libs-impl
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 10, 2021
…hardlink, r=joshtriplett

Fix linker error

Currently, `fs::hard_link` determines whether platforms have `linkat` based on the OS, and uses `link` if they don't. However, this heuristic does not work well if a platform provides `linkat` on newer versions but not on older ones. On old MacOS, this currently causes a linking error.

This commit fixes `fs::hard_link` by telling it to use `weak!` on macOS. This means that, on  that operating system, we now check for `linkat` at runtime and use `link` if it is not available.

Fixes rust-lang#80804.

`@rustbot` label T-libs-impl
@inquisitivecrystal
Copy link
Contributor

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

@pkgw
Copy link
Contributor Author

pkgw commented Jul 21, 2021

@inquisitivecrystal Thanks, that's good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-macos Operating system: macOS P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants