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

When a schema is in a subdirectory generate fails to create output directory #35

Closed
griff opened this issue Mar 18, 2017 · 2 comments
Closed

Comments

@griff
Copy link

griff commented Mar 18, 2017

When a capnp file is in a directory the generator does not correctly create the subdirectory in OUT.

In short this will fail:

extern crate capnpc;

fn main() {
    ::capnpc::CompilerCommand::new()
        .file("schema/process.capnp")
        .run()
        .expect("compiling");
}

The reason it fails is that the code in codegen.rs creates the directory $PWD/schema instead of the correct $OUT/schema.

@griff griff changed the title Schemas in directories fail to create output directory When a schema is in a subdirectory generate fails to create output directory Mar 18, 2017
@dwrensha
Copy link
Member

Confirmed that there is a bug here.

Until this gets fixed, I recommend adding a .src_prefix() line, like this:

   ::capnpc::CompilerCommand::new()
        .file("schema/process.capnp")
        .src_prefix("schema")
        .run()
        .expect("compiling");

Then the generated files go directly into $OUT_DIR.

@dwrensha
Copy link
Member

Fixed in c692b5a.

Thanks for the report!

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

No branches or pull requests

2 participants