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 random sandbox names (by default) #113

Merged
merged 2 commits into from
Jan 27, 2025
Merged

Use random sandbox names (by default) #113

merged 2 commits into from
Jan 27, 2025

Conversation

ethomson
Copy link
Member

Given that test names can be long and some platforms insist upon a
short maximum path length (eg, Windows), we may not want to
indiscriminately use path names as the sandbox directory name.

However, this has high utility in some situations, so allow it as an
opt-in. By default, we'll just use an 8 hexadigit "random" string.
(We'll use the rand(3) mechanism, which is not be particularly random,
but since the sandbox directories are sequestered in a unique tempdir,
a clar process need only attempt to avoid collisions between itself,
not with other processes.)

Change the realpath definition to have a CLAR_ prefix -
`CLAR_HAS_REALPATH` - and check in the CMake run for it.
Given that test names can be long _and_ some platforms insist upon a
short maximum path length (eg, Windows), we may not want to
indiscriminately use path names as the sandbox directory name.

However, this has high utility in some situations, so allow it as an
opt-in. By default, we'll just use an 8 hexadigit "random" string.
(We'll use the rand(3) mechanism, which is not be particularly random,
but since the sandbox directories are sequestered in a unique tempdir,
a clar process need only attempt to avoid collisions between itself,
not with other processes.)
@ethomson ethomson merged commit 0327403 into main Jan 27, 2025
6 checks passed
@ethomson ethomson deleted the ethomson/tempdirs branch January 27, 2025 11:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant