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

Always raises exception if using executable built with ruby-packer #429

Open
yugoPanorama opened this issue Jan 6, 2022 · 5 comments
Open

Comments

@yugoPanorama
Copy link

I keep running into this exception any time I try to use the executable as suggested in the documentation.

The source of the error appears to be here:

raise Licensed::Sources::Source::Error.new(RUBY_PACKER_ERROR) if ruby_packer?

And since the executables are always built with ruby-packer, this error will always occur?

Context:
We tried adding the following code to our Buildkite (CI)'s pipeline.yml file:

  - label: Run license checks
    branches: "!main"
    command:
      - "curl -sSL https://github.com/github/licensed/releases/download/3.3.1/licensed-3.3.1-linux-x64.tar.gz > licensed.tar.gz"
      - "tar -xzf licensed.tar.gz --no-same-owner"
      - "rm -f licensed.tar.gz"
      - "ls -la"
      - "./licensed cache"
      - "./licensed status"
@jonabc
Copy link
Contributor

jonabc commented Jan 6, 2022

@yugoPanorama it looks like you want to use licensed with a local ruby installation - is there any reason you're not using the ruby gem distribution of licensed and installing with bundler or gem install licensed? The executable is meant to support using licensed only in environments where ruby isn't already available.

I'm sorry that the documentation is unclear 🙏 . If you want to submit a PR to update the documentation I'd be happy to review it, or if you can point me at the content that made you think you needed to use the executable I'll update it when I get a chance!

@yugoPanorama
Copy link
Author

Thanks, @jonabc! We can successfully install and run licensed on our (macOS) dev laptops, but trying to get it to run in a (linux) Dockerized CI environment has been unsuccessful so far:

  • We tried to gem install licensed (in the pipeline.yml file and alternatively in the Dockerfile), but ran into issues due to a dependency on cmake and pkg-config.
  • In the container, apt-get install cmake pkg-config (with and without sudo) didn't work for us.
  • We also tried installing ruby-dev via apt-get install which didn't solve it.
  • That's why we wound up trying to do it with the executable version.

I'd be happy to submit a PR with clarified documentation, but to be honest, I don't understand enough yet about the interactions between licensed and bundler and ruby-packer to know what to write.

Thanks for taking a look at this!

@jonabc
Copy link
Contributor

jonabc commented Jan 7, 2022

what errors are you seeing from apt-get install cmake pkg-config? I might be able to help there as I've had to work through similar issues in the past, but my experience with linux and/or dependency package installation issues is limited.

@jonabc
Copy link
Contributor

jonabc commented Jan 27, 2022

@yugoPanorama 👋 is there anything else I can help with here? Have you been able to get past the underlying issue of getting ruby installed in the CI environment?

@yugoPanorama
Copy link
Author

Thank you so much, @jonabc ! I haven't had a chance to get back to this as more urgent work has taken me away from this side project, but I'll try to answer your questions next week!

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