fastobo / fastobo-py

Faultless AST for Open Biomedical Ontologies in Python.
http://fastobo.readthedocs.io
MIT License
24 stars 4 forks source link

Issue pip installing fastobo (specifically fastobo-graphs) #311

Closed mihirsamdarshi closed 1 year ago

mihirsamdarshi commented 1 year ago

I am on macOS 12.6 (x86_64) and using Python3.10

I already have rustc, but I am using 1.66-nightly.

Perhaps the macro invocation needs ::crate:: in front of it?

Or add a #[macro_export] above the macro?

     Compiling fastobo-graphs v0.3.0
       Running `/usr/local/bin/sccache rustc --crate-name fastobo_graphs --edition=2018 /Users/msamdars/.cargo/registry/src/github.com-1ecc6299db9ec823/fastobo-graphs-0.3.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="fastobo"' --cfg 'feature="mashup"' --cfg 'feature="obo"' -C metadata=b6e87cfe9da4aa65 -C extra-filename=-b6e87cfe9da4aa65 --out-dir /private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps -L dependency=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps --extern err_derive=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/liberr_derive-90d7d323a2fba856.dylib --extern fastobo=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libfastobo-67b48d7a2d770f06.rmeta --extern mashup=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libmashup-8d6d497e1fe25d20.rmeta --extern serde=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libserde-4abdf1ef08c39e1a.rmeta --extern serde_json=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libserde_json-2c41120a5d468e9c.rmeta --extern serde_yaml=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libserde_yaml-c94f899ad84a011d.rmeta --cap-lints allow`
  error: proc-macro derive panicked
    --> /Users/msamdars/.cargo/registry/src/github.com-1ecc6299db9ec823/fastobo-graphs-0.3.0/src/from_graph/entity.rs:82:17
     |
  82 |                 impl_frame_inner!(node, id, ClassIdent, Term)
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: message: assertion failed: source.starts_with(prefix)
     = note: this error originates in the macro `mashup_macro` which comes from the expansion of the macro `impl_frame_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

  error: proc-macro derive panicked
    --> /Users/msamdars/.cargo/registry/src/github.com-1ecc6299db9ec823/fastobo-graphs-0.3.0/src/from_graph/entity.rs:85:17
     |
  85 |                 impl_frame_inner!(node, id, InstanceIdent, Instance)
     |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: message: assertion failed: source.starts_with(prefix)
     = note: this error originates in the macro `mashup_macro` which comes from the expansion of the macro `impl_frame_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

  error: proc-macro derive panicked
    --> /Users/msamdars/.cargo/registry/src/github.com-1ecc6299db9ec823/fastobo-graphs-0.3.0/src/from_graph/entity.rs:89:23
     |
  89 |                 match impl_frame_inner!(node, id, RelationIdent, Typedef) {
     |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
     |
     = help: message: assertion failed: source.starts_with(prefix)
     = note: this error originates in the macro `mashup_macro` which comes from the expansion of the macro `impl_frame_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

  error: cannot find macro `m` in this scope
    --> /Users/msamdars/.cargo/registry/src/github.com-1ecc6299db9ec823/fastobo-graphs-0.3.0/src/from_graph/entity.rs:61:9
     |
  61 |         m! {
     |         ^
  ...
  82 |                 impl_frame_inner!(node, id, ClassIdent, Term)
     |                 --------------------------------------------- in this macro invocation
     |
     = note: this error originates in the macro `impl_frame_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

  error: cannot find macro `m` in this scope
    --> /Users/msamdars/.cargo/registry/src/github.com-1ecc6299db9ec823/fastobo-graphs-0.3.0/src/from_graph/entity.rs:61:9
     |
  61 |         m! {
     |         ^
  ...
  85 |                 impl_frame_inner!(node, id, InstanceIdent, Instance)
     |                 ---------------------------------------------------- in this macro invocation
     |
     = note: this error originates in the macro `impl_frame_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

  error: cannot find macro `m` in this scope
    --> /Users/msamdars/.cargo/registry/src/github.com-1ecc6299db9ec823/fastobo-graphs-0.3.0/src/from_graph/entity.rs:61:9
     |
  61 |         m! {
     |         ^
  ...
  89 |                 match impl_frame_inner!(node, id, RelationIdent, Typedef) {
     |                       --------------------------------------------------- in this macro invocation
     |
     = note: this error originates in the macro `impl_frame_inner` (in Nightly builds, run with -Z macro-backtrace for more info)

  error: could not compile `fastobo-graphs` due to 6 previous errors

  Caused by:
    process didn't exit successfully: `/usr/local/bin/sccache rustc --crate-name fastobo_graphs --edition=2018 /Users/msamdars/.cargo/registry/src/github.com-1ecc6299db9ec823/fastobo-graphs-0.3.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="fastobo"' --cfg 'feature="mashup"' --cfg 'feature="obo"' -C metadata=b6e87cfe9da4aa65 -C extra-filename=-b6e87cfe9da4aa65 --out-dir /private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps -L dependency=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps --extern err_derive=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/liberr_derive-90d7d323a2fba856.dylib --extern fastobo=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libfastobo-67b48d7a2d770f06.rmeta --extern mashup=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libmashup-8d6d497e1fe25d20.rmeta --extern serde=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libserde-4abdf1ef08c39e1a.rmeta --extern serde_json=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libserde_json-2c41120a5d468e9c.rmeta --extern serde_yaml=/private/var/folders/6h/5wpwnt3n70d_3zlpr7vbj3rc0000gn/T/pip-install-c0_bdfp5/fastobo_144ce1c226d74f61b766623c9e7f2f4d/target/release/deps/libserde_yaml-c94f899ad84a011d.rmeta --cap-lints allow` (exit status: 1)
  error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features 'pyo3/extension-module extension-module' -- --crate-type cdylib -C 'link-args=-undefined dynamic_lookup -Wl,-install_name,@rpath/fastobo.cpython-310-darwin.so'` failed with code 101
althonos commented 1 year ago

I was using the mashup crate for this macro anyway, but I think there were compatibility issues at some point. I'll look for replacing it with paste on my next update of the FastOBO crates.

althonos commented 1 year ago

@mihirsamdarshi : What version of fastobo are you trying to install? It looks like you're trying to build version 0.3.0 of fastobo-graphs but in recent fastobo versions this should be 0.4.7, so you may be trying to use an old version.

mihirsamdarshi commented 1 year ago

@althonos sorry for the late response, I am using fastobo 0.8.2 (I think the crate's version is 0.9). Fastobo is a transitive dependency of the pronto package so I am not sure what's going on when I install it.

althonos commented 1 year ago

Can you try installing the latest one (pip install fastobo==0.12.1)? Normally it should still be compatible with pronto but build with the latest nightly.

mihirsamdarshi commented 1 year ago

Huh, that's interesting, it wasn't working correctly when I declare pronto as a dependency in the setup.py script of a library that I am working on, but it works when I install it with pip. It must be an issue on my end.