-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add macOS support to OpenZFS #12110
base: master
Are you sure you want to change the base?
Add macOS support to OpenZFS #12110
Conversation
5e2d62d
to
65a74e3
Compare
4277da2
to
162912a
Compare
ef3b4c8
to
e7b6e73
Compare
c7316f5
to
ade3311
Compare
84848e9
to
96f9ab0
Compare
This PR has been updated up to Sonoma (Apple clang version 15.0.0 (clang-1500.0.34.3)), x86_64 and arm64. |
0d075ae
to
bc3f497
Compare
@behlendorf @lundman @mcmilk I remember that we were waiting until the next release to look at this. Since 2.2 has released is there a chance of getting this reviewed for merging? I also remember someone brought up the ideas of
|
It would be nice when this PR gets into current master. I would help afterwards with the unified |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to split this big commit into smaller parts.
At least ito these 4 commits:
part1: module/os/macos/* + include/os/macos/*
part2: module/*
part3: cmd/* + tests/*
part4: config/, scripts/, contrib/* and all other things
-> If you want, I can also create an example of that.
It shouldn't interfare the current CI, so that testing other PRs is working...
Maybe @behlendorf has also some ideas what needs to be done before merging.
Couple of bonus ones in there with 5 and 6. Let me know if you want them squashed into 1-4 somewhere. |
@lundman I tried compiling everything without the macos code (2-6)
so if this PR ends up getting split into multiple PRs that technically counts as shared code |
Yep, all Makefiles are now read in all at once - something upstream did a couple of years back, and some of those Makefiles do various things, depending on .in files etc. The Makefile changes have to be last and in one go. |
part1: module/os/macos/* + include/os/macos/* This does then inlcude lib/*macos* as well, using grep so there are outliers, like manpage. Signed-off-by: Jorgen Lundman <[email protected]>
part2: module/* Signed-off-by: Jorgen Lundman <[email protected]>
part3: cmd/* + tests/* Signed-off-by: Jorgen Lundman <[email protected]>
part4: config/, scripts/, contrib/* Signed-off-by: Jorgen Lundman <[email protected]>
Bonus part5, the non-macos changes to include lib and the top level Makefiles Signed-off-by: Jorgen Lundman <[email protected]>
Signed-off-by: Jorgen Lundman <[email protected]>
.github/workflows/macos-build.yaml
Outdated
./configure CPPFLAGS="-I/usr/local/opt/gettext/include -I/usr/local/opt/openssl/include" LDFLAGS="-L/usr/local/opt/gettext/lib/ -L/usr/local/opt/openssl/lib" | ||
- name: build | ||
run: | | ||
make -j 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default GitHub-hosted macOS runner has 3 vCPUs, but you are limiting make
to only 2 jobs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This then?
make -j`nproc`
Or
make -j$((`nproc`+1))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nproc
is part of GNU Core Utilities, but macOS ships with CLI tools from BSD. A native macOS analogue is sysctl -n hw.ncpu
, there is also a hw.physicalcpu
and a hw.logicalcpu
for hyper-threading.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make -j `sysctl -n hw.ncpu`
make -j $((`sysctl -n hw.ncpu`+1))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Andrew Innes <[email protected]>
Signed-off-by: Yurii Kolesnykov <[email protected]>
Signed-off-by: Andrew Innes <[email protected]>
I'm trying to get smaller PRs merged: |
Motivation and Context
Add macOS support.
Yes, one giant commit - but don't panic.
At first; the easy, independent, changes were taken out, and individually PRed against ZOL. Now we've reached a point where there is not so many of those opportunities left.
If you spot a change you would prefer to be PRed separately, please let me know.
What's in the giant commit?
Changes in tests/ have been left out, and will be in some future PR. Current zfs-tests pass-rate is about 50%. This is mostly due to wrong Unix tools used etc, as opposed to failure to perform ZFS tasks.
Interesting points of ... interests...
mount_zfs
, some rename work added to macos/mount_zfs. cmd/os/linux/mount_zfs ?Description
This adds support for macOS 10.9 to macOS 12 including intel and arm64.
How Has This Been Tested?
macOS zfs-tester and numerous unfortunate users.
Types of changes
Checklist:
Signed-off-by
.