Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ofs): introduce ofs macos support #5136

Merged
merged 2 commits into from
Sep 27, 2024
Merged

Conversation

oowl
Copy link
Member

@oowl oowl commented Sep 23, 2024

Which issue does this PR close?

Closes #4409

Rationale for this change

What changes are included in this PR?

Are there any user-facing changes?

@oowl
Copy link
Member Author

oowl commented Sep 23, 2024

After difficult debugging on macOS environment ( macOS has the big gap in fuse feature compared to BSD and Linux.)

╭─ouyangjun@ouyangs-air ~/code/opendal/bin/ofs ‹feat/owl/ofs-macos●›
╰─$ uname -a                                                                                                                                                                                                                             1 ↵
Darwin ouyangs-air.lan 23.4.0 Darwin Kernel Version 23.4.0: Wed Feb 21 21:51:37 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T8112 arm64
╭─ouyangjun@ouyangs-air ~/code/opendal/bin/ofs ‹feat/owl/ofs-macos●›
╰─$ umount -f /Users/ouyangjun/code/opendal/bin/ofs/exampless
╭─ouyangjun@ouyangs-air ~/code/opendal/bin/ofs ‹feat/owl/ofs-macos●›
╰─$ ./target/debug/ofs ~/code/opendal/bin/ofs/exampless "fs://?root=/Users/ouyangjun/code/libuv/src"
╭─ouyangjun@ouyangs-air ~/code/opendal/bin/ofs ‹feat/owl/ofs-macos●›
╰─$ ls -al ~/code/opendal/bin/ofs/exampless/
total 0
ls: /Users/ouyangjun/code/opendal/bin/ofs/exampless/: Device not configured
╭─ouyangjun@ouyangs-air ~/code/opendal/bin/ofs ‹feat/owl/ofs-macos●›
╰─$ ls -al ~/code/opendal/bin/ofs/exampless/                                                                                                                                                                                             1 ↵
total 288
drwxrwxr-x   0 ouyangjun  staff      0 Apr  3 01:15 .
drwxr-xr-x  10 ouyangjun  staff    320 Apr  2 16:30 ..
-rwxrwxr-x   0 ouyangjun  staff      0 Apr  3 01:14 .aaa.swp
-rwxrwxr-x   0 ouyangjun  staff      0 Apr  3 01:14 aaa
-rwxrwxr-x   0 ouyangjun  staff   7607 May 30  2023 fs-poll.c
-rwxrwxr-x   0 ouyangjun  staff   7053 May 30  2023 heap-inl.h
-rwxrwxr-x   0 ouyangjun  staff   6393 May 30  2023 idna.c
-rwxrwxr-x   0 ouyangjun  staff   1455 May 30  2023 idna.h
-rwxrwxr-x   0 ouyangjun  staff   8068 May 30  2023 inet.c
-rwxrwxr-x   0 ouyangjun  staff   2671 May 30  2023 queue.h
-rwxrwxr-x   0 ouyangjun  staff   3423 May 30  2023 random.c
-rwxrwxr-x   0 ouyangjun  staff   1449 May 30  2023 strscpy.c
-rwxrwxr-x   0 ouyangjun  staff   1748 May 30  2023 strscpy.h
-rwxrwxr-x   0 ouyangjun  staff   1656 May 30  2023 strtok.c
-rwxrwxr-x   0 ouyangjun  staff   1271 May 30  2023 strtok.h
-rwxrwxr-x   0 ouyangjun  staff   3941 May 30  2023 thread-common.c
-rwxrwxr-x   0 ouyangjun  staff  11089 May 30  2023 threadpool.c
-rwxrwxr-x   0 ouyangjun  staff   4731 May 30  2023 timer.c
drwxrwxr-x   0 ouyangjun  staff   1760 May 30  2023 unix
-rwxrwxr-x   0 ouyangjun  staff  23323 May 30  2023 uv-common.c
-rwxrwxr-x   0 ouyangjun  staff  17118 May 30  2023 uv-common.h
-rwxrwxr-x   0 ouyangjun  staff   3126 May 30  2023 uv-data-getter-setters.c
-rwxrwxr-x   0 ouyangjun  staff   1751 May 30  2023 version.c
drwxrwxr-x   0 ouyangjun  staff   1120 May 30  2023 win
╭─ouyangjun@ouyangs-air ~/code/opendal/bin/ofs ‹feat/owl/ofs-macos●›
╰─$ ls -al ~/code/opendal/bin/ofs/exampless/
total 288
drwxrwxr-x   0 ouyangjun  staff      0 Apr  3 01:15 .
drwxr-xr-x  10 ouyangjun  staff    320 Apr  2 16:30 ..
-rwxrwxr-x   0 ouyangjun  staff      0 Apr  3 01:14 .aaa.swp
-rwxrwxr-x   0 ouyangjun  staff      0 Apr  3 01:14 aaa
-rwxrwxr-x   0 ouyangjun  staff   7607 May 30  2023 fs-poll.c
-rwxrwxr-x   0 ouyangjun  staff   7053 May 30  2023 heap-inl.h
-rwxrwxr-x   0 ouyangjun  staff   6393 May 30  2023 idna.c
-rwxrwxr-x   0 ouyangjun  staff   1455 May 30  2023 idna.h
-rwxrwxr-x   0 ouyangjun  staff   8068 May 30  2023 inet.c
-rwxrwxr-x   0 ouyangjun  staff   2671 May 30  2023 queue.h
-rwxrwxr-x   0 ouyangjun  staff   3423 May 30  2023 random.c
-rwxrwxr-x   0 ouyangjun  staff   1449 May 30  2023 strscpy.c
-rwxrwxr-x   0 ouyangjun  staff   1748 May 30  2023 strscpy.h
-rwxrwxr-x   0 ouyangjun  staff   1656 May 30  2023 strtok.c
-rwxrwxr-x   0 ouyangjun  staff   1271 May 30  2023 strtok.h
-rwxrwxr-x   0 ouyangjun  staff   3941 May 30  2023 thread-common.c
-rwxrwxr-x   0 ouyangjun  staff  11089 May 30  2023 threadpool.c
-rwxrwxr-x   0 ouyangjun  staff   4731 May 30  2023 timer.c
drwxrwxr-x   0 ouyangjun  staff   1760 May 30  2023 unix
-rwxrwxr-x   0 ouyangjun  staff  23323 May 30  2023 uv-common.c
-rwxrwxr-x   0 ouyangjun  staff  17118 May 30  2023 uv-common.h
-rwxrwxr-x   0 ouyangjun  staff   3126 May 30  2023 uv-data-getter-setters.c
-rwxrwxr-x   0 ouyangjun  staff   1751 May 30  2023 version.c
drwxrwxr-x   0 ouyangjun  staff   1120 May 30  2023 win
╭─ouyangjun@ouyangs-air ~/code/opendal/bin/ofs ‹feat/owl/ofs-macos●›
╰─$ cat ~/code/opendal/bin/ofs/exampless/
cat: /Users/ouyangjun/code/opendal/bin/ofs/exampless/: Is a directory
╭─ouyangjun@ouyangs-air ~/code/opendal/bin/ofs ‹feat/owl/ofs-macos●›
╰─$ cat ~/code/opendal/bin/ofs/exampless/idna.h                                                                                                                                                                                          1 ↵
/* Copyright (c) 2011, 2018 Ben Noordhuis <[email protected]>
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef UV_SRC_IDNA_H_
#define UV_SRC_IDNA_H_

/* Decode a single codepoint. Returns the codepoint or UINT32_MAX on error.
 * |p| is updated on success _and_ error, i.e., bad multi-byte sequences are
 * skipped in their entirety, not just the first bad byte.
 */
unsigned uv__utf8_decode1(const char** p, const char* pe);

/* Convert a UTF-8 domain name to IDNA 2008 / Punycode. A return value >= 0
 * is the number of bytes written to |d|, including the trailing nul byte.
 * A return value < 0 is a libuv error code. |s| and |d| can not overlap.
 */
long uv__idna_toascii(const char* s, const char* se, char* d, char* de);

#endif  /* UV_SRC_IDNA_H_ */

bin/ofs/Cargo.toml Outdated Show resolved Hide resolved
@oowl
Copy link
Member Author

oowl commented Sep 23, 2024

Let's wait to Sherlock-Holo/fuse3#108 merge and release first.

@oowl
Copy link
Member Author

oowl commented Sep 27, 2024

Sherlock-Holo/fuse3#108 merged, and https://github.com/Sherlock-Holo/fuse3/releases/tag/0.8.1 new release with macOS support. Let's continue to review the current PR.

@oowl oowl requested a review from Xuanwo September 27, 2024 17:29
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

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

Thanks!

@Xuanwo Xuanwo merged commit 43e4d7d into main Sep 27, 2024
31 checks passed
@Xuanwo Xuanwo deleted the feat/owl/ofs-macos-recreat branch September 27, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ofs: support MacOS platform target
2 participants