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

error: merge crate nydus-error into nydus-utils and nydus-api #1299

Merged
merged 1 commit into from
May 25, 2023

Conversation

jiangliu
Copy link
Collaborator

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:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@jiangliu jiangliu requested a review from a team as a code owner May 23, 2023 07:22
@jiangliu jiangliu requested review from liubogithub, changweige and adamqqqplay and removed request for a team May 23, 2023 07:22
@anolis-bot
Copy link
Collaborator

@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
Copy link

codecov bot commented May 23, 2023

Codecov Report

Merging #1299 (016b260) into master (809f8d9) will decrease coverage by 0.16%.
The diff coverage is 2.73%.

Impacted file tree graph

@@            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     
Impacted Files Coverage Δ
api/src/error.rs 60.71% <0.00%> (ø)
api/src/http.rs 0.00% <0.00%> (ø)
api/src/http_handler.rs 55.12% <ø> (ø)
api/src/lib.rs 50.00% <ø> (ø)
rafs/src/lib.rs 61.98% <ø> (ø)
service/src/lib.rs 75.64% <ø> (ø)
src/bin/nydusd/main.rs 0.19% <ø> (ø)
src/lib.rs 52.50% <ø> (ø)
storage/src/lib.rs 28.57% <ø> (ø)
utils/src/lib.rs 82.89% <ø> (ø)
... and 3 more

... and 4 files with indirect coverage changes

Merge crate nydus-error into nydus-utils and nydus-api, to reduce
number of crates.

Signed-off-by: Jiang Liu <[email protected]>
@anolis-bot
Copy link
Collaborator

@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

@anolis-bot
Copy link
Collaborator

@jiangliu , The CI test is completed, please check result:

Test CaseTest Result
build rust golang image✅ SUCCESS
compile nydusd❌ FAIL

Sorry, your test job failed. Please get the details in the link.

@anolis-bot
Copy link
Collaborator

@jiangliu , The CI test is completed, please check result:

Test CaseTest Result
build rust golang image✅ SUCCESS
compile nydusd✅ SUCCESS
compile ctr remote✅ SUCCESS
compile nydus snapshotter✅ SUCCESS
run container with rafs✅ SUCCESS
run container with zran✅ SUCCESS
run container with rafs and compile linux✅ SUCCESS

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"));
Copy link
Collaborator

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!?

Copy link
Collaborator Author

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)

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK, I get it.

@liubogithub liubogithub merged commit 8517120 into dragonflyoss:master May 25, 2023
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.

3 participants