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

fix: remove unsupport configurations in Cargo.toml #2035

Merged
merged 1 commit into from
Apr 29, 2020

Conversation

yangby-cryptape
Copy link
Collaborator

@yangby-cryptape yangby-cryptape commented Apr 22, 2020

The Issue

Here is a potential issue which was introduced by #1940.

Although I haven't found any evidences now, I still strongly suspect that it was related to our recent memory leak.
After a lot of tests, I think this issue was not related to our recent memory leak. But it's still a bug.

My Solution

I read a lot of issues about cargo in few weeks, I didn't find any official / standard solution to fix it, and I thought they wouldn't fix it in few months. (build.rs can't fix it, too)

So, I use a complex and dirty way to fix it, just review the code, please.

How can I prove my modification was valid?

  • Please check this example, I have run it under Debian Buster and Windows 10.

  • I have build various kinds of CKB with different features and check a lot logs of them under Debian Buster.

A Very Important Note

If any features of a rust bindings (to c library) crate was changed, please do cargo clean before build the project.

Some C libraries wouldn't re-compile by cargo after features changed, for example, jemalloc-sys.

@yangby-cryptape yangby-cryptape requested review from a team and doitian April 22, 2020 08:49
quake
quake previously approved these changes Apr 23, 2020
driftluo
driftluo previously approved these changes Apr 25, 2020
@zhangsoledad
Copy link
Member

bors r=quake, driftluo

bors bot added a commit that referenced this pull request Apr 26, 2020
2035: fix: remove unsupport configurations in Cargo.toml r=quake,driftluo a=yangby-cryptape

### The Issue

Here is a potential issue which was introduced by #1940.

- Since our `rust-toolchain` is still be `1.41.0`, there will be no errors or warnings when we build the project. (This is why #1940 was merged)

  https://github.com/nervosnetwork/ckb/blob/22829ae85db1643480bd810150f9619250aac92e/rust-toolchain#L1

 - But if you update the `rust-toolchain` to `1.42.0`, when you build the whole project (just execute `make prod`), you will get two warnings:

    > warning: ckb/Cargo.toml: Found `feature = ...` in `target.'cfg(...)'.dependencies`. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html
    > warning: ckb/Cargo.toml: Found `feature = ...` in `target.'cfg(...)'.dependencies`. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html

~~Although I haven't found any evidences now, I still strongly suspect that it was related to our recent memory leak.~~
**After a lot of tests, I think this issue was not related to our recent memory leak.** But it's still a bug.

### My Solution

I read a lot of issues about cargo in few weeks, I didn't find any official / standard solution to fix it, and I thought they wouldn't fix it in few months. (`build.rs` can't fix it, too)

So, I use a complex and dirty way to fix it, just review the code, please.

#### How can I prove my modification was valid?

- Please check [this example](https://github.com/yangby-cryptape/rust-features-trials/tree/99455ef/features/example-1), I have run it under Debian Buster and Windows 10.

- I have build various kinds of CKB with different features and check a lot logs of them under Debian Buster.

### A Very Important Note

**If any features of a rust bindings (to c library) crate was changed, please do `cargo clean` before build the project.**

Some C libraries wouldn't re-compile by cargo after features changed, for example, `jemalloc-sys`.

Co-authored-by: Boyu Yang <[email protected]>
@yangby-cryptape
Copy link
Collaborator Author

bors retry

bors bot added a commit that referenced this pull request Apr 26, 2020
2035: fix: remove unsupport configurations in Cargo.toml r=quake,driftluo a=yangby-cryptape

### The Issue

Here is a potential issue which was introduced by #1940.

- Since our `rust-toolchain` is still be `1.41.0`, there will be no errors or warnings when we build the project. (This is why #1940 was merged)

  https://github.com/nervosnetwork/ckb/blob/22829ae85db1643480bd810150f9619250aac92e/rust-toolchain#L1

 - But if you update the `rust-toolchain` to `1.42.0`, when you build the whole project (just execute `make prod`), you will get two warnings:

    > warning: ckb/Cargo.toml: Found `feature = ...` in `target.'cfg(...)'.dependencies`. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html
    > warning: ckb/Cargo.toml: Found `feature = ...` in `target.'cfg(...)'.dependencies`. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html

~~Although I haven't found any evidences now, I still strongly suspect that it was related to our recent memory leak.~~
**After a lot of tests, I think this issue was not related to our recent memory leak.** But it's still a bug.

### My Solution

I read a lot of issues about cargo in few weeks, I didn't find any official / standard solution to fix it, and I thought they wouldn't fix it in few months. (`build.rs` can't fix it, too)

So, I use a complex and dirty way to fix it, just review the code, please.

#### How can I prove my modification was valid?

- Please check [this example](https://github.com/yangby-cryptape/rust-features-trials/tree/99455ef/features/example-1), I have run it under Debian Buster and Windows 10.

- I have build various kinds of CKB with different features and check a lot logs of them under Debian Buster.

### A Very Important Note

**If any features of a rust bindings (to c library) crate was changed, please do `cargo clean` before build the project.**

Some C libraries wouldn't re-compile by cargo after features changed, for example, `jemalloc-sys`.

Co-authored-by: Boyu Yang <[email protected]>
@doitian
Copy link
Member

doitian commented Apr 27, 2020

bors is blocked by CI, see #2044

@doitian
Copy link
Member

doitian commented Apr 27, 2020

bors retry

bors bot added a commit that referenced this pull request Apr 27, 2020
2035: fix: remove unsupport configurations in Cargo.toml r=quake,driftluo a=yangby-cryptape

### The Issue

Here is a potential issue which was introduced by #1940.

- Since our `rust-toolchain` is still be `1.41.0`, there will be no errors or warnings when we build the project. (This is why #1940 was merged)

  https://github.com/nervosnetwork/ckb/blob/22829ae85db1643480bd810150f9619250aac92e/rust-toolchain#L1

 - But if you update the `rust-toolchain` to `1.42.0`, when you build the whole project (just execute `make prod`), you will get two warnings:

    > warning: ckb/Cargo.toml: Found `feature = ...` in `target.'cfg(...)'.dependencies`. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html
    > warning: ckb/Cargo.toml: Found `feature = ...` in `target.'cfg(...)'.dependencies`. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html

~~Although I haven't found any evidences now, I still strongly suspect that it was related to our recent memory leak.~~
**After a lot of tests, I think this issue was not related to our recent memory leak.** But it's still a bug.

### My Solution

I read a lot of issues about cargo in few weeks, I didn't find any official / standard solution to fix it, and I thought they wouldn't fix it in few months. (`build.rs` can't fix it, too)

So, I use a complex and dirty way to fix it, just review the code, please.

#### How can I prove my modification was valid?

- Please check [this example](https://github.com/yangby-cryptape/rust-features-trials/tree/99455ef/features/example-1), I have run it under Debian Buster and Windows 10.

- I have build various kinds of CKB with different features and check a lot logs of them under Debian Buster.

### A Very Important Note

**If any features of a rust bindings (to c library) crate was changed, please do `cargo clean` before build the project.**

Some C libraries wouldn't re-compile by cargo after features changed, for example, `jemalloc-sys`.

Co-authored-by: Boyu Yang <[email protected]>
@bors
Copy link
Contributor

bors bot commented Apr 27, 2020

Build failed:

  • continuous-integration/travis-ci/push

@yangby-cryptape
Copy link
Collaborator Author

bors retry

@doitian
Copy link
Member

doitian commented Apr 27, 2020

Please rebase. I guess the different github actions directory in the two branches block the merge.

@doitian
Copy link
Member

doitian commented Apr 28, 2020

bors r-

@doitian
Copy link
Member

doitian commented Apr 28, 2020

bors r=quake,driftluo

@doitian
Copy link
Member

doitian commented Apr 28, 2020

bors retry

2 similar comments
@doitian
Copy link
Member

doitian commented Apr 28, 2020

bors retry

@doitian
Copy link
Member

doitian commented Apr 28, 2020

bors retry

bors bot added a commit that referenced this pull request Apr 28, 2020
2035: fix: remove unsupport configurations in Cargo.toml r=quake,driftluo a=yangby-cryptape

### The Issue

Here is a potential issue which was introduced by #1940.

- Since our `rust-toolchain` is still be `1.41.0`, there will be no errors or warnings when we build the project. (This is why #1940 was merged)

  https://github.com/nervosnetwork/ckb/blob/22829ae85db1643480bd810150f9619250aac92e/rust-toolchain#L1

 - But if you update the `rust-toolchain` to `1.42.0`, when you build the whole project (just execute `make prod`), you will get two warnings:

    > warning: ckb/Cargo.toml: Found `feature = ...` in `target.'cfg(...)'.dependencies`. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html
    > warning: ckb/Cargo.toml: Found `feature = ...` in `target.'cfg(...)'.dependencies`. This key is not supported for selecting dependencies and will not work as expected. Use the [features] section instead: https://doc.rust-lang.org/cargo/reference/features.html

~~Although I haven't found any evidences now, I still strongly suspect that it was related to our recent memory leak.~~
**After a lot of tests, I think this issue was not related to our recent memory leak.** But it's still a bug.

### My Solution

I read a lot of issues about cargo in few weeks, I didn't find any official / standard solution to fix it, and I thought they wouldn't fix it in few months. (`build.rs` can't fix it, too)

So, I use a complex and dirty way to fix it, just review the code, please.

#### How can I prove my modification was valid?

- Please check [this example](https://github.com/yangby-cryptape/rust-features-trials/tree/99455ef/features/example-1), I have run it under Debian Buster and Windows 10.

- I have build various kinds of CKB with different features and check a lot logs of them under Debian Buster.

### A Very Important Note

**If any features of a rust bindings (to c library) crate was changed, please do `cargo clean` before build the project.**

Some C libraries wouldn't re-compile by cargo after features changed, for example, `jemalloc-sys`.

Co-authored-by: Boyu Yang <[email protected]>
Co-authored-by: ian <[email protected]>
@bors
Copy link
Contributor

bors bot commented Apr 28, 2020

Timed out.

@doitian
Copy link
Member

doitian commented Apr 29, 2020

bors r=doitian,TheWaWaR

@bors
Copy link
Contributor

bors bot commented Apr 29, 2020

Build succeeded:

  • continuous-integration/travis-ci/push

@bors bors bot merged commit c4c4157 into nervosnetwork:develop Apr 29, 2020
@yangby-cryptape yangby-cryptape deleted the pr/fix-cargo-toml branch July 9, 2020 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants