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

Restructure repository to contain the rc crate as well #39

Merged
merged 2 commits into from
Aug 30, 2018

Conversation

mitsuhiko
Copy link
Contributor

@mitsuhiko mitsuhiko commented Aug 18, 2018

This changes the way the two crates are built so that it works for both released versions as well as git dependencies to the repository directly for both im and im-rc. Additionally it tests against the release versions of the crates, fixes the doctests referring to the wrong crate for the rc version and parallelizes the travis tests.

@mitsuhiko
Copy link
Contributor Author

mitsuhiko commented Aug 18, 2018

I initially tried symlinks but that runs into rust-lang/cargo#2748 :(

@bodil bodil force-pushed the master branch 3 times, most recently from 382ce02 to 4659203 Compare August 18, 2018 17:00
@mitsuhiko
Copy link
Contributor Author

mitsuhiko commented Aug 19, 2018

The way this is structured now is a bit odd but it has reasons.

Inside the rc folder there is a single Cargo.toml which is more or less a copy of the one from the toplevel Cargo.toml just that it refers to all other files (readme, build, crate) by going up a folder. This means that if one adds a git dependency the im-rc crate can be found. This crate however cannot be published because it refers to files outside of its local tree.

For publishing the build-releases.sh file is provided. If run with ./build-releases.sh it just puts the final crates into the dist/$VERSION folder (as im and im-rc respectively). When run with an optional argument it also changes the version number. Separately ./set-version.sh exists which just bumps the version in the two cargo toml files. (I use perl for this because sed is not standardized enough and different on different platforms. The original commands did not work on mac for instance).

The tests in travis run against the built versions. This is done because extern crate im refers to the wrong one and the release versions run a replace for im to im_rc for the rc variation.

This now means that tests run agains the actual release versions and that includes the doctests. If one wants to use a git dependency (like I wanted) then this also works.

@mitsuhiko mitsuhiko force-pushed the feature/in-repo-rc branch 2 times, most recently from a4bfe31 to 84ca9ed Compare August 19, 2018 16:41
@bodil
Copy link
Owner

bodil commented Aug 20, 2018

Thanks, I think I could probably live with this - let me just try it out for a bit before merging and see if I run into any rough edges.

@bodil
Copy link
Owner

bodil commented Aug 23, 2018

One thing I'm not happy about is that if I change dependencies in Cargo.toml, I now also have to make sure I change them in rc/Cargo.toml, but without some sort of #include statement in the TOML syntax I'm not sure there's any obvious way around that. 😕

@mitsuhiko
Copy link
Contributor Author

@bodil I could add a Cargo.toml.in file and then a script to generate Cargo.toml and rc/Cargo.toml out of that template. That way at least the process is automated.

@mitsuhiko
Copy link
Contributor Author

mitsuhiko commented Aug 23, 2018

@bodil I pushed up a version that uses m4 to generate out toml files. Not the most modern thing but pretty straightforward. This also adds a Makefile. make release should do the whole shebang, whereas make update-toml just updates the Cargo.toml and rc/Cargo.toml based on the Cargo.toml.in file. The version to feed into the toml file comes from the VERSION file.

@bodil
Copy link
Owner

bodil commented Aug 30, 2018

uuuugh, I'm not keen on adding those dependencies even outside of the build phase. I'll just merge this - seems to work well - but I think I'm likely to rewrite the makefile stuff in Rust...

@bodil bodil merged commit bf7b21a into bodil:master Aug 30, 2018
@bodil
Copy link
Owner

bodil commented Aug 30, 2018

Thanks. 👍

@mitsuhiko
Copy link
Contributor Author

@bodil fwiw i picked m4 and perl because they are everywhere :)

@mitsuhiko mitsuhiko deleted the feature/in-repo-rc branch August 30, 2018 12:53
@bodil
Copy link
Owner

bodil commented Aug 30, 2018

I just tagged a new release, make release appears to work. 😄 https://crates.io/crates/im-rc

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

Successfully merging this pull request may close these issues.

2 participants