Skip to content

internal: Deny the device tree on the hosts that have one - #2

Closed
Yos-X wants to merge 1 commit into
masterfrom
fix/posix-device-tree
Closed

Yos-X wants to merge 1 commit into
masterfrom
fix/posix-device-tree

Conversation

@Yos-X

@Yos-X Yos-X commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator

On a host without a device tree the floor cannot be built, so the agent plugin is not created and everything that starts the runtime fails.

What happens

standardRoots denies Path.of("/dev") on every host. On Windows that path is \dev, which names no root of its own — Files.isAbsolute is false — so canonicalizing it is refused:

java.lang.IllegalArgumentException: A path to canonicalize is absolute and of the default file system, was '\dev'.

AgentFloor is built from those roots, so a suite that starts the runtime fails before a test runs:

Cannot start runtime 'harness': stage GRAPH failed (1 problem):
- Cannot create org.foedusprogramme.alexandrite.agent.permission.AgentFloor with
  org.foedusprogramme.alexandrite.agent.permission.AgentFloor (plugin alexandrite-agent):
  java.lang.IllegalArgumentException: A path to canonicalize is absolute and of the default file system, was '\dev'.

In the checkout this was found in, 265 of the 658 tests of :libraries:agent:test fail this way. The message names the floor rather than the platform, so the cause is not visible from the failures themselves.

The change

The device tree is a root where there is one, so it is denied where the host separates paths with / and nowhere else. Nothing else of standardRoots changes: the credential stores are under the home directory, and the moved stores come from the environment.

Verification

  • :libraries:internal:compileKotlin and :libraries:internal:spotlessCheck pass on this branch.
  • On the branch this was found in, the 265 failures that could not start the runtime are gone with the change and return without it.

Found while adding a channel for OneBot. The floor is not that channel's, but no channel can run the agent plugin on such a host until this is fixed.

The floor denies /dev on every host. On a host without a device tree that path is \dev, which names no root of its own, so no check can canonicalize it and the floor cannot be built: AgentFloor is made of those roots, so the agent plugin is not created at all and everything that starts the runtime fails on such a host.

The device tree is a root where there is one, so it is denied where the host separates paths with a slash and nowhere else.
@Yos-X

Yos-X commented Oct 13, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by the branch that now holds every fix of this kind: \ ix/platform, which carries this fix and the write-permission one, both rebased onto the current \master. The commit that was here is the first of them.

@Yos-X Yos-X closed this Oct 13, 2026
@Yos-X
Yos-X deleted the fix/posix-device-tree branch October 13, 2026 11:12
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