Skip to content
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

Build script can no longer initialize git submodules #1248

Closed
oakes opened this issue Jan 29, 2015 · 1 comment · Fixed by #1250
Closed

Build script can no longer initialize git submodules #1248

oakes opened this issue Jan 29, 2015 · 1 comment · Fixed by #1250

Comments

@oakes
Copy link

oakes commented Jan 29, 2015

I have a submodule in my project, and for my users' convenience I made the build script automatically initialize it like this:

let curr_dir = Path::new(os::getenv("CARGO_MANIFEST_DIR").unwrap());
Command::new("git").arg("submodule").arg("update").arg("--init").cwd(&curr_dir).status().unwrap();

This no longer works. If I try running cargo build in my project without initializing the submodule manually, it just fails with "An unknown error occurred". With the --verbose flag, it complains that it "Failed to resolve path '/my/submodule/path/.git': No such file or directory".

This error occurs even if the build script is empty! It seems like Cargo is trying to do something with git submodules before the build script even runs. Was this a recent change, and is there a workaround I can use? Requiring users to manually init my submodule would be very inelegant.

@oakes oakes changed the title Build script can no longer update git submodules Build script can no longer initialize git submodules Jan 29, 2015
alexcrichton added a commit to alexcrichton/cargo that referenced this issue Jan 29, 2015
When probing a repository for files that should be considered as inputs for a
build script we should just skip submodules that haven't been checked out
instead of throwing an error.

Closes rust-lang#1248
@alexcrichton
Copy link
Member

Oops, I think this is definitely a bug! Fixed in #1250

bors added a commit that referenced this issue Jan 30, 2015
When probing a repository for files that should be considered as inputs for a
build script we should just skip submodules that haven't been checked out
instead of throwing an error.

Closes #1248
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants