licensed icon indicating copy to clipboard operation
licensed copied to clipboard

Always raises exception if using executable built with ruby-packer

Open yugoPanorama opened this issue 3 years ago • 5 comments

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: https://github.com/github/licensed/blob/d84a41cb9205340b8e96661b0a34ec575cb576ed/lib/licensed/sources/bundler.rb#L58

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"

yugoPanorama avatar Jan 06 '22 21:01 yugoPanorama

@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!

jonabc avatar Jan 06 '22 21:01 jonabc

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!

yugoPanorama avatar Jan 07 '22 00:01 yugoPanorama

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 avatar Jan 07 '22 19:01 jonabc

@yugoPanorama :wave: 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?

jonabc avatar Jan 27 '22 17:01 jonabc

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!

yugoPanorama avatar Jan 27 '22 19:01 yugoPanorama