Re: Building "cargo-c": over 400 packages to be downloaded?

"Rainer Fiebig" ([email protected] via blfs-support Mailing List) <[email protected]> Sat, 14 Mar 2026 23:36:12 +0100
Newsgroups gmane.linux.lfs.beyond.support
Message-ID <[email protected]>
This is a multi-part message in MIME format...

------------=_1773527788-23792-15975
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Am 14.03.26 um 18:44 schrieb Joe Locash ([email protected] via
blfs-support Mailing List):
> On 3/14/26 5:35 AM, Rainer Fiebig ([email protected] via blfs-support
> Mailing List) wrote:
>> Am 14.03.26 um 01:17 schrieb Joe Locash ([email protected] via
>> blfs-support Mailing List):
>>> On 3/13/26 2:51 PM, Rainer Fiebig ([email protected] via blfs-support
>>> Mailing List) wrote:
>>>> Am 12.03.26 um 21:43 schrieb Joe Locash ([email protected] via
>>>> blfs-support Mailing List):
>>>>> On 3/12/26 6:28 AM, Rainer Fiebig ([email protected] via blfs-support
>>>>> Mailing List) wrote:
>>>>>> "Cargo-c" is required for later versions of librsvg which I wanted to
>>>>>> update for security-reasons (SA 12.4 098).
>>>>>>
>>>>>> An offline-build of cargo-c doesn't seem possible and the download of
>>>>>> file "cargo.lock" is necessary.  I checked version -0.10.21 of that
>>>>>> file
>>>>>> and it has over 400 "package" sections, all with name and url:
>>>>> <snip>
>>>>>
>>>>> You can do an offline build. On your system with internet access after
>>>>> you extract and cd into the cargo-c source dir, just do a "cargo
>>>>> vendor".
>>>>>
>>>>> It will download all the crates it thinks it needs. Save the vendor
>>>>> dir
>>>>> and copy it to your offline box and put it into the cargo-c source dir
>>>>> there. Make sure to follow the directions that are displayed after
>>>>> doing
>>>>> the vendor. I do all of my builds offline.
>>>> Tested this with cargo-c-0.10.21 (and rustc-1,94.0) and it worked -
>>>> provided that "config.json" and "Cargo.lock" were also in the package's
>>>> root directory.
>>>>
>>>> Contrary to the book, I downloaded Cargo.lock with a slightly modified
>>>> curl-statement
>>> For an offline build you don't need the Cargo.lock file.
>> Hm - that's not what I see here for cargo-c.  With the right Cargo.lock
>> symlinked into the build-directory, the offline build succeeds.  Without
>> it, I get this:
>>
>> [...]
>>      Updating crates.io index
>> warning: spurious network error (3 tries remaining): [6] Could not
>> resolve hostname (Could not resolve host: index.crates.io)
>> warning: spurious network error (2 tries remaining): [6] Could not
>> resolve hostname (Could not resolve host: index.crates.io)
>> warning: spurious network error (1 try remaining): [6] Could not resolve
>> hostname (Could not resolve host: index.crates.io)
>> error: failed to get `anyhow` as a dependency of package `cargo-c
>> v0.10.21+cargo-0.95.0
>> (/home/rainer/Downloads/LFS/BLFS/BLFS-11.1/cargo-c-0.10.21)`
>>
>> Caused by:
>>    download of config.json failed
>>
>> Caused by:
>>    failed to download from `https://index.crates.io/config.json`
>>
>> Caused by:
>>    [6] Could not resolve hostname (Could not resolve host:
>> index.crates.io)
>>
>> real    0m17.343s
>> user    0m0.197s
>> sys     0m0.955s
>>
>>
>> Is there something else to heed?  Or maybe cargo-c is an exception to
>> the rule?
> 
> After putting the vendor/ dir in did you create .cargo/config.toml with
> the line from the cargo vendor command?

No.  I didn't do anything.  Just now I repeated "cargo vendor" to get an
idea of what you might mean and these are the last lines from the output
of it:

[...]
   Vendoring zmij v1.0.21
(/home/rainer/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/zmij-1.0.21)
to vendor/zmij
To use vendored sources, add this to your .cargo/config.toml for this
project:

[source.crates-io]
replace-with = "vendored-sources"

[source.vendored-sources]
directory = "vendor"

But which .cargo/config.toml is meant here?  There's none in the base
directory and "find" shows many options:

~/.../BLFS-11.1/cargo-c-0.10.21> find . -name "config.toml"
./vendor/ed25519-compact/.cargo/config.toml
./vendor/blake3/.cargo/config.toml
./vendor/cargo/tests/testsuite/cargo_add/overwrite_path_base_with_version/in/.cargo/config.toml
./vendor/cargo/tests/testsuite/cargo_add/dev_existing_path_base/in/.cargo/config.toml
./vendor/cargo/tests/testsuite/cargo_add/path_base_inferred_name/in/.cargo/config.toml
./vendor/cargo/tests/testsuite/cargo_add/path_base/in/.cargo/config.toml
./vendor/cargo/.cargo/config.toml
./vendor/curl/ci/.cargo/config.toml

My best guess would be  "./vendor/cargo/.cargo/config.toml".  But is
this the right one?

I noticed this time that a "Cargo.lock" was created after issuing "cargo
vendor".  Perhaps it would be enough to copy/backup that file along with
directory "vendor" for the offline build?  Instead of symlinking the
separately downloaded one?  I mean, once Cargo.lock is present, the
offline-build succeeds.  No editing of a config.toml needed.

I built cbindgen today, also offline and without problems.  But cbindgen
comes with a Cargo.lock already.  No extra download necessary.

Rainer


------------=_1773527788-23792-15975
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0

-- 
http://lists.linuxfromscratch.org/sympa/info/blfs-support
Unsubscribe: See the above information page

------------=_1773527788-23792-15975--