Compile source code
How to compile and package source code locally offline
Thank you @73hulu for creating this issue. If this is in regards to a defect, product question or feature request: you should use our support portal at https://support.fossa.com to file a request, as you would receive more immediate support.
Instructions for building can be found in our contributor documentation. Note that we include a few proprietary components which will not be available for third-parties to use while building, so some functions of the FOSSA CLI will be limited. Also note that we are limited in our ability to support users using unofficial builds. Please use official releases of the CLI for production work or evaluation purposes.
Run the cabal build command in the root directory of the project. A dependency error message is displayed. Check that there is no spectrometer package in the official dependency package warehouse。
The error log is as follows: Resolving dependencies... cabal: Could not resolve dependencies: [__0] trying: cpio-conduit-0.7.3 (user goal) [__1] trying: base-4.17.2.1/installed-4.17.2.1 (dependency of cpio-conduit) [__2] next goal: spectrometer (user goal) [__2] rejecting: spectrometer-0.1.0.0 (conflict: base==4.17.2.1/installed-4.17.2.1, spectrometer => base^>=4.15) [__2] fail (backjumping, conflict set: base, spectrometer) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: base, spectrometer, cpio-conduit
spectrometer is the internal name of the package we develop in this repository. It isn't distributed on hackage and we don't currently have any plans to distribute it there. With some more details I may be able to offer assistance:
- Do you have an up-to-date cabal package index? (
cabal updatewill refresh it). - What versions of ghc (
ghc --version) and cabal (cabal --version) are you using? Currently we only use GHC 9.4.7 to develop spectrometer and don't support other versions. Did you install them viaghcupor from some other source? - Are you trying to consume spectrometer as a library in some other package?
- What is the exact command you used to produce that output?
- What revision are you trying to build? Is it the latest
master? cabalshould clone several repositories with dependencies as defined incabal.project. Did that happen successfully? Where is that output?- Have you made any modifications before trying to build?
To me, this message looks like you're trying to build a version of spectrometer which requires base 4.15 when cpio-conduit requires base 4.17, which is a conflict. I checked though, and both the version of cpio-conduit we reference in cabal.project and spectrometer have version bounds compatible with base 4.17.2.1.
Since we added something to the 3.7.8 version of the fossa-cli project, we want to build and package a similar executable based on that version of the branch.
@MacBook-Pro-3 fossa-cli-3.7.1 % ghc --version
The Glorious Glasgow Haskell Compilation System, version 9.4.7
@MacBook-Pro-3 fossa-cli-3.7.1 % cabal --version
cabal-install version 3.8.1.0
compiled using version 3.8.1.0 of the Cabal library
@MacBook-Pro-3 fossa-cli-3.7.1 % stack --version
Version 2.9.3, Git revision 6cf638947a863f49857f9cfbf72a38a48b183e7e x86_64 hpack-0.35.1
@MacBook-Pro-3 fossa-cli-3.7.1 % cabal update
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2024-01-04T05:52:46Z.
@MacBook-Pro-3 fossa-cli-3.7.1 % cabal build
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: cpio-conduit-0.7.3 (user goal)
[__1] trying: base-4.17.2.0/installed-4.17.2.0 (dependency of cpio-conduit)
[__2] next goal: spectrometer (user goal)
[__2] rejecting: spectrometer-0.1.0.0 (conflict:
base==4.17.2.0/installed-4.17.2.0, spectrometer => base^>=4.15)
[__2] fail (backjumping, conflict set: base, spectrometer)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, spectrometer, cpio-conduit
@MacBook-Pro-3 fossa-cli-3.7.1 % ghci GHCi, version 9.4.7: https://www.haskell.org/ghc/ :? for help ghci>
fossa-cli is only a client, there is no way to resolve the package dependencies in the project, but now the project is running on the Intranet environment, can not access the external network, can not access https://app.fossa.com, what should I do?
You should use the contributing guide for that version, which was using ghc 9.0 and base 4.15.
Regarding accessing https://app.fossa.com, that is something I think that the team managing the intranet/firewalls would be able to help with better than I can since that configuration is specific to your organization.