Skip to content

Conversation

charles-zablit
Copy link
Contributor

@charles-zablit charles-zablit commented Oct 8, 2025

The maximum path size for a Unix socket on macOS is 104 bytes (108 on Linux). This causes update-checkout to fail in silent mode when TMPDIR is set to a long path. This is likely to happen in CI.

This patch checks if the socket path will exceed the limit and fallback to verbose mode if it does. verbose mode does not use a Manager and therefore does not create a socket. The patch also adds a unittest to make sure we never try to create a Manager if the TMPDIR path is too long.

rdar://162088344

@charles-zablit charles-zablit self-assigned this Oct 8, 2025
@charles-zablit charles-zablit added utils Area: the build system and other accessory scripts under the "utils" directory update-checkout Area → utils: the `update-checkout` script labels Oct 8, 2025
@charles-zablit
Copy link
Contributor Author

@swift-ci please smoke test

@charles-zablit
Copy link
Contributor Author

@swift-ci please smoke test macOS

@charles-zablit
Copy link
Contributor Author

@swift-ci please smoke test

self.assertIn(b"git checkout refs/heads/main", output)

def test_manager_not_called_on_long_socket(self):
fake_tmpdir = '/tmp/very/' + '/long' * 20 + '/tmp'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was going to say, we shouldn't hardcode /tmp, but this is just a random long path, that isn't being accessed, right? You're using https://docs.python.org/3/library/tempfile.html to get a real directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is just a random long path to emulate a path with more than ~100 characters.

@charles-zablit
Copy link
Contributor Author

@swift-ci please test windows

@charles-zablit charles-zablit merged commit 8b58d83 into swiftlang:main Oct 9, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

update-checkout Area → utils: the `update-checkout` script utils Area: the build system and other accessory scripts under the "utils" directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants