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

Unusable with workspaces #7

Open
Kixunil opened this issue Jun 9, 2017 · 5 comments
Open

Unusable with workspaces #7

Kixunil opened this issue Jun 9, 2017 · 5 comments

Comments

@Kixunil
Copy link

Kixunil commented Jun 9, 2017

I'm using macOS 10.12.

$ cargo local-registry --sync Cargo.lock somewhere/local-registry
error: failed to sync

Caused by:
  workspace member `/.../lib/my_lib/Cargo.toml` is not hierarchically below the workspace root `/.../foo/my_workspace/Cargo.toml`

According to several issues on Github this should be fixed in newer version? Unfortunately:

$ export OPENSSL_DIR=~/homebrew/Cellar/openssl/1.0.2l/
$ cargo install -f cargo-local-registry
   Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing cargo-local-registry v0.1.3
   Compiling log v0.3.8
...
   Compiling git2-curl v0.7.0
   Compiling cargo v0.18.0
   Compiling cargo-local-registry v0.1.3
error: linking with `cc` failed: exit code: 1
... Huge message here...
  = note: Undefined symbols for architecture x86_64:
            "_libiconv", referenced from:
                _git_path_iconv in liblibgit2_sys-043a5a2e7e841ad4.rlib(path.c.o)
            "_libiconv_open", referenced from:
                _git_path_direach in liblibgit2_sys-043a5a2e7e841ad4.rlib(path.c.o)
                _git_path_iconv_init_precompose in liblibgit2_sys-043a5a2e7e841ad4.rlib(path.c.o)
                _git_path_diriter_init in liblibgit2_sys-043a5a2e7e841ad4.rlib(path.c.o)
            "_libiconv_close", referenced from:
                _git_path_direach in liblibgit2_sys-043a5a2e7e841ad4.rlib(path.c.o)
                _git_path_iconv_clear in liblibgit2_sys-043a5a2e7e841ad4.rlib(path.c.o)
                _git_path_diriter_free in liblibgit2_sys-043a5a2e7e841ad4.rlib(path.c.o)
                _git_path_dirload in liblibgit2_sys-043a5a2e7e841ad4.rlib(path.c.o)
          ld: symbol(s) not found for architecture x86_64
          clang: error: linker command failed with exit code 1 (use -v to see invocation)

I tried to invoke that command manually with added -L ~/homebrew/Cellar/libiconv/1.15/lib/ argument. It compiled but after copying to ~.cargo/bin/cargo-local-registry this happens:

$ cargo local-registry --sync Cargo.lock somewhere/local-registry
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to sync

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

To learn more, run the command again with --verbose.
$ cargo local-registry --verbose --sync Cargo.lock .somewhere/local-registry
    Updating registry `https://github.com/rust-lang/crates.io-index`
error: failed to sync

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

To learn more, run the command again with --verbose.

Any idea how to solve this?

@alexcrichton
Copy link
Collaborator

Thanks for the report! (Sorry for the delay looking into this)

It looks like there's 2 issues here, right? Something with workspaces and something with building this crate itself? Is that right? If so, can you provide a way to reproduce the first?

@Kixunil
Copy link
Author

Kixunil commented Jun 16, 2017

I'm not sure now. I built it quite long ago. When looking for solution I found this issue. I suspect that since it was fixed then, it might be fixed in the newest version. So I decided to re-install cargo-local-repository and failed.

I'd try to install the newest version first, to know whether it was fixed.

I just ran cargo install cargo-local-registry. It complained about SSL library, so I did export OPENSSL_DIR=~/homebrew/Cellar/openssl/1.0.2l/, as I mentioned above.

Regarding the workspace, I set up a simple workspace with single bin project in it. It depends on library outside the workspace.

The tree looks like this:

/
+- lib/
    +- my_rust_lib/
        +- Cargo.toml
        +- ...
+- bins/
    +- my_workspace/
        +- Cargo.toml
        +- my_bin/
            +- Cargo.toml
            +- src/

In Cargo.toml of my_bin:

[dependencies]
my_rust_lib = { path = "../../../lib/my_rust_lib" }

When trying to build my_bin, it fails.

@alexcrichton
Copy link
Collaborator

Is this specific to cargo-local-registry? That just looks like a standard misconfigured workspace

@Kixunil
Copy link
Author

Kixunil commented Jun 30, 2017

Sorry for replying late, I had other things at work.

That just looks like a standard misconfigured workspace

Well, compilation works fine. Which setting could cause cargo-local-registry fail but wouldn't break compilation?

@alexcrichton
Copy link
Collaborator

Maybe different versions of the cargo support library? I'm not sure.

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