Skip to content

Restructure into Standard Rust Project Layout #118

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

Closed
DavePearce opened this issue Apr 10, 2024 · 5 comments
Closed

Restructure into Standard Rust Project Layout #118

DavePearce opened this issue Apr 10, 2024 · 5 comments

Comments

@DavePearce
Copy link
Collaborator

Currently, the project is configured in a slightly unusual fashion which doesn't quite fit the normal project layout. In particular, this makes testing more awkward. Notes:

  • The project does not build a normal lib, which means that tests in the tests/ directory cannot access it as a crate.
  • Almost none of the API is exposed as public, meaning tests in the tests/ directory (and other clients) cannot use the tool.
  • Some modules are only included with the main binary, and not with the library. Its unclear if they are left out for some reason.

These can all be changed relatively easily, though its not clear whether there was any specific reason for structuring like this.

@DavePearce
Copy link
Collaborator Author

DavePearce commented Apr 10, 2024

@delehef Is there anything specific about the way the project is structured to note? For example, you were specifically trying to keep the static / dynamic libraries as small as possible?

@delehef
Copy link
Contributor

delehef commented Apr 10, 2024

Some modules are only included with the main binary, and not with the library. Its unclear if they are left out for some reason.

Because the lib only needs (needed?) what is required to expand traces, feel free to increase the public API surface.

The project does not build a normal lib

What do you mean by a normal lib? It compiles a .so/.dylib for now.

@DavePearce
Copy link
Collaborator Author

I mean we have this in the Cargo.toml file:

[lib]
crate-type = ["cdylib", "staticlib"]

I understand why you have this, but it actually has implications meaning tests in tests/ can't be compiled (which I don't fully understand yet). To resolve that issue, I can include the normal lib crate-type like so:

[lib]
crate-type = ["lib","cdylib", "staticlib"]

Looks like there is an issue for this raised, though unclear whether its actually considered a bug or not.

@DavePearce
Copy link
Collaborator Author

Also, are both cdylib and staticlib needed? I'm assuming one is linked on the Go side, so the other ... is not needed?

@DavePearce
Copy link
Collaborator Author

For now, I think this is not a priority :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants