Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

是否考虑将此crate与axconfig解耦? #8

@dbydd

Description

@dbydd

举个例子,这是通过cargo tree导出的spinlock的依赖:

├── spinlock v0.1.0 (https://github.com/Starry-OS/spinlock.git#0149e52d)
│   ├── cfg-if v1.0.0
│   └── kernel_guard v0.1.0 (https://github.com/Starry-OS/kernel_guard.git#72e00672)
│       ├── cfg-if v1.0.0
│       └── taskctx v0.1.0 (https://github.com/Starry-OS/taskctx.git#3c3ad2fb)
│           ├── axconfig v0.1.0 (https://github.com/Starry-OS/axconfig.git#d8f8f2d4)

看起来并没有什么问题,除了axconfig编译时需要指定AX_WORK_DIR...

error: environment variable `AX_WORK_DIR` not defined at compile time
 --> /home/dbydd/.cargo/git/checkouts/axconfig-a375f0c4fb0314cc/d8f8f2d/build.rs:6:34
  |
6 |     let root_dir = PathBuf::from(std::env!("AX_WORK_DIR"));
  |                                  ^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = help: use `std::env::var("AX_WORK_DIR")` to read the variable at run time
  = note: this error originates in the macro `std::env` (in Nightly builds, run with -Z macro-backtrace for more info)

error: could not compile `axconfig` (build script) due to 1 previous error

于是编译就炸了!这显然不利于crate复用,因此,是否考虑将axconfig与该crate解耦?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions