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
Use group ID instead of group name #293
Conversation
MacOS allows non-standard group names, including spaces and backslashes), which breaks building from source. This change circumvents the issue by using group ID (numerical) instead of group names. Note that this fixes only building macports-base, not individual ports. Related ticket: https://trac.macports.org/ticket/49501 This changes is based on the contribution of user chucko58 (Chuck Fry) in this comment: https://trac.macports.org/ticket/49501#comment:7
Should I do something to here? |
Hey! Thank you for the contribution. I guess this hangs because it is a niche problem which is harder to test than usual. The change seems reasonable to me without any testing. But shouldn't we go with the numeric ID for both user and group for consistency? |
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 a configuration option to refer to the group numerically would be more appropriate? Or if there's a way to make mtree handle the exotic group names correctly, that would be best of all.
@@ -1,6 +1,6 @@ | |||
# MacPorts filesystem hierarchy, for internal use only. Changes to this file will not stick across installations. | |||
|
|||
/set type=dir uname=@DSTUSR@ gname=@DSTGRP@ mode=@DSTMODE@ | |||
/set type=dir uname=@DSTUSR@ gid=@DSTGID@ mode=@DSTMODE@ |
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 is OK for local installation, but the mtree files also get shipped in the binary packages. I don't think we can guarantee that the gid will refer to the same user on the destination machine as on the build machine.
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.
How does that work then with the group name? That has the same problem right? Or am I missing something?
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 user and group are recorded by name in the pkg.
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.
But the group name might be invalid on the destination machine too, or am I just completely misunderstanding this?
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 can be pretty sure there will be a group named admin
on macOS systems.
Or, since this only seems to be an issue for non-root installations, would it work to remove the uname and gname options entirely in that case? |
Is that possible? Or can we have options like My organisation should fix the group names (it's something like |
Anything's possible, it's just a text file. :) |
MacOS allows non-standard group names, including spaces and backslashes, which breaks building from source. This change circumvents the issue by using group ID (numerical) instead of group names.
Note that this fixes only building macports-base, not individual ports.
Related ticket: https://trac.macports.org/ticket/49501
This changes is based on the contribution of user chucko58 (Chuck Fry) in this comment: https://trac.macports.org/ticket/49501#comment:7