Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Switch from RUST_TARGET_PATH to passing an absolute path to --target #50

Merged
merged 2 commits into from
Aug 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ cd hello-world
3. Build the static object with cargo xbuild, pointing it at our custom target

```
RUST_TARGET_PATH=$(pwd)/.. cargo xbuild --target x86_64-linux-kernel-module

cargo xbuild --target $(pwd)/../x86_64-linux-kernel-module.json
```

4. Build the kernel module using the Linux kernel build system (kbuild)
Expand Down
7 changes: 5 additions & 2 deletions tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ def main():

print("+ [{}]".format(path))
run(
"cargo", "xbuild", "--target", "x86_64-linux-kernel-module",
"cargo", "xbuild",
"--target",
os.path.join(
BASE_DIR, os.path.pardir, "x86_64-linux-kernel-module.json"
),
cwd=os.path.join(BASE_DIR, path),
environ=dict(
os.environ,
RUST_TARGET_PATH=os.path.join(BASE_DIR, os.path.pardir),
RUSTFLAGS="-Dwarnings",
CARGO_TARGET_DIR=os.path.relpath(
os.path.join(BASE_DIR, "target"),
Expand Down