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

How to get licenses of just built package #118

Closed
BastianZim opened this issue Mar 24, 2022 · 4 comments
Closed

How to get licenses of just built package #118

BastianZim opened this issue Mar 24, 2022 · 4 comments

Comments

@BastianZim
Copy link

Hi everybody,

I have a question about extracting the license of a freshly built package.

Background is, that I would like to add this tool to the conda-forge docs to make it easier for maintainers to correctly include go licenses.

The collection of licenses would therefore be right after a package is built with the ideal process being the following:

  1. Conda-build builds the package

  2. go-licenses downloads all licenses

  3. conda-build includes the output folder in the package and finishes packaging it.

Step 1. and 3. is taken care of by our infrastructure but 2. fails with

Error: errors for ["github.com/mozilla/sops"]:
github.com/mozilla/sops: -: no required module provides package github.com/mozilla/sops; to add it:
	go get github.com/mozilla/sops

Logs: https://dev.azure.com/conda-forge/feedstock-builds/_build/results?buildId=479803&view=logs&jobId=656edd35-690f-5c53-9ba3-09c10d0bea97&j=656edd35-690f-5c53-9ba3-09c10d0bea97&t=e5c8ab1d-8ff9-5cae-b332-e15ae582ed2d

The script for this is:

script:
     - pushd {{ pkg_src }}
     - make install
     - go-licenses save "github.com/mozilla/sops" --save_path="go_licenses"

Ref: https://github.com/conda-forge/go-sops-feedstock/pull/9/files

And the PR where I tried this is conda-forge/go-sops-feedstock#9

Therefore, my question would be:

  1. How do I need to include go-licenses in the workflow so that everything is captured?

  2. And additionally, the docs include / before the folder where the output is stored. Is that OS-specific, or is that correctly translated for Win? Ref: https://github.com/google/go-licenses#complying-with-license-terms

@Bobgy
Copy link
Collaborator

Bobgy commented Apr 8, 2022

Hi @BastianZim, just sharing my guesses first:

  1. in the environment, can you build the same go package? go-licenses must be run in an environment with full go development env and dependencies are downloaded (go mod download)
  2. Is the root package "github.com/mozilla/sops" buildable as a binary? If not, you might want to choose between all subpackages "github.com/mozilla/sops/..." or specify the package of the built go binary explicitly "github.com/mozilla/sops/cmd/some-cli".

@Bobgy
Copy link
Collaborator

Bobgy commented Apr 8, 2022

  1. And additionally, the docs include / before the folder where the output is stored. Is that OS-specific, or is that correctly translated for Win? Ref: https://github.com/google/go-licenses#complying-with-license-terms

Yes, that's OS-specific. I'm not sure whether go-licenses work properly in windows, recommend reporting a separate issue if you hit any problems.

@Bobgy
Copy link
Collaborator

Bobgy commented Apr 10, 2022

FYI, I just revamped documentation in #111, if you still have anything unclear.

@BastianZim
Copy link
Author

Working now with the new docs, thanks!

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

No branches or pull requests

2 participants