[vlc-devel] [PATCHv3 4/7] contrib: add cargo

Marvin Scholz epirat07 at gmail.com
Fri Sep 4 20:35:12 CEST 2020



On 4 Sep 2020, at 17:02, Thomas Guillem wrote:

> Hello,
>
> "$(CARGO) install cargo-c" is failing on lot of CIs, and could 
> possibly fail on dev systems because of a missing libssl-dev (on 
> HOST). Indeed, cargo-c build depends on cargo that depends on 
> libssl-dev.
>
> So, we have 3 solutions:
>
>  - Ask upstream cargo to have a way to build a vendor-only cargo that 
> does not require openssl.
> But I'm not sure if it will be accepted and it won't be available 
> soon.
>
>  - Update all videolan dockers images to install libssl-dev. In that 
> case, we ignore users without ssl-dev and not using docker.
>
>  - Use binaries from the github release page (deployed on each 
> release) https://github.com/lu-zero/cargo-c/releases/tag/v0.6.12 There 
> is one binary for windows, mac and linux. I don't think it is an issue 
> to not compile this tool, this is like download a toolchain, no?

The binary for macOS is built in a way that it assumes openssl is 
installed via homebrew,
which is not the case on my system:

   dyld: Library not loaded: 
/usr/local/opt/openssl at 1.1/lib/libssl.1.1.dylib

So using the binaries is no good solution I think.

>
> Input very welcome,
>
> Best,
> Thomas
>
>
> On Thu, Aug 27, 2020, at 16:44, Thomas Guillem wrote:
>> From: Kartik Ohri <kartikohri13 at gmail.com>
>>
>> This will install rustup, cargo, and cargo-c into contrib/bin/.cargo
>> This installation will be used by default for all rust contrib 
>> builds.
>>
>> The correct cargo target will be automatically installed when needed.
>> ---
>>  contrib/src/cargo/SHA512SUMS |  1 +
>>  contrib/src/cargo/rules.mak  | 26 ++++++++++++++++++++++++++
>>  2 files changed, 27 insertions(+)
>>  create mode 100644 contrib/src/cargo/SHA512SUMS
>>  create mode 100644 contrib/src/cargo/rules.mak
>>
>> diff --git a/contrib/src/cargo/SHA512SUMS 
>> b/contrib/src/cargo/SHA512SUMS
>> new file mode 100644
>> index 00000000000..6101c68ba6c
>> --- /dev/null
>> +++ b/contrib/src/cargo/SHA512SUMS
>> @@ -0,0 +1 @@
>> +14a978a3cf699956722d8443070b9f8a043f1252cc1a7ed300b14637a0e6d654f34088d4403790c676500cbab327e30fdb7f81be0b9bde29e552143f26912ac7 
>>  rustup-1.22.1.tar.gz
>> diff --git a/contrib/src/cargo/rules.mak 
>> b/contrib/src/cargo/rules.mak
>> new file mode 100644
>> index 00000000000..00060356a22
>> --- /dev/null
>> +++ b/contrib/src/cargo/rules.mak
>> @@ -0,0 +1,26 @@
>> +# cargo/cargo-c installation via rustup
>> +
>> +RUSTUP_VERSION=1.22.1
>> +RUSTUP_URL=https://github.com/rust-lang/rustup/archive/$(RUSTUP_VERSION).tar.gz
>> +
>> +RUSTUP = RUSTUP_HOME=$(CARGO_HOME) $(CARGO_HOME)/bin/rustup
>> +
>> +$(TARBALLS)/rustup-$(RUSTUP_VERSION).tar.gz:
>> +	$(call download_pkg,$(RUSTUP_URL),rustup)
>> +
>> +.sum-cargo: rustup-$(RUSTUP_VERSION).tar.gz
>> +
>> +rustup: rustup-$(RUSTUP_VERSION).tar.gz .sum-cargo
>> +	$(UNPACK)
>> +	$(MOVE)
>> +
>> +# When needed (when we have a Rust dependency not using cargo-c), 
>> the
>> cargo-c
>> +# installation should go in a different package
>> +.cargo: rustup
>> +	cd $< && RUSTUP_INIT_SKIP_PATH_CHECK=yes \
>> +	  RUSTUP_HOME=$(CARGO_HOME) CARGO_HOME=$(CARGO_HOME) \
>> +	  ./rustup-init.sh --no-modify-path -y
>> +	$(RUSTUP) target add $(RUST_TARGET)
>> +	$(RUSTUP) default stable
>> +	$(CARGO) install cargo-c
>> +	touch $@
>> -- 
>> 2.28.0
>>
>> _______________________________________________
>> vlc-devel mailing list
>> To unsubscribe or modify your subscription options:
>> https://mailman.videolan.org/listinfo/vlc-devel
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list