Those are not completely build-time since we ship source code. We
do need those dependencies to do builds afterwards.
Also use private members to not copy lists.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
cargo package -l lists Cargo.toml.orig and we're installing it anyway,
so let's just do mv -f instead of doing new install.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Imagine, that:
* A requires 0.6.0 <= X < 0.7.0
* B requires 0.9.0 <= X < 0.10.0
* C requires A and B
If we use Requires + Conflicts, then we just can't build or install
C, because sub-dependencies are conflicting between each other.
Proper syntax is: (X >= 0.6.0 with X < 0.7.0)
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
All background written in upstream cargo GitHub issue[0].
In short, cargo build/install enforces us to have all dev-dependencies
even they are not used for building/installed.
[0] https://github.com/rust-lang/cargo/issues/3732
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
We need to know things like name of package in order to create
properly named spec file.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
New cargo exposes description, so we can even generate summary out
of it.
We will need to do some pre-processing in future, but good enough for
the beginning.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
We definitely don't need it for our packaging, but if we include
%build section, then RPM assumes that it should generate debuginfo.
Seems like hack, yes.
Signed-off-by: Josh Stone <jistone@redhat.com>
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
So far we had %cargo_install (for binaries) and %cargo_install_crate
(for libraries) which is a bit awkward and requires us to put
additional arguments for latter one.
We can do all the magic behind the scene.
Closes: https://pagure.io/fedora-rust/rust2rpm/issue/7
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Before:
real 0m4.807s
user 0m3.817s
sys 0m0.920s
After:
real 0m1.236s
user 0m1.011s
sys 0m0.222s
Multiply by number of testcases we didn't implement yet and by
python versions we want to test on.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
With zipapp we bundle all our sources into one file and don't care.
Since we use common files from both, it's easier for us.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Subprocesses are slow and we have to pass too many different parameters
for rendering. It's better to pass just metadata object and use Python
interface.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
Traceback (most recent call last):
File "/home/brain/Projects/upstream/rust2rpm/cargodeps.py", line 140, in <module>
md = Metadata(f)
File "/home/brain/Projects/upstream/rust2rpm/cargodeps.py", line 43, in __init__
self._parse_metadata(json.loads(metadata))
File "/home/brain/Projects/upstream/rust2rpm/cargodeps.py", line 92, in _parse_metadata
self._provides = [Dependency(name, version)]
NameError: name 'name' is not defined
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
We can't reliably get mappings between requires and conflicts, so
just split the out to not confuse people.
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>