Skip to content

Fix the default permissions of Filename.temp_dir before OCaml 5.1 - #78

Open
thierry-martinez wants to merge 4 commits into
ocamllibs:mainfrom
thierry-martinez:fix-temp-dir-perms
Open

thierry-martinez wants to merge 4 commits into
ocamllibs:mainfrom
thierry-martinez:fix-temp-dir-perms

Conversation

@thierry-martinez

@thierry-martinez thierry-martinez commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

This PR is on top of #77 to pass the CI.

The shim of Filename.temp_dir created the directory with the permissions 0o600 by default, without the execute bit: no file could be created in the directory (Sys_error "Permission denied"), unlike with Filename.temp_dir of OCaml 5.1, whose default is 0o700. The default is now 0o700.

The test "Filename.temp_dir" creates a file in a temporary directory: it failed with the previous default on OCaml 4.14.

🤖 Generated with Claude Code

stdcompatpp fails with Not_found on a compiler whose version is not in
`known_versions` (tools/compiler_version.ml): stdcompat could not be
built with OCaml 5.5.1 and 5.5.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ubuntu-latest is now Ubuntu 26, whose GCC 15 defaults to C23: there, a
declaration without prototype such as `value (*)()` takes no argument,
and OCaml 4.11 to 4.13 and 5.0 fail to build (caml/prims.h: "too many
arguments to function"; opam exits with code 31 in the step Setup OCaml).
The step is run with CC="gcc -std=gnu17", which OCaml also records for
the C stubs.

OCaml 4.13.1 built this way with GCC 15.2 locally, and the tests of
stdcompat pass with it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OCaml 4.14.5 has been released, and the CI jobs 4.14.x now install it:
stdcompatpp failed with Not_found since 4.14.5 was not in
`known_versions`. stdcompat builds with OCaml 4.14.5 and its tests pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The shim of Filename.temp_dir created the directory with the permissions
0o600 by default, without the execute bit: no file could be created in
the directory (Sys_error "Permission denied"), unlike with
Filename.temp_dir of OCaml 5.1, whose default is 0o700. The default is now
0o700.

The test "Filename.temp_dir" creates a file in a temporary directory: it
failed with the previous default on OCaml 4.14.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

2 participants