Existence of generated API headers aren't checked at building time

17 views
Skip to first unread message

Sonkun

unread,
Apr 19, 2013, 12:32:04 PM4/19/13
to cython...@googlegroups.com
Hello,

I rewrote the ext_build command of Cython to deal with these generated API headers. I want them to be generated and installed in a given location but this isn't my issue. I noticed if the .cpp file still exists, the cytonization process is skipped and so won't generate these headers while it should, to regenerate these missing headers.

If I'm right until here:
  1. Can I write a patch or you prefer to handle it ?
  2. How would you retrieve this information from a .pxd file, any idea better than re-parsing the file to check for api/extern keywords ?
PS: A while ago, I asked for adding an option to Cython to make it generate API headers in a given location, it was approved by Stephan Benhel. Is the idea accepted ? Can I take care of this ? How would you name this option ?

Cheers,
Jonathan.

Stefan Behnel

unread,
Apr 19, 2013, 1:05:56 PM4/19/13
to cython...@googlegroups.com
Sonkun, 19.04.2013 18:32:
> I rewrote the ext_build command of Cython to deal with these generated API
> headers. I want them to be generated and installed in a given location but
> this isn't my issue.

I assume you are referring to the xyz_api.h files that the "api" modifier
triggers.


> I noticed if the .cpp file still exists, the
> cytonization process is skipped and so won't generate these headers while
> it should, to regenerate these missing headers.

That sounds like a bug to me.


> If I'm right until here:
>
> 1. Can I write a patch or you prefer to handle it ?

This is an open source project. Please do.


> 2. How would you retrieve this information from a .pxd file

You can't. But you can use cythonize(), which parses for dependencies. Not
sure if it can figure out if an api header file needs to be generated. That
feature would have to be added then.


> any idea better than re-parsing the file to check for api/extern keywords ?

No. If any of the output files is outdated, the compiler must be run to
regenerate everything.


> PS: A while ago, I asked for adding an option to Cython to make it generate
> API headers in a given location, it was approved by Stephan Benhel. Is the
> idea accepted ?

No idea who that guy is, but I'd still approve it.


> Can I take care of this ?

What makes you think you have to ask?


> How would you name this option ?

Something like "api_output_dir" might work. "header_output_dir" sounds both
too generic and too specific, given that we might also put .pxd files there.

As usual, a pet name might be a more future proof option, but I think that
"api_output_dir" should work ok for now.

Stefan

Jonathan De Wachter

unread,
Apr 19, 2013, 1:39:20 PM4/19/13
to cython...@googlegroups.com
I'm referring to both xyz.h and xyz_api.h files.

I prefer to ask before because some project author might dislike people who rush on writing a patch to provide unwanted features. It also helps prevent two people from working on the same issue as it implies "I'll do it" :p But thanks, I'd be glad to contribute! :)

I'll check the source files and tell you if that's a bug or something missing.


--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Reply all
Reply to author
Forward
0 new messages