Skip to content

Use linux-raw-sys for FIEMAP constants - #21056

Merged
EliteTK merged 1 commit into
mainfrom
tk/cleanup-fiemap-constants
Aug 11, 2026
Merged

EliteTK merged 1 commit into
mainfrom
tk/cleanup-fiemap-constants

Conversation

@EliteTK

@EliteTK EliteTK commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

This is a follow up to #20925, it makes use of the linux-raw-sys crate which is already in our dependency graph and has the constants which we were previously declaring inline. This doesn't really affect the amount of code, but it avoids needing to think about these values.

Test Plan

Existing coverage.

@EliteTK EliteTK added the internal A refactor or improvement that is not user-facing label Aug 11, 2026
@EliteTK
EliteTK force-pushed the tk/cleanup-fiemap-constants branch from 230149e to 3e0c670 Compare August 11, 2026 17:26

@woodruffw woodruffw left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

@EliteTK
EliteTK enabled auto-merge (squash) August 11, 2026 17:39
@EliteTK
EliteTK merged commit 408d1f3 into main Aug 11, 2026
84 checks passed
@EliteTK
EliteTK deleted the tk/cleanup-fiemap-constants branch August 11, 2026 17:41
@wegank

wegank commented Oct 9, 2026

Copy link
Copy Markdown

I'm having the following error on loongarch64-linux:

error[E0432]: unresolved imports `linux_raw_sys::ioctl::FIEMAP_EXTENT_DATA_INLINE`, `linux_raw_sys::ioctl::FIEMAP_EXTENT_DELALLOC`, `linux_raw_sys::ioctl::FIEMAP_EXTENT_ENCODED`, `linux_raw_sys::ioctl::FIEMAP_EXTENT_LAST`, `linux_raw_sys::ioctl::FIEMAP_EXTENT_NOT_ALIGNED`, `linux_raw_sys::ioctl::FIEMAP_EXTENT_SHARED`, `linux_raw_sys::ioctl::FIEMAP_EXTENT_UNKNOWN`
  --> crates/uv-fs/src/space.rs:13:5
   |
13 |     FIEMAP_EXTENT_DATA_INLINE, FIEMAP_EXTENT_DELALLOC, FIEMAP_EXTENT_ENCODED, FIEMAP_EXTENT_LAST,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^ no `FIEMAP_EXTENT_LAST` in `ioctl`
   |     |                          |                       |
   |     |                          |                       no `FIEMAP_EXTENT_ENCODED` in `ioctl`
   |     |                          no `FIEMAP_EXTENT_DELALLOC` in `ioctl`
   |     no `FIEMAP_EXTENT_DATA_INLINE` in `ioctl`
14 |     FIEMAP_EXTENT_NOT_ALIGNED, FIEMAP_EXTENT_SHARED, FIEMAP_EXTENT_UNKNOWN, FS_IOC_FIEMAP,
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^^^ no `FIEMAP_EXTENT_UNKNOWN` in `ioctl`
   |     |                          |
   |     |                          no `FIEMAP_EXTENT_SHARED` in `ioctl`
   |     no `FIEMAP_EXTENT_NOT_ALIGNED` in `ioctl`

It seems that constants like linux_raw_sys::ioctl::FIEMAP_EXTENT_DATA_INLINE aren't available on all architectures, so this PR breaks builds on platforms without them. Do you know how to fix this?

@woodruffw

Copy link
Copy Markdown
Member

loong64 isn't one of the platforms we build or test for. Can you explain how you're doing the build?

@wegank

wegank commented Oct 9, 2026

Copy link
Copy Markdown

I build with Nix on my machines, and the command should look something like nix build github:NixOS/nixpkgs#python3Packages.uv-build.

It seems that sunfishcode/linux-raw-sys#193 or sunfishcode/linux-raw-sys#195 should fix this on the linux_raw_sys side, but development there seems to be stalled; I wonder if there's anything we can do here...

This branch was previously deployed

1 inactive deployment
automations — 3e0c670a Deployed Aug 11, 2026 by EliteTK via review / security review #44501
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internal A refactor or improvement that is not user-facing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants