I ended up adding a no-op "configs" implementation in
cadencemarseille/rust-pcre@59beca8<https://github.com/cadencemarseille/rust-pcre/commit/59beca88def89c52d3430fc94d12195e97fdd8cf>.
Looking through the rustpkg.rs source, I think that the intent of the
"configs" command is generate "cfgs" (a la --cfg options passed to rustc)
when compiling Rust code using the crate, similar to the config.h header
file that is generated by the configure script and which contains all of
the HAVE_* macros? Is this correct?
One thing that would be neat is if there were a tool similar to Autoconf
that could automatically generate the package script. I am actually
considering working on such a tool, perhaps called Autopkg. In order to do
this, one very useful rustpkg::api function would be a way to build a
library with a list of configs. Currently in rust-pcre's package script
for example, I use the api::build_lib() function:
api::build_lib(sysroot_path, workspace_path, ~"pcre",
rustpkg::version::ExactRevision(~"0.1"), Path("mod.rs"));
If I could pass a config to signify whether the system's libpcre has the
pcre_free_study() function, then I could tailor the wrapper to libpcre
versions older than 8.20 using #[cfg(have_pcre_free_study)]. In the
current system, a package script would have to generate all Rust files
having such #[cfg(...)] lines and basically do what rustc does.
On Sun, Oct 6, 2013 at 1:57 PM, Cadence Marseille <
[email protected]> wrote:
> Hello,
>
> To fix issue #1 of
> rust-pcre<https://github.com/cadencemarseille/rust-pcre/issues/1>,
> I am working on a package script that will automatically determine the
> proper link_args to use and build the rust-pcre wrapper using those link
> args.
>
> For a while I was encountering the following error:
> task <unnamed> failed at 'called `Result::unwrap()` on `Err` value: error
> opening /usr/local/rustpkg_db.json: Permission denied',
> /private/tmp/-DSIK/rust-0.8/src/libstd/result.rs:109
> Command return code = 101
> task <unnamed> failed at 'Error running custom build command',
> /private/tmp/-DSIK/rust-0.8/src/librustpkg/rustpkg.rs:410
>
> but I am working around this issue by copying a rustpkg_db.json file to
> /usr/local.
>
> I believe that I have a working "install" command implementation:
> https://github.com/cadencemarseille/rust-pcre/blob/master/src/pcre/pkg.rs
> However, rustpkg is still failing with:
> Running program (configs):
> /Users/cadencemarseille/Projects/rust-pcre/build/x86_64-apple-darwin/pcre/pkg
> /usr/local configs
> Command return code = 101
> task <unnamed> failed at 'Error running custom build command',
> /private/tmp/-DSIK/rust-0.8/src/librustpkg/rustpkg.rs:410
>
> I think that I now need to write a "configs" command, but I don't know
> what this is supposed to do.
>
> What do I need to do for "configs"?
>
> Cadence
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev