Skip to content

Resolve FOSS license issues #19409

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

Closed
wants to merge 4 commits into from
Closed

Conversation

nodakai
Copy link
Contributor

@nodakai nodakai commented Nov 30, 2014

  1. Update COPYRIGHT
  2. Install combined copyright documents on Linux
  3. Embed (compressed data of) combined copyright documents to rustc and rustdoc.

install.sh copies it to <prefix>/share/doc/$(PKG_NAME)/ where
$(PKG_NAME) is something like "rust-0.13.0".

It is generated by concatenating LICENSE, LICENSE-MIT, LICENSE-APACHE.
and AUTHORS.txt.  It used to include only the first three, but including
AUTHORS.txt is preferable because LICENSE mentions it.

Signed-off-by: NODA, Kai <[email protected]>
The license document is compressed by DEFLATE and then stored as
pub const license::text::COPYRIGHT of type &'static [u8].
A helper script src/etc/license2rs.sh takes care of updating it.

It is decompressed by flate::inflate_bytes() on runtime.

Fix rust-lang#17690

Signed-off-by: NODA, Kai <[email protected]>
@alexcrichton
Copy link
Member

Thanks for taking the initiative on this @nodakai! We want to be sure to tread carefully here, however, so I'm going to assign this to @brson.

As some high-level review:

  • Could we avoid checking in generated files?
  • Could we avoid a new --license compiler flag? Perhaps the license could be printed on rustc -v verbose?

@nodakai
Copy link
Contributor Author

nodakai commented Nov 30, 2014

Can you review my patches one by one? The first three should compile independently and should basically be enough to improve the current situation.

The combined license documents is rather lengthy, so it will surprise users to show it with -v verbose.

$ wc LICENSE-* COPYRIGHT AUTHORS.txt
  201  1581 10847 LICENSE-APACHE
   25   169  1071 LICENSE-MIT
  482  2848 20509 COPYRIGHT
  676  1994 24873 AUTHORS.txt
 1384  6592 57300 合計

Can you elaborate on your concern about generated files? Of course it will not kill us just to define a large (raw) string literal, but I had something like "resource file" in my mind (VC++/.NET, Java, or even with GCC toolchain)

@nodakai
Copy link
Contributor Author

nodakai commented Nov 30, 2014

Amazing, there's a script to check for a verbatim copy of the license text template!

I just didn't like the negative tone of the last sentence

This file may not be copied, modified, or distributed except according to those terms

but of course I won't push my taste on you when you want to merge my commits.

@adrientetar
Copy link
Contributor

Can you explain which part of the license requires embedding of authors in binaries?

@nodakai
Copy link
Contributor Author

nodakai commented Nov 30, 2014

@adrientetar I don't claim it was explicitly required. Howerver COPYRIGHT states

The Rust Project is copyright 2014, The Rust Project
Developers (given in the file AUTHORS.txt).

@adrientetar
Copy link
Contributor

But I don't see why we need to embed it in binary rather than distributing the textual license with the distribution.

@nodakai
Copy link
Contributor Author

nodakai commented Dec 1, 2014

@adrientetar I don't claim "we need to embed it in binary". Please remind that this is nothing more than my proposal.

The background is, the tarball distributed for Linux at https://static.rust-lang.org/dist/rust-nightly-x86_64-unknown-linux-gnu.tar.gz ( http://www.rust-lang.org/install.html ) does include COPYRIGHT, LICENSE-APACHE and LICENSE-MIT, but the installer script doesn't really copy them to the install location. I'm proposing embedding will reduce the risk of such errors.

@brson
Copy link
Contributor

brson commented Dec 3, 2014

cc #17690

@nodakai
Copy link
Contributor Author

nodakai commented Dec 6, 2014

There seems to be something wrong with this patch

 dist-install-dir-$(1): PREPARE_HOST=$(1)
 dist-install-dir-$(1): PREPARE_TARGETS=$(2)
 dist-install-dir-$(1): PREPARE_DEST_DIR=tmp/dist/$$(PKG_NAME)-$(1)
 dist-install-dir-$(1): PREPARE_DIR_CMD=$(DEFAULT_PREPARE_DIR_CMD)
 dist-install-dir-$(1): PREPARE_BIN_CMD=$(DEFAULT_PREPARE_BIN_CMD)
 dist-install-dir-$(1): PREPARE_LIB_CMD=$(DEFAULT_PREPARE_LIB_CMD)
 dist-install-dir-$(1): PREPARE_MAN_CMD=$(DEFAULT_PREPARE_MAN_CMD)
+dist-install-dir-$(1): DOC_DIR=$$(PREPARE_DEST_DIR)/share/doc/rust
 dist-install-dir-$(1): PREPARE_CLEAN=true
 dist-install-dir-$(1): prepare-base-dir-$(1) docs compiler-docs
+       $$(Q)mkdir -p $$(DOC_DIR) && \
+       $$(Q)cp -p $$(S)COPYRIGHT $$(S)LICENSE-APACHE \
+         $$(S)LICENSE-MIT $$(S)AUTHORS.txt} $$(DOC_DIR) && \
        $$(Q)(cd $$(PREPARE_DEST_DIR)/ && find . -type f | sed 's/^\.\///') \
       > tmp/dist/manifest-$(1).in
        $$(Q)mv tmp/dist/manifest-$(1).in $$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE)/rustlib/manifest.in
 # Add remaining non-installed files
        $$(Q)$$(PREPARE_MAN_CMD) $$(S)COPYRIGHT $$(PREPARE_DEST_DIR)
        $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-APACHE $$(PREPARE_DEST_DIR)
        $$(Q)$$(PREPARE_MAN_CMD) $$(S)LICENSE-MIT $$(PREPARE_DEST_DIR)
        $$(Q)$$(PREPARE_MAN_CMD) $$(S)README.md $$(PREPARE_DEST_DIR)
        $$(Q)cp -r doc $$(PREPARE_DEST_DIR)
        $$(Q)$$(PREPARE_BIN_CMD) $$(S)src/etc/install.sh $$(PREPARE_DEST_DIR)

because make -j8 dist (without VERBOSE=1) on a fresh repo fails with an error from /bin/sh:

prepare: tmp/dist/rust-0.13.0-dev-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler-rt.a
Reaping winning child 0x02a866f0 PID 6677
Live child 0x02a866f0 (prepare-target-x86_64-unknown-linux-gnu-host-x86_64-unknown-linux-gnu-2-dir-x86_64-unknown-linux-gnu) PID 6678
Reaping winning child 0x02a866f0 PID 6678
Live child 0x02a866f0 (prepare-target-x86_64-unknown-linux-gnu-host-x86_64-unknown-linux-gnu-2-dir-x86_64-unknown-linux-gnu) PID 6679
Reaping winning child 0x02a866f0 PID 6679
Removing child 0x02a866f0 PID 6679 from chain.
 File `dist' does not exist.
   File `dist-tar-bins' does not exist.
     File `dist/rust-0.13.0-dev-x86_64-unknown-linux-gnu.tar.gz' does not exist.
       File `dist-install-dir-x86_64-unknown-linux-gnu' does not exist.
         File `prepare-base-dir-x86_64-unknown-linux-gnu' does not exist.
           File `prepare-everything-dir-x86_64-unknown-linux-gnu' does not exist.
             File `prepare-targets-dir-x86_64-unknown-linux-gnu' does not exist.
            Must remake target `prepare-targets-dir-x86_64-unknown-linux-gnu'.
            Successfully remade target file `prepare-targets-dir-x86_64-unknown-linux-gnu'.
          Must remake target `prepare-everything-dir-x86_64-unknown-linux-gnu'.
          Successfully remade target file `prepare-everything-dir-x86_64-unknown-linux-gnu'.
        Must remake target `prepare-base-dir-x86_64-unknown-linux-gnu'.
        Successfully remade target file `prepare-base-dir-x86_64-unknown-linux-gnu'.
      Must remake target `dist-install-dir-x86_64-unknown-linux-gnu'.
Need a job token; we don't have children
Putting child 0x02a5e190 (dist-install-dir-x86_64-unknown-linux-gnu) PID 6688 on the chain.
Live child 0x02a5e190 (dist-install-dir-x86_64-unknown-linux-gnu) PID 6688
/bin/sh: 1: Syntax error: word unexpected (expecting ")")
Reaping losing child 0x02a5e190 PID 6688
make: *** [dist-install-dir-x86_64-unknown-linux-gnu] Error 2
Removing child 0x02a5e190 PID 6688 from chain.

I think I have to seriously learn evaluation rules of Makefile.

@Gankra
Copy link
Contributor

Gankra commented Jan 2, 2015

Closing due to inactivity; feel free to re-submit when you've figured out the necessary make-gicks, @nodakai!

@Gankra Gankra closed this Jan 2, 2015
lnicola pushed a commit to lnicola/rust that referenced this pull request Apr 28, 2025
minor: Don't query the database in workspace switching
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.

5 participants