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

Package LICENSE with each component #790

Merged
merged 3 commits into from
Aug 18, 2021
Merged

Conversation

dminor
Copy link
Contributor

@dminor dminor commented Jun 11, 2021

This packages LICENSE with each component and adds commands to automatically copy LICENSE files to each component and a check to make sure LICENSE exists in each component.

Fixes #771.

@dminor dminor requested review from echeran, filmil, nciric, sffc, zbraniecki and a team as code owners June 11, 2021 14:11
@codecov-commenter
Copy link

codecov-commenter commented Jun 11, 2021

Codecov Report

Merging #790 (7b02ca4) into main (acf3886) will decrease coverage by 0.14%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #790      +/-   ##
==========================================
- Coverage   75.48%   75.34%   -0.15%     
==========================================
  Files         194      193       -1     
  Lines       12297    12833     +536     
==========================================
+ Hits         9283     9669     +386     
- Misses       3014     3164     +150     
Impacted Files Coverage Δ
ffi/capi/src/pluralrules.rs 0.00% <0.00%> (ø)
provider/testdata/src/test_data_provider.rs
provider/testdata/src/paths.rs
provider/testdata/src/metadata.rs
provider/testdata/src/lib.rs
provider/cldr/src/transform/dates/patterns.rs 79.48% <0.00%> (ø)
provider/cldr/src/transform/dates/mod.rs 41.66% <0.00%> (ø)
provider/cldr/src/transform/dates/symbols.rs 80.88% <0.00%> (ø)
experimental/provider_ppucd/src/parse_ppucd.rs 93.13% <0.00%> (+0.13%) ⬆️
provider/cldr/src/transform/mod.rs 12.26% <0.00%> (+1.01%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update acf3886...7b02ca4. Read the comment docs.

@coveralls
Copy link

coveralls commented Jun 11, 2021

Pull Request Test Coverage Report for Build 5bc7253136e7040b8ef28195fbde1d5e4079acac-PR-790

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.008%) to 75.018%

Files with Coverage Reduction New Missed Lines %
experimental/provider_ppucd/src/parse_ppucd.rs 1 93.28%
Totals Coverage Status
Change from base Build acfb8f4151f978edcb731a029ce22793830ff24a: -0.008%
Covered Lines: 9585
Relevant Lines: 12777

💛 - Coveralls

Manishearth
Manishearth previously approved these changes Jun 11, 2021
root_dir = dirname ${path}
if not is_empty ${root_dir}
if not is_path_exists ${root_dir}/LICENSE
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion (nb): should we check that it is the same license, too?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

something like if cmp -s ${root_dir}/LICENSE ${root_dir}/../LICENSE (don't know my duckscript)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to do this prior to pushing this up for the initial review, but I was unable to get it working in duckscript:

license_text = readfile ${license}

if not eq ${license_text} ${license_text}
    echo "not working"
end

but it turns out that this works:

license_text = readfile ${license}

license_equal = eq ${license_text} ${license_text}
if not eq ${license_equal}
    echo "not working"
end

Duckscript is not intuitive to me at all.

'''

[tasks.license-file-check]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a part of the ci-task-tidy task in the toplevel Makefile

if not is_empty ${root_dir}
if not is_path_exists ${root_dir}/LICENSE
trigger_error "LICENSE file missing in ${root_dir}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: mention something like "run cargo make copy-license to automatically copy the license to all necessary locations"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there any linter on the lower level .toml files themselves? maybe something to enforce consistency (the all have the same categories etc) would be useful.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, but that's a good idea!

srl295
srl295 previously approved these changes Jun 11, 2021
@zbraniecki
Copy link
Member

Non blocking: I really wish cargo would know how to package in files from ../../ - this seems important for mono repo licenses and the solution here is really a dirty hack that increases the cost on the project to work around cargo's limitation.

@Manishearth do you agree? Could we file an issue against cargo?

zbraniecki
zbraniecki previously approved these changes Jun 11, 2021
@Manishearth
Copy link
Member

Yes, please do! I'm not sure how it should work but worth filing an issue.

@dminor dminor dismissed stale reviews from zbraniecki, srl295, and Manishearth via 7b02ca4 June 11, 2021 17:12
Manishearth
Manishearth previously approved these changes Jun 11, 2021
@zbraniecki
Copy link
Member

Filed as rust-lang/cargo#9575

@dminor
Copy link
Contributor Author

dminor commented Jun 11, 2021

It looks like this is actually a problem when running cargo vendor, not with the packaging. I wish I had noticed that earlier!

@dminor dminor closed this Jun 11, 2021
@dminor dminor reopened this Jun 16, 2021
@dminor
Copy link
Contributor Author

dminor commented Jun 16, 2021

@zbraniecki My take on the upstream bug is that the vendoring issue is not going to be easy to solve, and packaging the LICENSE file with each component is a viable workaround. What do you think?

@zbraniecki
Copy link
Member

Agree.

@Manishearth
Copy link
Member

@dminor That's not clear to me at all; it seems like a minor bug in cargo vendor to me so far. I'd rather avoid doing this if we don't have to.

@dminor
Copy link
Contributor Author

dminor commented Jun 16, 2021

@dminor That's not clear to me at all; it seems like a minor bug in cargo vendor to me so far. I'd rather avoid doing this if we don't have to.

I agree, I'd prefer to not do this either. Are you willing to fix the upstream bug? If so, I'm happy to close this again and move on with my life :)

@Manishearth
Copy link
Member

I don't have the time or the knowledge to fix the upstream bug; but I'm pushing on it.

@sffc sffc removed their request for review June 17, 2021 08:29
@sffc sffc added the blocked A dependency must be resolved before this is actionable label Jun 17, 2021
@sffc sffc marked this pull request as draft June 17, 2021 17:15
@jira-pull-request-webhook
Copy link

Notice: the branch changed across the force-push!

  • components/capi/examples/pluralrules/a.out is no longer changed in the branch
  • components/datetime/Cargo.toml is different
  • components/decimal/Cargo.toml is different
  • components/icu/Cargo.toml is different
  • components/locale_canonicalizer/Cargo.toml is different
  • components/locid/Cargo.toml is different
  • components/plurals/Cargo.toml is different
  • components/uniset/Cargo.toml is different
  • experimental/calendar/Cargo.toml is now changed in the branch
  • experimental/calendar/LICENSE is now changed in the branch
  • experimental/codepointtrie/Cargo.toml is now changed in the branch
  • experimental/codepointtrie/LICENSE is now changed in the branch
  • experimental/provider_ppucd/Cargo.toml is different
  • experimental/provider_static/Cargo.toml is no longer changed in the branch
  • experimental/segmenter_lstm/Cargo.toml is different
  • experimental/segmenter/Cargo.toml is different
  • ffi/capi/Cargo.toml is different
  • ffi/ecma402/Cargo.toml is different
  • Makefile.toml is different
  • provider/blob/Cargo.toml is now changed in the branch
  • provider/blob/LICENSE is now changed in the branch
  • provider/cldr/Cargo.toml is different
  • provider/core/Cargo.toml is different
  • provider/fs/Cargo.toml is different
  • provider/macros/Cargo.toml is now changed in the branch
  • provider/macros/LICENSE is now changed in the branch
  • provider/testdata/Cargo.toml is different
  • provider/uprops/Cargo.toml is now changed in the branch
  • provider/uprops/LICENSE is now changed in the branch
  • tools/benchmark/binsize/Cargo.toml is now changed in the branch
  • tools/benchmark/binsize/LICENSE is now changed in the branch
  • tools/benchmark/macros/Cargo.toml is different
  • tools/benchmark/memory/Cargo.toml is different
  • tools/datagen/Cargo.toml is different
  • tools/scripts/tidy.toml is different
  • utils/fixed_decimal/Cargo.toml is different
  • utils/litemap/Cargo.toml is different
  • utils/pattern/Cargo.toml is different
  • utils/writeable/Cargo.toml is different
  • utils/yoke/Cargo.toml is different
  • utils/yoke/derive/Cargo.toml is now changed in the branch
  • utils/yoke/derive/LICENSE is now changed in the branch
  • utils/zerovec/Cargo.toml is different

View Diff Across Force-Push

~ Your Friendly Jira-GitHub PR Checker Bot

@dminor dminor removed the blocked A dependency must be resolved before this is actionable label Aug 17, 2021
@dminor dminor marked this pull request as ready for review August 17, 2021 19:23
@dminor
Copy link
Contributor Author

dminor commented Aug 17, 2021

From conversation on slack, the plan is to go ahead with this workaround until the upstream cargo issue is fixed.

@dminor dminor merged commit 803af54 into unicode-org:main Aug 18, 2021
@dminor dminor deleted the issue-771 branch August 19, 2021 13:03
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.

LICENSE file not packaged with individual crates
8 participants