Skip to content

File permission builtins - #6329

Merged
pchiusano merged 14 commits into
unisonweb:trunkfrom
fpringle:file-permission-builtins
Nov 11, 2026
Merged

pchiusano merged 14 commits into
unisonweb:trunkfrom
fpringle:file-permission-builtins

Conversation

@fpringle

@fpringle fpringle commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Overview

Implements built-ins to get and set file permissions, which closes #2790.

New built-ins:

builtin IO.getFilePermissions.impl.v1 :
  Text ->{IO} Either Failure (Boolean, Boolean, Boolean, Boolean)

builtin IO.setFilePermissions.impl.v1 :
  Text -> (Boolean, Boolean, Boolean, Boolean) ->{IO} Either Failure ()

These are then wrapped by the following functions I've added to base here:

IO.FilePath.getPermissions : FilePath ->{IO, Exception} Permissions
IO.FilePath.setPermissions : FilePath -> Permissions ->{IO, Exception} ()

Implementation approach and notes

The approach more or less follows the guide here. getFilePermissions.impl.v1 and setFilePermissions.impl.v1 are declared as built-ins, and the haskell Permission type is marshalled to/from a (Bool, Bool, Bool, Bool) tuple.

Test coverage

I added tests in the runtime-tests project here.

@fpringle
fpringle force-pushed the file-permission-builtins branch 2 times, most recently from e76eba0 to cc1b413 Compare November 3, 2026 17:20
@fpringle
fpringle marked this pull request as ready for review November 3, 2026 17:23
@fpringle
fpringle requested a review from a team as a code owner November 3, 2026 17:23
@fpringle
fpringle force-pushed the file-permission-builtins branch from cc1b413 to 921f273 Compare November 4, 2026 10:22
pchiusano added a commit to fpringle/unison that referenced this pull request Nov 10, 2026
pchiusano added a commit to giodamelio/unison that referenced this pull request Nov 10, 2026
The tests were in a contribution to @unison/runtime-tests on Share, so CI and
interpreter-tests.sh pointed at that contribution's branch. They are now a
section of the io transcript, and runtime-tests is back to releases/0.0.6.
# Conflicts:
#	.github/workflows/proofs/formatting/1b278333198ba9d36ee67e5f2364b6a354792d8c6fac6e0a686b6a1867c02d5f.txt
#	.github/workflows/proofs/tests/995681c40e02cc2aae528aa0d8a3eef52a011700955ef92dda6bb385c45dcbc8.txt
#	.github/workflows/proofs/transcripts/e814eb752b0a53d3cdb326c7d28c24260a95390af6acea51b3a7e85a0feb1511.txt
@pchiusano
pchiusano added this pull request to the merge queue Nov 10, 2026
@pchiusano

Copy link
Copy Markdown
Member

Thanks! I moved the tests to io.md transcript in this repo. It makes things simpler, like we don't have to coordinate a release along with merging the PR.

I'd use the share project for things that are more complicated or difficult to test without more dependencies.

@github-actions

Copy link
Copy Markdown

🤖 The merge queue's full run failed, which removed this pull request from the queue: https://github.com/unisonweb/unison/actions/runs/42939696987

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 11, 2026
pchiusano added a commit to fpringle/unison that referenced this pull request Nov 11, 2026
On Linux arm64 the bfd linker works around Cortex-A53 erratum 843419 by
moving an instruction after an adrp at page offset 0xff8/0xffc into a veneer
(e843419@...) and branching there and back. Decoding stopped at the branch
into the veneer, and the sweep of fixed code labels only targets with info
tables, so the rest of the block was never decoded. The veneer's branch pins
the block, so it stayed put with stale references while what it pointed at
moved: a minified unisonrt crashed with the JIT on once unisonweb#6329 moved a veneer
into Deque code that hello world runs.

The target of a veneer's branch is now a label.
@pchiusano
pchiusano added this pull request to the merge queue Nov 11, 2026
Merged via the queue into unisonweb:trunk with commit 2d66533 Nov 11, 2026
10 checks passed
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.

Built-ins to get and set file permissions

2 participants