tools: a seat that does not own the shared Wine prefix cannot run any GTest recipe from the work root

Open
#2,915 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp
Domain
devtools, testing

Research direction

Start with tools/lib/wine_prefix.sh and inspect how the GTest recipes choose and prepare WINEPREFIX before building. Then run a named GTest recipe from a seat that does not own the shared prefix; done means the test passes without manually setting WINEPREFIX, or any inability to use the default prefix is reported before the build starts.

Written by the indexing model from the issue text.

Description

backlog

Evidence at 59710727b

The GTest recipes run their Wine binaries in one shared prefix under the work root, unless the caller sets WINEPREFIX. tools/lib/wine_prefix.sh makes that prefix once and reuses it (its header: "the caller's WINEPREFIX, else a prefix of its own with a z: drive under the work root"). The prefix's directory is owned by the user that made it, and a seat whose user is not that user cannot write into it.

Measured on a seat whose user is not the owner (read only, then one run):

  • ls -ld <work root>/wine-prefix/gtest prints the owner as another user.
  • just test-auth-unit test_platform_compat_createdir (no WINEPREFIX set) builds the binary and then stops at the Wine launch: wine: '<work root>/wine-prefix/gtest' is not owned by you, exit 1. In a full quick check of the same tree, 105 GTest binaries failed the same way and none of them ran.
  • With WINEPREFIX set to a prefix of the seat's own, the same binary runs and passes (10 tests, exit 0). The prefix is made by Wine on its first run; dosdevices/z: links to /.

A second seat has hit the same error; its commit message records the form that worked for it (#2671).

Not shown

  • Whether the prefix should be per user or per seat. The fix is not chosen here.
  • Whether any other recipe that starts Wine (test-scripting, the launch scripts) has the same behaviour. Only the GTest recipe was run.

Falsifier

A seat that is not the owner of the default prefix running just test-auth-unit <name> with no WINEPREFIX set, and the binary running (not stopping at the Wine launch), would show the ownership error does not block the recipe.

Work

Outcome wanted: any seat can run the GTest recipes from the shared work root without setting WINEPREFIX by hand, and a seat that cannot use the default prefix is told so before any build starts, not after the binary is built. The method is the owner's to choose (a prefix per user or per seat, made by the recipe itself). Each step of the fix is checked by a run from a seat whose user is not the owner: the recipe runs one named GTest and the test passes.

Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.