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

Use group ID instead of group name #293

Closed
wants to merge 2 commits into from
Closed

Use group ID instead of group name #293

wants to merge 2 commits into from

Conversation

lcvisser
Copy link

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

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
@lcvisser
Copy link
Author

lcvisser commented Dec 4, 2023

Should I do something to here?

@raimue
Copy link
Member

raimue commented Dec 4, 2023

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?

Copy link
Member

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

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.

Copy link
Author

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?

Copy link
Member

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.

Copy link
Author

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?

Copy link
Member

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.

@jmroot
Copy link
Member

jmroot commented Dec 5, 2023

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?

@lcvisser
Copy link
Author

lcvisser commented Dec 5, 2023

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 --use-gid=xyz to configure to override? I'm a bit too far out of my comfort zone here to see how to do that, but I can put in some effort, considering it's so niche...

My organisation should fix the group names (it's something like myorgAD\Domain Users: a \ and a space), but since that is not going to happen, I'm stuck with it. Currently I need to build macports-base from source every time there's an OS update, which is not the end of the world.

@jmroot
Copy link
Member

jmroot commented Dec 5, 2023

Is that possible?

Anything's possible, it's just a text file. :)

@jmroot jmroot closed this in 5fddde0 Dec 5, 2023
@lcvisser lcvisser deleted the use-groupid branch December 6, 2023 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants