-
Notifications
You must be signed in to change notification settings - Fork 766
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
[pallet-revive] fix fixture build path #6174
Merged
Merged
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b730914
fix fixture build path
pgherveou 3c2740c
restore compile_module
pgherveou 696338e
fix
pgherveou 786d958
Make symlink optional
pgherveou 9cc69d9
check uapi dir exists
pgherveou 9723574
Update from pgherveou running command 'prdoc --audience runtime_dev -…
actions-user b063c61
update
pgherveou d114818
Apply suggestions from code review
pgherveou b82cec8
Update prdoc/pr_6174.prdoc
pgherveou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -183,13 +183,8 @@ mod build { | |
let fixtures_dir: PathBuf = env::var("CARGO_MANIFEST_DIR")?.into(); | ||
let contracts_dir = fixtures_dir.join("contracts"); | ||
let uapi_dir = fixtures_dir.parent().expect("uapi dir exits; qed").join("uapi"); | ||
let ws_dir: PathBuf = env::var("CARGO_WORKSPACE_ROOT_DIR")?.into(); | ||
let out_dir: PathBuf = ws_dir.join("target").join("pallet-revive-fixtures"); | ||
|
||
// create out_dir if it does not exist | ||
if !out_dir.exists() { | ||
fs::create_dir_all(&out_dir)?; | ||
} | ||
let out_dir: PathBuf = env::var("OUT_DIR")?.into(); | ||
|
||
// the fixtures have a dependency on the uapi crate | ||
println!("cargo::rerun-if-changed={}", fixtures_dir.display()); | ||
|
@@ -207,6 +202,17 @@ mod build { | |
invoke_build(tmp_dir_path)?; | ||
|
||
write_output(tmp_dir_path, &out_dir, entries)?; | ||
|
||
#[cfg(unix)] | ||
{ | ||
let symlink_dir: PathBuf = env::var("CARGO_WORKSPACE_ROOT_DIR")?.into(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I thinkk this does only work on our CI? Shouldn't this be something like |
||
let symlink_dir: PathBuf = symlink_dir.join("target").join("pallet-revive-fixtures"); | ||
if symlink_dir.is_symlink() { | ||
fs::remove_file(&symlink_dir)? | ||
} | ||
std::os::unix::fs::symlink(&out_dir, &symlink_dir)?; | ||
} | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also wrong because it expects the uapi crate being co-located with the fixtures dir? Which is not the case when building outside the mono repo.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right added a test to check if the dir exists