-
Notifications
You must be signed in to change notification settings - Fork 208
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
error: merge crate nydus-error into nydus-utils and nydus-api #1299
Conversation
@jiangliu , a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/74723 |
Codecov Report
@@ Coverage Diff @@
## master #1299 +/- ##
==========================================
- Coverage 46.06% 45.90% -0.16%
==========================================
Files 124 123 -1
Lines 36934 37009 +75
Branches 36934 37009 +75
==========================================
- Hits 17012 16990 -22
- Misses 19033 19124 +91
- Partials 889 895 +6
|
Merge crate nydus-error into nydus-utils and nydus-api, to reduce number of crates. Signed-off-by: Jiang Liu <[email protected]>
@jiangliu , the code has been updated, so a new test job has been submitted. Please wait in patience. The test job url: https://tone.openanolis.cn/ws/nrh4nnio/test_result/74724 |
@jiangliu , The CI test is completed, please check result:
Congratulations, your test job passed! |
@@ -83,7 +83,10 @@ impl ConfigV2 { | |||
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self> { | |||
let md = fs::metadata(path.as_ref())?; | |||
if md.len() > 0x100000 { | |||
return Err(eother!("configuration file size is too big")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eother
macro is in the same crate, why do we need to replace eother!
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a limitation of rust,
error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
--> api/src/config.rs:17:5
|
17 | use crate::eother;
| ^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
note: the macro is defined here
--> api/src/error.rs:33:9
|
33 | / macro_rules! $fn {
34 | | () => {
35 | | std::io::Error::new($err.kind(), format!("{}: {}:{}", $err, file!(), line!()))
36 | | };
... |
39 | | };
40 | | }
| |_________^
...
82 | define_error_macro!(eother, std::io::Error::new(std::io::ErrorKind::Other, ""));
| ------------------------------------------------------------------------------- in this macro invocation
= note: `#[deny(macro_expanded_macro_exports_accessed_by_absolute_paths)]` on by default
= note: this error originates in the macro `define_error_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
error: macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths
--> api/src/config.rs:1258:17
|
1258 | crate::eother!("test");
| ^^^^^^^^^^^^^
|
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #52234 <https://github.com/rust-lang/rust/issues/52234>
note: the macro is defined here
--> api/src/error.rs:33:9
|
33 | / macro_rules! $fn {
34 | | () => {
35 | | std::io::Error::new($err.kind(), format!("{}: {}:{}", $err, file!(), line!()))
36 | | };
... |
39 | | };
40 | | }
| |_________^
...
82 | define_error_macro!(eother, std::io::Error::new(std::io::ErrorKind::Other, ""));
| ------------------------------------------------------------------------------- in this macro invocation
= note: this error originates in the macro `define_error_macro` (in Nightly builds, run with -Z macro-backtrace for more info)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I get it.
Merge crate nydus-error into nydus-utils and nydus-api, to reduce number of crates.
Types of changes
What types of changes does your PullRequest introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in all the boxes that apply.