Skip to content

Package LICENSE with each component#790

Merged
dminor merged 3 commits into
unicode-org:mainfrom
dminor:issue-771
Aug 18, 2021
Merged

Package LICENSE with each component#790
dminor merged 3 commits into
unicode-org:mainfrom
dminor:issue-771

Conversation

@dminor

@dminor dminor commented Jun 11, 2021

Copy link
Copy Markdown
Contributor

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 a team, echeran, filmil, nciric, sffc and zbraniecki as code owners June 11, 2021 14:11
@codecov-commenter

codecov-commenter commented Jun 11, 2021

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.85%. Comparing base (acfb8f4) to head (f6a34b3).
⚠️ Report is 4317 commits behind head on main.
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #790      +/-   ##
==========================================
- Coverage   74.98%   74.85%   -0.14%     
==========================================
  Files         215      220       +5     
  Lines       12609    12683      +74     
==========================================
+ Hits         9455     9494      +39     
- Misses       3154     3189      +35     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@coveralls

coveralls commented Jun 11, 2021

Copy link
Copy Markdown

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
Comment thread tools/scripts/tidy.toml
for path in ${handle}
root_dir = dirname ${path}
if not is_empty ${root_dir}
if not is_path_exists ${root_dir}/LICENSE

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

Comment thread tools/scripts/tidy.toml
end
'''

[tasks.license-file-check]

Copy link
Copy Markdown
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

Comment thread tools/scripts/tidy.toml Outdated
root_dir = dirname ${path}
if not is_empty ${root_dir}
if not is_path_exists ${root_dir}/LICENSE
trigger_error "LICENSE file missing in ${root_dir}"

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member

Filed as rust-lang/cargo#9575

@dminor

dminor commented Jun 11, 2021

Copy link
Copy Markdown
Contributor Author

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

dminor commented Jun 16, 2021

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
Member

Agree.

@Manishearth

Copy link
Copy Markdown
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

dminor commented Jun 16, 2021

Copy link
Copy Markdown
Contributor Author

@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
Copy Markdown
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
Copy Markdown

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

dminor commented Aug 17, 2021

Copy link
Copy Markdown
Contributor Author

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