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

[#5877] feat (gvfs-fuse): Implement a common filesystem layer #5878

Merged
merged 31 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion clients/filesystem-fuse/.cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,4 @@
# under the License.

[build]
target-dir = "build"
rustflags = ["-Adead_code", "-Aclippy::redundant-field-names"]
6 changes: 4 additions & 2 deletions clients/filesystem-fuse/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ name = "gvfs-fuse"
path = "src/main.rs"

[lib]
name="gvfs_fuse"
name = "gvfs_fuse"

[dependencies]
async-trait = "0.1"
bytes = "1.6.0"
futures-util = "0.3.30"
dashmap = "6.1.0"
fuse3 = { version = "0.8.1", "features" = ["tokio-runtime", "unprivileged"] }
futures-util = "0.3.30"
libc = "0.2.168"
log = "0.4.22"
tokio = { version = "1.38.0", features = ["full"] }
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
Expand Down
69 changes: 69 additions & 0 deletions clients/filesystem-fuse/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.

.EXPORT_ALL_VARIABLES:

.PHONY: build
build:
cargo build --all-features --workspace

fmt:
cargo fmt --all

cargo-sort: install-cargo-sort
cargo sort -w

fix-toml: install-taplo-cli
taplo fmt

check-fmt:
cargo fmt --all -- --check

check-clippy:
cargo clippy --all-targets --all-features --workspace -- -D warnings

install-cargo-sort:
cargo install [email protected]

check-cargo-sort: install-cargo-sort
cargo sort -c

install-cargo-machete:
cargo install cargo-machete

cargo-machete: install-cargo-machete
cargo machete

install-taplo-cli:
cargo install [email protected]

check-toml: install-taplo-cli
taplo check

check: check-fmt check-clippy check-cargo-sort check-toml cargo-machete

doc-test:
cargo test --no-fail-fast --doc --all-features --workspace

unit-test: doc-test
cargo test --no-fail-fast --lib --all-features --workspace

test: doc-test
cargo test --no-fail-fast --all-targets --all-features --workspace

clean:
cargo clean
36 changes: 16 additions & 20 deletions clients/filesystem-fuse/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import org.gradle.api.tasks.Exec

val checkRustEnvironment by tasks.registering(Exec::class) {
description = "Check if Rust environment."
group = "verification"
commandLine("bash", "-c", "cargo --version")
standardOutput = System.out
errorOutput = System.err
Expand All @@ -30,36 +28,30 @@ val checkRustEnvironment by tasks.registering(Exec::class) {

val buildRustProject by tasks.registering(Exec::class) {
dependsOn(checkRustEnvironment)
description = "Compile the Rust project"
workingDir = file("$projectDir")
commandLine("bash", "-c", "cargo build --release")
commandLine("bash", "-c", "make build")
}

val checkRustProject by tasks.registering(Exec::class) {
dependsOn(checkRustEnvironment)
description = "Check the Rust project"
workingDir = file("$projectDir")

commandLine(
"bash",
"-c",
"""
set -e
echo "Checking the code format"
cargo fmt --all -- --check

echo "Running clippy"
cargo clippy --all-targets --all-features --workspace -- -D warnings
""".trimIndent()
)
commandLine("bash", "-c", "make check")
}

val testRustProject by tasks.registering(Exec::class) {
dependsOn(checkRustEnvironment)
description = "Run tests in the Rust project"
group = "verification"
workingDir = file("$projectDir")
commandLine("bash", "-c", "cargo test --release")
commandLine("bash", "-c", "make test")

standardOutput = System.out
errorOutput = System.err
}

val cleanRustProject by tasks.registering(Exec::class) {
dependsOn(checkRustEnvironment)
workingDir = file("$projectDir")
commandLine("bash", "-c", "make clean")

standardOutput = System.out
errorOutput = System.err
Expand All @@ -85,3 +77,7 @@ tasks.named("check") {
tasks.named("test") {
dependsOn(testRustProject)
}

tasks.named("clean") {
dependsOn(cleanRustProject)
}
Loading
Loading