Skip to content

Support symlink follow control#2

Merged
peter-jerry-ye merged 10 commits into
mainfrom
codex/follow-symlinks
Jun 12, 2026
Merged

Support symlink follow control#2
peter-jerry-ye merged 10 commits into
mainfrom
codex/follow-symlinks

Conversation

@peter-jerry-ye

Copy link
Copy Markdown
Contributor

Why

miniio path operations always used WASI's default no-follow lookup behavior, which made symlinked files and directories unusable through the public filesystem helpers. The examples also referenced older dependency versions that pulled an outdated async package.

What changed

  • Adds public follow_symlink? : Bool = true options to open and readdir, matching the boolean style used by moonbitlang/async/fs.
  • Threads the option through the raw WASI layer using LookupFlags.
  • Bumps the package version to 0.2.1 and refreshes example dependency versions.

Why this is minimal

The root API exposes a small boolean instead of leaking WASI-specific flags. The raw LookupFlags support is limited to the internal/raw layer where the WASI bit is needed.

@peter-jerry-ye peter-jerry-ye marked this pull request as ready for review June 12, 2026 06:43

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 18cb069862

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread fs.mbt

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b3a138d55c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread fs_test.mbt Outdated
Comment thread fs.mbt Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

miniio/fs.mbt

Lines 63 to 64 in 204c6e4

pub fn create(path : StringView) -> File raise Errno {
{ raw: wrap(() => @raw.create(path)), read_buf: @io.ReaderBuffer::new() }

P2 Badge Make create follow symlinks too

With this change, open(..., follow_symlink=true) and helpers like write_file can write through a symlink, but the public create(path) helper still delegates to @raw.create(path), whose default lookup flags are no-follow. In the common case where callers use create("link-to-file") to truncate/write an existing symlinked file, it still raises on the symlink instead of following the same default behavior as open; route this through open(path, mode=WriteOnly, create_mode=CreateOrTruncate) or add/pass the new flag.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@peter-jerry-ye peter-jerry-ye merged commit 71ba3c2 into main Jun 12, 2026
4 checks passed
@peter-jerry-ye peter-jerry-ye deleted the codex/follow-symlinks branch June 12, 2026 07:57
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