!7 merge master into master

link-cplusplus升级1.0.12

Created-by: wangmengOnlineCode
Commit-by: wangmeng
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)



### 二、建议测试周期和提测地址  
  建议测试完成时间:xxxx.xx.xx  
  投产上线时间:xxxx.xx.xx  
  提测地址:CI环境/压测环境  
  测试账号:  

### 三、变更内容
  * 3.1 关联PR列表

  * 3.2 数据库和部署说明  
    1. 常规更新 
    2. 重启unicorn
    3. 重启sidekiq
    4. 迁移任务:是否有迁移任务,没有写 "无"
    5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"

  * 3.4 其他技术优化内容(做了什么,变更了什么)
    - 重构了 xxxx 代码
    - xxxx 算法优化


  * 3.5 废弃通知(什么字段、方法弃用?)



  * 3.6  后向不兼容变更(是否有无法向后兼容的变更?)


  
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
  自测测试结论:


### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
  检查点:

| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx  | 否          | 需要       | 不需要           |
|      |            |          |               |

  接口测试:

  性能测试:

  并发测试:

  其他:



See merge request: openharmony/third_party_rust_link-cplusplus!7
This commit is contained in:
openharmony_ci
2025-11-27 20:23:03 +08:00
10 changed files with 80 additions and 49 deletions
+47 -4
View File
@@ -3,6 +3,7 @@ name: CI
on:
push:
pull_request:
workflow_dispatch:
schedule: [cron: "40 1 * * *"]
permissions:
@@ -12,21 +13,62 @@ env:
RUSTFLAGS: -Dwarnings
jobs:
pre_ci:
uses: dtolnay/.github/.github/workflows/pre_ci.yml@master
test:
name: Rust ${{matrix.rust}} on ${{matrix.os}}
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ${{matrix.os}}-latest
strategy:
fail-fast: false
matrix:
rust: [nightly, beta, stable, 1.34.0]
rust: [nightly, beta, stable, 1.68.0]
os: [ubuntu, macos, windows]
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{matrix.rust}}
- name: Enable type layout randomization
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
if: matrix.rust == 'nightly'
shell: bash
- run: cargo test
- uses: actions/upload-artifact@v4
if: matrix.os == 'ubuntu' && matrix.rust == 'nightly' && always()
with:
name: Cargo.lock
path: Cargo.lock
continue-on-error: true
minimal:
name: Minimal versions
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@nightly
- run: cargo generate-lockfile -Z minimal-versions
- run: cargo check --locked
doc:
name: Documentation
needs: pre_ci
if: needs.pre_ci.outputs.continue
runs-on: ubuntu-latest
timeout-minutes: 45
env:
RUSTDOCFLAGS: -Dwarnings
steps:
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@nightly
- uses: dtolnay/install@cargo-docs-rs
- run: cargo docs-rs
clippy:
name: Clippy
@@ -34,7 +76,7 @@ jobs:
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@clippy
- run: cargo clippy -- -Dclippy::all -Dclippy::pedantic
@@ -44,6 +86,7 @@ jobs:
if: github.event_name != 'pull_request'
timeout-minutes: 45
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/install@cargo-outdated
- run: cargo outdated --workspace --exit-code 1
+1 -1
View File
@@ -1,2 +1,2 @@
/Cargo.lock
/target
/target/
+1 -1
View File
@@ -21,7 +21,7 @@ ohos_cargo_crate("lib") {
sources = [ "src/lib.rs" ]
edition = "2018"
cargo_pkg_version = "1.0.8"
cargo_pkg_version = "1.0.12"
cargo_pkg_authors = "David Tolnay <dtolnay@gmail.com>"
cargo_pkg_name = "link-cplusplus"
cargo_pkg_description = "Link libstdc++ or libc++ automatically or manually"
+10 -4
View File
@@ -1,8 +1,8 @@
[package]
name = "link-cplusplus"
version = "1.0.8"
version = "1.0.12"
authors = ["David Tolnay <dtolnay@gmail.com>"]
categories = ["external-ffi-bindings", "development-tools::ffi", "compilers", "no-std"]
categories = ["external-ffi-bindings", "development-tools::ffi", "compilers", "no-std", "no-std::no-alloc"]
description = "Link libstdc++ or libc++ automatically or manually"
documentation = "https://docs.rs/link-cplusplus"
edition = "2018"
@@ -10,10 +10,10 @@ keywords = ["linkage", "c++"]
license = "MIT OR Apache-2.0"
links = "cplusplus"
repository = "https://github.com/dtolnay/link-cplusplus"
rust-version = "1.34"
rust-version = "1.68"
[build-dependencies]
cc = "1.0"
cc = "1"
[features]
default = [] # automatic
@@ -27,3 +27,9 @@ libcxx = ["libc++"]
[package.metadata.docs.rs]
targets = ["x86_64-unknown-linux-gnu"]
rustdoc-args = [
"--generate-link-to-definition",
"--extern-html-root-url=core=https://doc.rust-lang.org",
"--extern-html-root-url=alloc=https://doc.rust-lang.org",
"--extern-html-root-url=std=https://doc.rust-lang.org",
]
-25
View File
@@ -174,28 +174,3 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed 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.
+1 -1
View File
@@ -3,7 +3,7 @@
"Name": "link-cplusplus",
"License": "Apache License V2.0, MIT",
"License File": "LICENSE-APACHE, LICENSE-MIT",
"Version Number": "1.0.8",
"Version Number": "1.0.12",
"Owner": "fangting12@huawei.com",
"Upstream URL": "https://github.com/dtolnay/link-cplusplus",
"Description": "A Rust library that provides support for linking with C++ code."
+4 -4
View File
@@ -29,18 +29,18 @@ Cargo.toml:
```toml
[dependencies]
link-cplusplus = "1.0"
link-cplusplus = "1"
```
An application that wants a particular one or the other linked should use:
```toml
[dependencies]
link-cplusplus = { version = "1.0", features = ["libstdc++"] }
link-cplusplus = { version = "1", features = ["libstdc++"] }
# or
link-cplusplus = { version = "1.0", features = ["libc++"] }
link-cplusplus = { version = "1", features = ["libc++"] }
```
An application that wants to handle its own more complicated logic for link
@@ -48,7 +48,7 @@ flags from its build script can make this crate do nothing by using:
```toml
[dependencies]
link-cplusplus = { version = "1.0", features = ["nothing"] }
link-cplusplus = { version = "1", features = ["nothing"] }
```
Lastly, make sure to add an explicit `extern crate` dependency to your crate
+7 -5
View File
@@ -1,5 +1,4 @@
use std::env;
use std::fs;
use std::path::PathBuf;
fn main() {
@@ -25,10 +24,13 @@ fn main() {
(false, true) => println!("cargo:rustc-link-lib=c++"),
(false, false) | (true, true) => {
// The platform's default.
let out_dir = env::var_os("OUT_DIR").expect("missing OUT_DIR");
let path = PathBuf::from(out_dir).join("dummy.cc");
fs::write(&path, "int rust_link_cplusplus;\n").unwrap();
cc::Build::new().cpp(true).file(&path).compile("link-cplusplus");
let manifest_dir =
env::var_os("CARGO_MANIFEST_DIR").expect("missing CARGO_MANIFEST_DIR");
let path = PathBuf::from(manifest_dir).join("src").join("dummy.cc");
cc::Build::new()
.cpp(true)
.file(&path)
.compile("link-cplusplus");
}
}
}
+5
View File
@@ -0,0 +1,5 @@
#ifdef __clang__
#pragma clang diagnostic ignored "-Wmissing-variable-declarations"
#endif
int rust_link_cplusplus;
+4 -4
View File
@@ -31,18 +31,18 @@
//!
//! ```toml
//! [dependencies]
//! link-cplusplus = "1.0"
//! link-cplusplus = "1"
//! ```
//!
//! An application that wants a particular one or the other linked should use:
//!
//! ```toml
//! [dependencies]
//! link-cplusplus = { version = "1.0", features = ["libstdc++"] }
//! link-cplusplus = { version = "1", features = ["libstdc++"] }
//!
//! # or
//!
//! link-cplusplus = { version = "1.0", features = ["libc++"] }
//! link-cplusplus = { version = "1", features = ["libc++"] }
//! ```
//!
//! An application that wants to handle its own more complicated logic for link
@@ -50,7 +50,7 @@
//!
//! ```toml
//! [dependencies]
//! link-cplusplus = { version = "1.0", features = ["nothing"] }
//! link-cplusplus = { version = "1", features = ["nothing"] }
//! ```
//!
//! Lastly, make sure to add an explicit `extern crate` dependency to your crate