215 Commits

Author SHA1 Message Date
openharmony_ci d9e5aceb1d !3 merge master into master
io-lifetimes新增bundle.json部件化

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

https://gitcode.com/openharmony/third_party_rust_autocfg/issues/3

### 二、建议测试周期和提测地址  
  建议测试完成时间: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_io-lifetimes!3
OpenHarmony-v6.1-Release OpenHarmony-v7.0-Beta1
2025-12-31 22:05:31 +08:00
ljy9810 d72d16297e io-lifetimes新增bundle.json部件化
Signed-off-by: ljy9810 <longjianyin@h-partners.com>
2025-12-24 09:21:36 +08:00
openharmony_ci 8fb0c4c737 !2 cxx and bindgen
Merge pull request !2 from xxlight/dev_check
OpenHarmony-v6.0.0.1-Release OpenHarmony-v6.0-Release OpenHarmony-v6.0-Beta1 OpenHarmony-v4.1.4-Release OpenHarmony-v5.1.0-Release OpenHarmony-v5.0.3-Release OpenHarmony-v4.1.3-Release OpenHarmony-v5.0.2-Release OpenHarmony-v4.1.2-Release OpenHarmony-v5.0.1-Release OpenHarmony-v4.0.4-Release OpenHarmony-v5.0.0-Release OpenHarmony-v4.0.3-Release OpenHarmony-v4.0.2-Release OpenHarmony-v5.0-Beta1 OpenHarmony-v4.0-Beta1 OpenHarmony-v4.0-Beta2 OpenHarmony-v4.0-Release OpenHarmony-v4.0.1-Release OpenHarmony-v4.1-Beta1 OpenHarmony-v4.1-Release OpenHarmony-v4.1.1-Release master-v weekly_20240115-v OpenHarmony-v6.0.0.2-Release
2023-05-09 06:06:05 +00:00
xxlight ab91dd1b58 cxx and bindgen tests
Issue: https://gitee.com/openharmony/build/issues/I71BD7
Signed-off-by: xxlight <xiaoxiaoliang2@huawei.com>
Change-Id: I4bd46363896c4d65706da58153c5d3fe3fa650be
2023-05-08 22:11:40 +08:00
openharmony_ci 1212b0d9f7 !1 Add OAT.xml and README.OpenSource
Merge pull request !1 from fangting/master
2023-04-14 08:11:16 +00:00
fangting f6fb4e4f79 Add OAT.xml and README.OpenSource
Signed-off-by: fangting <fangting12@huawei.com>
2023-04-14 14:14:53 +08:00
Dan Gohman 14d37d33b5 chore: Release io-lifetimes version 1.0.5 github.com/sunfishcode/io-lifetimes/v1.0.5 2023-02-01 15:56:20 -08:00
Alphyr d559f73826 Update windows-sys to 0.45 (#59) 2023-02-01 15:54:11 -08:00
Dan Gohman a2ca8f4dfd Sync with rustix' build.rs changes (#58)
io-lifetimes and rustix and a few other crates I maintain have similar
build.rs scripts. Port some of the changes from rustix to io-lifetimes
to keep them in sync.

 - Add `#![allow(stable_features)]` to the `has_feature` code to allow
   it to detect features that have gotten stablized.
 - Redirect feature-detection stderr to null, as it's confusing.
 - Rename `test_program` to `can_compile`.
2023-01-12 10:44:27 -08:00
Christian Meissl 5c0d3d3260 fix cross compilation with custom sysroot (#57)
compiling rust programs in yocto uses a custom
target triple with a custom sysroot
not specifying the sysroot when executing rustc
can lead to errors like "can't find crate for `std`"
this patch forwards the sysroot for testing features
2023-01-12 10:24:32 -08:00
Dan Gohman aec3f3ce95 Remove the CI tests for io_lifetimes_use_std mode. (#56)
This mode is now on by default on Rust >= 1.63, and off on Rust < 1.63,
so we don't need a separate CI test rule for it now.
2022-11-28 08:35:41 -08:00
Dan Gohman aa2d7be58b chore: Release io-lifetimes version 1.0.3 2022-11-28 06:49:01 -08:00
Dan Gohman e5860e95c9 Disable the contents of this crate on unknown platforms. (#55)
Add `#![cfg(any(unix, windows, target_os = "wasi"))]` to the top-level
lib.rs so that io-lifetimes can appear as a dependency on platforms even
when it doesn't have support for them.
2022-11-28 06:48:19 -08:00
Dan Gohman e4c9cc69c6 chore: Release io-lifetimes version 1.0.2 2022-11-25 10:04:33 -08:00
Dan Gohman de5deb5433 Update documentation which referred to nightly Rust.
FFI features work on Rust >= 1.63 where io_safety is stabilized.
2022-11-25 10:03:55 -08:00
Dan Gohman e296b6236d Remove use of rustc_attrs, which is no longer needed. (#53)
* Remove use of `rustc_attrs`, which is no longer needed.

This io-lifetimes crate no longer needs this rustc_attrs code. On Rust
versions where io_safety is stabilized, we use the version in std (which
uses rustc_attrs internally). On Rust versions where it's not, rustc_attrs
isn't available to user code anyway, since it's not a stable language
feature.

This might fix #51.

* Rename `io_lifetimes_use_std` to `io_safety_is_in_std`.

This may also help fix #51.
2022-11-25 10:01:14 -08:00
Dan Gohman bacb6a6f58 Update to actions/checkout@v3. 2022-11-15 10:29:59 -08:00
Dan Gohman 6505ebd59a chore: Release io-lifetimes version 1.0.1 2022-11-07 23:40:40 -08:00
Dan Gohman e24daddc41 Move the ViewType impls into unconditional code.
Move the ViewType impls into code that is used for both the std and
polyfill configurations.
2022-11-07 23:38:28 -08:00
Dan Gohman 0e2d49ec67 Update the install-rust github action to node16. 2022-11-07 07:57:14 -08:00
Dan Gohman ad02e788f0 chore: Release io-lifetimes version 1.0.0 2022-11-07 07:28:43 -08:00
Dan Gohman f9e9b758bf (cargo-release) version 1.0.0-rc2 2022-10-20 15:09:54 -07:00
Dan Gohman 4cef104011 Work around a bug in std::os::wasi::io. (#47) 2022-10-20 15:08:52 -07:00
messense 9cee01418e Update windows-sys to 0.42.0 (#46) 2022-10-20 14:22:08 -07:00
Dan Gohman ae53cbb299 (cargo-release) version 1.0.0-rc1 2022-08-23 12:19:42 -07:00
Dan Gohman e857b252fc Disable async-std and other dependencies on WASI. (#44)
* Disable async-std and other dependencies on WASI.

Move the async-std, tokio, socket2, and mio dependencies into a
`not(target_os = "wasi")` dependency section. This fixes the problem
that the default features in async-std, which we need, depend on
socket2, which doesn't work on WASI yet.

The tradeoff here is that WASI users won't be able to make use of
io-lifetimes' impls for these third-party crate types. But we are
working to add these traits upstream, which will eventually make
this unnecessary.

* Add testing on Rust 1.48.

* Add an MSRV note to README.md.

* Disable deprecation warnings in impls_std.rs.
2022-08-23 12:18:47 -07:00
Roman Volosatovs db672e5305 fix: use correct traits in wasi tests
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2022-08-22 12:05:59 -07:00
Roman Volosatovs 2523fda89c build: update async-std and disable default features
The `unstable` feature is not required due to dependency update.
Default features are disabled to minimize dependency graph, which is
particularly relevant for `wasm32-wasi` target, since
default `async-std` feature set adds `socket2` dependency, which does
not support `wasm32-wasi`

This change should also massively speed up compilation

Before:
```
io-lifetimes v1.0.0-rc0 (/home/rvolosatovs/src/github.com/sunfishcode/io-lifetimes)
├── async-std v1.12.0
│   ├── async-channel v1.7.1
│   │   ├── concurrent-queue v1.2.4
│   │   │   └── cache-padded v1.2.0
│   │   ├── event-listener v2.5.3
│   │   └── futures-core v0.3.23
│   ├── async-global-executor v2.2.0
│   │   ├── async-channel v1.7.1 (*)
│   │   ├── async-executor v1.4.1
│   │   │   ├── async-task v4.3.0
│   │   │   ├── concurrent-queue v1.2.4 (*)
│   │   │   ├── fastrand v1.8.0
│   │   │   │   └── instant v0.1.12
│   │   │   │       └── cfg-if v1.0.0
│   │   │   ├── futures-lite v1.12.0
│   │   │   │   ├── fastrand v1.8.0 (*)
│   │   │   │   ├── futures-core v0.3.23
│   │   │   │   ├── futures-io v0.3.23
│   │   │   │   ├── memchr v2.5.0
│   │   │   │   ├── parking v2.0.0
│   │   │   │   ├── pin-project-lite v0.2.9
│   │   │   │   └── waker-fn v1.1.0
│   │   │   ├── once_cell v1.13.1
│   │   │   └── slab v0.4.7
│   │   │       [build-dependencies]
│   │   │       └── autocfg v1.1.0
│   │   ├── async-io v1.8.0
│   │   │   ├── concurrent-queue v1.2.4 (*)
│   │   │   ├── futures-lite v1.12.0 (*)
│   │   │   ├── log v0.4.17
│   │   │   │   ├── cfg-if v1.0.0
│   │   │   │   └── value-bag v1.0.0-alpha.9
│   │   │   │       └── ctor v0.1.23 (proc-macro)
│   │   │   │           ├── quote v1.0.21
│   │   │   │           │   └── proc-macro2 v1.0.43
│   │   │   │           │       └── unicode-ident v1.0.3
│   │   │   │           └── syn v1.0.99
│   │   │   │               ├── proc-macro2 v1.0.43 (*)
│   │   │   │               ├── quote v1.0.21 (*)
│   │   │   │               └── unicode-ident v1.0.3
│   │   │   │       [build-dependencies]
│   │   │   │       └── version_check v0.9.4
│   │   │   ├── once_cell v1.13.1
│   │   │   ├── parking v2.0.0
│   │   │   ├── polling v2.3.0
│   │   │   │   ├── cfg-if v1.0.0
│   │   │   │   └── log v0.4.17 (*)
│   │   │   │   [build-dependencies]
│   │   │   │   └── autocfg v1.1.0
│   │   │   ├── slab v0.4.7 (*)
│   │   │   ├── socket2 v0.4.4
│   │   │   └── waker-fn v1.1.0
│   │   │   [build-dependencies]
│   │   │   └── autocfg v1.1.0
│   │   ├── async-lock v2.5.0
│   │   │   └── event-listener v2.5.3
│   │   ├── blocking v1.2.0
│   │   │   ├── async-channel v1.7.1 (*)
│   │   │   ├── async-task v4.3.0
│   │   │   ├── atomic-waker v1.0.0
│   │   │   ├── fastrand v1.8.0 (*)
│   │   │   ├── futures-lite v1.12.0 (*)
│   │   │   └── once_cell v1.13.1
│   │   ├── futures-lite v1.12.0 (*)
│   │   ├── num_cpus v1.13.1
│   │   │   └── libc v0.2.132
│   │   └── once_cell v1.13.1
│   ├── async-io v1.8.0 (*)
│   ├── async-lock v2.5.0 (*)
│   ├── async-process v1.5.0
│   │   ├── cfg-if v1.0.0
│   │   ├── event-listener v2.5.3
│   │   ├── futures-lite v1.12.0 (*)
│   │   └── once_cell v1.13.1
│   │   [build-dependencies]
│   │   └── autocfg v1.1.0
│   ├── crossbeam-utils v0.8.11
│   │   ├── cfg-if v1.0.0
│   │   └── once_cell v1.13.1
│   ├── futures-channel v0.3.23
│   │   └── futures-core v0.3.23
│   ├── futures-core v0.3.23
│   ├── futures-io v0.3.23
│   ├── futures-lite v1.12.0 (*)
│   ├── gloo-timers v0.2.4
│   │   ├── futures-channel v0.3.23 (*)
│   │   ├── futures-core v0.3.23
│   │   ├── js-sys v0.3.59
│   │   │   └── wasm-bindgen v0.2.82
│   │   │       ├── cfg-if v1.0.0
│   │   │       └── wasm-bindgen-macro v0.2.82 (proc-macro)
│   │   │           ├── quote v1.0.21 (*)
│   │   │           └── wasm-bindgen-macro-support v0.2.82
│   │   │               ├── proc-macro2 v1.0.43 (*)
│   │   │               ├── quote v1.0.21 (*)
│   │   │               ├── syn v1.0.99 (*)
│   │   │               ├── wasm-bindgen-backend v0.2.82
│   │   │               │   ├── bumpalo v3.11.0
│   │   │               │   ├── log v0.4.17
│   │   │               │   │   ├── cfg-if v1.0.0
│   │   │               │   │   └── value-bag v1.0.0-alpha.9
│   │   │               │   │       └── ctor v0.1.23 (proc-macro) (*)
│   │   │               │   │       [build-dependencies]
│   │   │               │   │       └── version_check v0.9.4
│   │   │               │   ├── once_cell v1.13.1
│   │   │               │   ├── proc-macro2 v1.0.43 (*)
│   │   │               │   ├── quote v1.0.21 (*)
│   │   │               │   ├── syn v1.0.99 (*)
│   │   │               │   └── wasm-bindgen-shared v0.2.82
│   │   │               └── wasm-bindgen-shared v0.2.82
│   │   └── wasm-bindgen v0.2.82 (*)
│   ├── kv-log-macro v1.0.7
│   │   └── log v0.4.17 (*)
│   ├── log v0.4.17 (*)
│   ├── memchr v2.5.0
│   ├── once_cell v1.13.1
│   ├── pin-project-lite v0.2.9
│   ├── pin-utils v0.1.0
│   ├── slab v0.4.7 (*)
│   └── wasm-bindgen-futures v0.4.32
│       ├── cfg-if v1.0.0
│       ├── js-sys v0.3.59 (*)
│       └── wasm-bindgen v0.2.82 (*)
└── libc v0.2.132
```

After:
```
io-lifetimes v1.0.0-rc0 (/home/rvolosatovs/src/github.com/sunfishcode/io-lifetimes)
├── async-std v1.12.0
└── libc v0.2.132
```

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
2022-08-22 12:00:33 -07:00
Dan Gohman fd298c2b3e (cargo-release) version 1.0.0-rc0 2022-08-16 09:58:11 -07:00
Dan Gohman e3be40297f Update for io_safety being stabilized. (#41)
* Update for io_safety being stabilized.

io_safety is now [stable in Rust 1.63]! This PR updates io-lifetimes to
use the standard library types and traits when available, and use its
own types and traits on older Rust versions.

The traits `FromFd` and `IntoFd` are now marked as deprecated. These are
replaced by `From<OwnedFd>` and `From<...> for OwnedFd` in the standard
library, and users should migrate accordingly.

[stable in Rust 1.63]: https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html#rust-ownership-for-raw-file-descriptorshandles-io-safety

* Disable deprecation warnings for our own uses of `FromFd` and `IntoFd`.

And, migrate the portability types and traits to use `From<OwnedFd>`
and `Into<OwnedFd>`.

* Deprecate the `from_fd` function, rather than the `FromFd` trait.

This allows the `from_into_fd` extension to continue working, for now.
2022-08-16 09:57:55 -07:00
Dan Gohman f4ec4ab59a (cargo-release) version 0.7.3 2022-08-16 09:56:06 -07:00
Dan Gohman f28730b315 Exclude tests and examples from the crates.io package.
This shrinks the generated package size from 44K to 40K.
2022-07-07 07:16:42 -07:00
Dan Gohman 9dc98d417b (cargo-release) version 0.7.2 2022-06-15 20:09:58 -07:00
Dan Gohman e64a86b62a Add a BorrowedFd::try_clone.
And similar for Windows.
2022-06-15 19:47:07 -07:00
Dan Gohman ddfdc605e6 (cargo-release) version 0.7.1 2022-06-07 23:57:15 -07:00
Dan Gohman 3be7846720 Fix a build error on Rust 1.48 on Windows. 2022-06-07 23:56:30 -07:00
Dan Gohman f5ae8c885e (cargo-release) version 0.7.0 2022-06-06 09:48:41 -07:00
Dan Gohman 6710aec49e Add From<OwnedFd> and From<T> for OwnedFd impls.
The std implementation uses `From` impls instead of `FromFd`/`IntoFd`.
io-lifetimes continues to support `FromFd`/`IntoFd` so that it can add
impls for third-party types. But for users who don't need that, add
the same `From` impls that std has.
2022-06-06 09:46:48 -07:00
Dan Gohman 4680168614 Make drop functions which are usually no-ops inline. 2022-06-06 09:13:36 -07:00
Dan Gohman e85cd57401 Remove obsolete TODOs. 2022-06-06 09:13:20 -07:00
Dan Gohman d2def642c8 Remove sunfishcode.online docs. 2022-06-06 09:13:09 -07:00
Dan Gohman 3ef7c07b89 (cargo-release) version 0.7.0-beta.0 2022-05-27 13:11:00 -07:00
Dan Gohman 7a6eb292e5 Make views require dedicated unsafe marker traits. (#32)
* Make views require dedicated `unsafe` marker traits.

Requiring `Into` and `From` conversions is not sufficient for
`FilelikeView` and `SocketlikeView`, becuase there's no guarantee
that the `Into` implementation will return the same handle as the `From`
implementation. If a type allows its handle to be reassigned, that
can lead to the old handle being freed twice, and the new handle being
leaked.

To fix this, introduce unsafe marker traits `FilelikeViewType` and
`SocketlikeViewType`, and have `FilelikeView` and `SocketlikeView`
require these traits.

* Fix io_lifetimes_use_std compilation.

* Remove the `DerefMut` from the view types.

* Add API tests for the `&*` idiom for using `Read` and `Write`.

* Add a debug check for views checking that they return the same handle.

* Use `ManuallyDrop` to avoid needing `Option` in the view types.

`ManuallyDrop::take` allows the view types to properly consume their temporary
objects without needing an `.unwrap()`.
2022-05-27 09:58:41 -07:00
Dan Gohman a9d3d3764d (cargo-release) version 0.7.0-alpha.1 2022-05-21 09:08:54 -07:00
Dan Gohman 3d0daf0334 Avoid depending on panic in const fn, to fix compilaton on Rust <= 1.56. 2022-05-21 09:06:39 -07:00
Dan Gohman 7df75af6e0 (cargo-release) version 0.7.0-alpha.0 2022-05-21 08:18:00 -07:00
Dan Gohman 6ba6e534af Clarify what values BorrowedHandle, OwnedHandle etc. can hold. (#30)
* Clarify what values BorrowedHandle, OwnedHandle etc. can hold.

This ports the documentation updates from rust-lang/rust#96932.

* Relax the wording about the meaning of -1.
2022-05-13 07:10:58 -07:00
Dan Gohman e3e2a0138d Add more niche-optimization tests.
This ports in the new tests added in rust-lang/rust#96947.
2022-05-11 10:07:07 -07:00
Dan Gohman 5244a3880f Make BorrowedFd::borrow_raw a const fn.
This corresponds to rust-lang/rust#96232.

Also, update the documentation and remove the assert from
`BorrowedHandle::borrow_raw` to match what's in std: `BorrowedHandle`
can hold NULL pointers.
2022-05-10 14:01:06 -07:00
Dan Gohman 0acbd122de Define dedicated error types for HandleOrNull and HandleOrInvalid
Introduce the `InvalidHandleError` and `NullHandleError` error types,
corresponding to rust-lang/rust#95387.
2022-04-29 07:00:00 -07:00