-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
samba 4.14.5 (new formula) #80171
samba 4.14.5 (new formula) #80171
Conversation
Formula/samba.rb
Outdated
# macOS has its own SMB daemon as /usr/sbin/smbd, so rename our smbd to samba-dot-org-smbd to avoid conflict. | ||
# samba-dot-org-smbd is used by qemu.rb . | ||
mv "#{sbin}/smbd", "#{sbin}/samba-dot-org-smbd" |
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 means the formulae should be keg-only instead of renaming IYAM
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.
QEMU requires the binary to be renamed:
Lines 67 to 72 in 0b1849e
# Sharing Samba directories in QEMU requires the samba.org smbd which is | |
# incompatible with the macOS-provided version. This will lead to | |
# silent runtime failures, so we set it to a Homebrew path in order to | |
# obtain sensible runtime errors. This will also be compatible with | |
# Samba installations from external taps. | |
args << "--smbd=#{HOMEBREW_PREFIX}/sbin/samba-dot-org-smbd" |
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.
I think it should also be fine if it's called smbd but is inside a separate directory (i.e. not linked to /usr/local/sbin). I believe the reason I used a separate name was to make the error message more obvious.
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.
QEMU requires the binary to be renamed
I think if we ship samba again we can just update the qemu formula
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.
I think if we ship samba again we can just update the qemu formula
Let's not do this. This breaks the install of anyone using a non-Homebrew Samba with Homebrew QEMU. Personally I think renaming one file to avoid a conflict is perfectly fine. We have a lot of formulae that do more than this to avoid becoming keg-only too. (e.g. the versioned gcc
formulae)
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.
Maybe we can symlink it?
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.
macOS version of smbd
is completely different from Samba version of smbd
except the binary name.
So I think renaming the binary without making it keg-only is more preferable than symlinking keg-only binary.
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.
You have some errors from brew audit --new
. Please don't mark items in the PR template as done when you did not do them.
0e76cff
to
f47f74f
Compare
Is the |
Thanks for working on this, will be great to have a binary package rather than having to build from source :) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Updated PR to use custom CFLAGS instead of applying patches, for avoiding Also added |
This comment has been minimized.
This comment has been minimized.
a44cfab
to
d1dfbf2
Compare
d09d4d2
to
83a08b0
Compare
4bd94d1
to
4ba89ac
Compare
ae2ed6e
to
6ec02e9
Compare
Samba (v3) was removed from Homebrew in 2016 due to technical issues, however, Samba v4 seems actively supporting macOS recently, and worth including again in Homebrew. Samba v4 is already included in MacPorts. Further discussion in Homebrew/discussions 1736 . The formula is based on Alexander Richardson (arichardson)'s PR 32031 . Example usage with qemu: ``` qemu-system-x86_64 \ -accel hvf \ -m 4096 \ -cdrom ubuntu-21.04-desktop-amd64.iso \ -net nic \ -net user,smb=/tmp/foo ``` The shared folder can be mounted with `mount.cifs //10.0.2.4/qemu /mnt` in the guest. Co-authored-by: Alex Richardson <Alexander.Richardson@cl.cam.ac.uk> Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
end | ||
# CFLAGS is for avoiding hitting https://bugzilla.samba.org/show_bug.cgi?id=14680 . | ||
# Remove this CFLAGS when the patch ( https://attachments.samba.org/attachment.cgi?id=16579 ) gets merged. | ||
ENV.append "CFLAGS", "-include #{buildpath}/lib/util/debug.h" |
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 feels like a pretty heavy-handed way of getting around the no-patches requirement.
Samba (v3) was removed from Homebrew in 2016 due to technical issues (Homebrew/legacy-homebrew#17820, 5af93ae), however, Samba v4 seems actively supporting macOS recently, and worth including again in Homebrew.
Samba v4 is already included in MacPorts.
Further discussion in Homebrew/discussions#1736
The formula is based on Alexander Richardson (@arichardson)'s PR #32031 .
Example usage with qemu:
The shared folder can be mounted with
mount.cifs //10.0.2.4/qemu /mnt
in the guest.brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew test <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install --build-from-source <formula>
)? If this is a new formula, does it passbrew audit --new <formula>
?