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

Revert "Add stellar licenses to display all dependencies' licenses" #1860

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

fnando
Copy link
Member

@fnando fnando commented Jan 29, 2025

This reverts commit 1160470.

What

First, it tries to fetch licences for vendored dependencies in ./vendor directory for some reason, which can be easily fixed with moving vendor out of project directory.
However, even doing that will lead to another issue that is license fetcher uses cargo metadata command and leads to error.
We first call

cargo-hack hack --feature-powerset --ignore-private --config "source.crates-io.replace-with = 'vendored-sources'" --config "source.vendored-sources.directory = '/tmp/vendor'" package --target x86_64-unknown-linux-gnu

Which was working just fine, but now it will also call a build script in the stellar-cli, that in turn calls license-fetcher, that finally makes a call to cargo metadata.

From my understanding, it calls metadata on vendored dependencies (in vendor directory) which then tries to fetch the information from crates (because it doesn't use the same cargo config as cargo hack on the top of the call), and that leads to fetcher not being able to see the necessary version (because it doesn't exist in creates.io)

thread 'main' panicked at /tmp/vendor/license-fetcher-0.5.0/src/build_script/mod.rs:61:9:
  Failed executing cargo metadata with:
      Updating crates.io index
  error: failed to select a version for `soroban-spec`.
      ... required by package `soroban-spec-json v22.2.0`
      ... which satisfies dependency `soroban-spec-json = "=22.2.0"` (locked to 22.2.0) of > package `soroban-cli v22.2.0 (/tmp/vendor/soroban-cli-22.2.0)`
  versions that meet the requirements `=22.0.0-rc.3` are: 22.0.0-rc.3

fetcher source code

We can't disable license fetching in build script just for dry-run because macro get_package_list_macro required bincode generated in the build script (and therefore it won't compile when license fetching is disabled)

Why

The license_fetcher package broke our CI. We need to figure out a fix, or find a replacement for it.

Known limitations

N/A

@fnando fnando merged commit cb33c96 into main Jan 29, 2025
25 checks passed
@fnando fnando deleted the revert-stellar-licenses branch January 29, 2025 21:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants