mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-01 07:38:46 +00:00
Fix build failures when cmake never used
FISH_BUILD_DIR (nominally, ./build) is created by cmake. If you only check out the project via git and then run `cargo build`, this directory won't exist and many of the tests will fail.
This commit is contained in:
parent
72259f658f
commit
a99a7e65e7
1 changed files with 3 additions and 0 deletions
|
@ -65,6 +65,9 @@ pub mod prelude {
|
||||||
pub fn test_init() -> impl ScopeGuarding<Target = ()> {
|
pub fn test_init() -> impl ScopeGuarding<Target = ()> {
|
||||||
static DONE: OnceCell<()> = OnceCell::new();
|
static DONE: OnceCell<()> = OnceCell::new();
|
||||||
DONE.get_or_init(|| {
|
DONE.get_or_init(|| {
|
||||||
|
// If we are building with `cargo build` and have build w/ `cmake`, FISH_BUILD_DIR might
|
||||||
|
// not yet exist.
|
||||||
|
std::fs::create_dir_all(env!("FISH_BUILD_DIR")).unwrap();
|
||||||
set_current_dir(env!("FISH_BUILD_DIR")).unwrap();
|
set_current_dir(env!("FISH_BUILD_DIR")).unwrap();
|
||||||
{
|
{
|
||||||
let s = CString::new("").unwrap();
|
let s = CString::new("").unwrap();
|
||||||
|
|
Loading…
Reference in a new issue