Comments (7)
Yeah, WASI doesn't have absolute paths, so the standard realpath
doesn't fit. I filed #82 to remove the declarations.
That said, besides making paths absolute, realpath
also resolves symbolic links, resolves ..
and .
paths, and trims redundant /
characters. We could conceivably have a realpath
which does those things and maybe also resolves relative paths to be rooted at .
, which might be enough for some use cases.
from wasi-libc.
It doesn't have absolute paths at the syscall layer, but doesn't it kind of emulate them in libpreopen? I mean if the concept of PWD exists then can't realpath just use getcwd() to construct an abspath?
from wasi-libc.
We don't currently have getcwd
either :-). libpreopen maps from absolute path to base + relative path, which isn't enough to do getcwd
.
Should we add a getcwd
? It does leak information about the host, and we can't easily virtualize or remap it because the main purpose is to get a string that you can send to another process or serialize out somewhere to be read by the outside world, so it has to reflect the actual host path name.
from wasi-libc.
I think we should encourage the programs that require these sort of absolute path functions to implement them totally in userland, if possible. I wouldn't want to expose the host's "real" cwd at all, but it should be possible to define these functions such that it always pretends to be under /home/wasi
or something, right?
from wasi-libc.
No, I'm not talking about exposing the real host cwd. But we can build cwd in userspace based on the pre-opened root fd can't we? I'm surprised libpreopen doesn't do this already. Wouldn'tit be as simple as doing: base + global_cwd + relative?
I don't understand what you mean about sending the string to the outside world. Paths only make sense within a given module, right? Or at least within modules that shared the same virtualized view of the filesystem.
from wasi-libc.
Right, I'd imagine it would be similar to running in a chroot.
from wasi-libc.
The original issue here is fixed in a413650; we no longer declare realpath
.
If anyone's interested in introducing a concept of a cwd, even without exposing the host cwd, we'd need new WASI support, so we should discuss this in the WASI issue tracker.
from wasi-libc.
Related Issues (20)
- Adding `IFTODT` for more compatibility HOT 1
- A few packaging nits, coming from Nixpkgs/NixOS HOT 6
- Confusion around SIGCHLD value? HOT 2
- WASI signal numbers out of sync with wasi-libc signal numbers HOT 15
- Latest SIMD patch HOT 2
- fd_set implementation is inefficient HOT 5
- Support for `accept{,4}` HOT 3
- Implement the new preopen scheme in wasi-libc HOT 1
- __wasm_call_ctors broken previously wokring rust wasm reactors HOT 2
- getpagesize() HOT 4
- README seems to be wrong wrt minimal LLVM version HOT 4
- Provide socket option definitions HOT 3
- Missing __WASI_RIFLAGS_RECV_DATA_TRUNCATED for MSG_TRUNC HOT 1
- help how to disable feature for example( bulk memory)? HOT 1
- Humble request from distro packagers to start releasing versions HOT 6
- poll() with timeout fails with "timer subscriptions only support monotonic timer" HOT 1
- dlmalloc has license incompatible with Fedora policies HOT 12
- Migrate build system to CMake HOT 4
- How to distribute `THREAD_MODEL=posix` builds? HOT 46
- Is it safe to have mixed sbrk and malloc calls? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasi-libc.