How to include dependencies from git in stack build? - haskell-stack

I'm building a Haskell project that depends on a project available in git, but not published in Hackage. What is the correct way of doing that?
I found the following solution online. Add the to stack.yaml in the base directory of my project:
packages:
- '.'
- location:
git: https://github.com/commercialhaskell/stack.git
commit: master
However I get the error:
Aeson exception: Error in $.packages[1]: failed to parse field 'packages': expected Text, encountered Object
Which suggests to me that packages doesn't take objects like that. Only names. So how do I do this?

Related

Problem installing forked github repository to R

I am currently working on a research that requires me to add some model functions into the gstat package in R. I forked it from the author on github, added the functions that i needed to experiment on, and rename it in my github repository. But i cant install it into R.
> install_github("JohannahKiram/gstatmod")
Error: Failed to install 'unknown package' from GitHub:
HTTP error 404.
No commit found for the ref master
Did you spell the repo owner (`JohannahKiram`) and repo name (`gstatmod`) correctly?
- If spelling is correct, check that you have the required permissions to access the repo
what am i doing wrong? I dont want to push it to the author cause i just need to experiment the changes first.

NuGet hash validation failed NU1403

I have a solution and it working on other developer's laptops, but on one by some reason during build, I see the next error:
Error NU1403 Package content hash validation failed for
Lucene.Net.Contrib.3.0.3. The package is different than the last
restore.
build is failed by this reason.
at packeges folder I see correct Lucene.Net.Contrib.3.0.3 , what could be a reson for it and how to fix ?
clean up the global packaged folder fixed this issue.
path is %userprofile%.nuget\packages

How to fix envoyproxy's validate rules proto dependency in Go repository with bazel build tool

I am trying to use bazel and gazelle tools to build a large Golang repository with pre-generated proto files. There are issues in using validate rules from envoyproxy in proto definitions and the bazel tool fails to build repository with this dependency. To reproduce the issue, I have created a github repository with a sample gRPC service. Without envoyproxy's validate proto dependency, the bazel tool succesfully builds the go packages. But introducing this dependency throws error.
Commands used to build the repository:
Generate proto files before building repository.
protoc -I=. -I ~/go/pkg/mod/github.com/envoyproxy/protoc-gen-validate#v0.6.1 --go_out=./../../../ --validate_out="lang=go:./../../../" --go-grpc_out=./../../../ ./protos/pinger/service.proto
Use gazelle to generate dependencies
bazel run //:gazelle -- update-repos -from_file=go.mod -to_macro=deps.bzl%go_dependencies -build_file_proto_mode=disable_global -prune
Use gazelle to generate BUILD.bazel files
bazel run //:gazelle
Build pinger go binary
bazel build //cmd/pinger
The last build command throws an error
go/src/github.com/ihtkas/bazel-gazelle-ex/api/pinger/BUILD.bazel:3:11:
error loading package
'#com_github_envoyproxy_protoc_gen_validate//validate': Unable to find
package for #com_google_protobuf//:protobuf.bzl: The repository
'#com_google_protobuf' could not be resolved. and referenced by
'//api/pinger:pinger' ERROR: Analysis of target '//cmd/pinger:pinger'
failed; build aborted: Analysis failed
There is a github issue for the same. There are multiple suggestions and none of them seems to work for me. Explaining all the attempts will make this question useless. I need help in finding one solution which will solve the issue and build the repository successfully with bazel tool with pre-generated proto files. Based on suggestion, I will experiment and share the results here or in the same repository.
The issue can be fixed by following three steps.
-> Use specific commit from envoyproxy/protoc-gen-validate with the bazel naming convention fix
go get github.com/envoyproxy/protoc-gen-validate#4f41f10dde19ec4dd9dd8cf6f7537139f52fb58b
-> Include dependency for "com_google_protobuf" in bazel WORKSPACE
http_archive(
name = "com_google_protobuf",
sha256 = "d0f5f605d0d656007ce6c8b5a82df3037e1d8fe8b121ed42e536f569dec16113",
strip_prefix = "protobuf-3.14.0",
urls = [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v3.14.0.tar.gz",
],
)
load("#com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
protobuf_deps()
-> Update io_bazel_rules_go to v0.28.0
All the fixes are included in a PR and merged to a branch "working" in the repository for reference.

Webpack compilation, local Module not found: Error: Can't resolve

I modified a plugin and added it in my project's file system. So in my package.json I have : "some-module": "file:modules/some-module".
It works fine on my machine (Windows), but not on our build server (Linux CentOS), which fails during webpack compilation with error : Module not found: Error: Can't resolve 'some-module'.
The build server does clean the workspace before build, and after the failed build the plugin does exist in 'node_modules' folder of the workspace.
What could cause this error if the plugin does exists ?
EDIT : I tried on another linux machine (CentOS) and build failed for same error.
EDIT2 : I changed the local file: reference in my package.json file to a .tar.gz git URL. The error is now :
ERROR in ../node_modules/nativescript-pdfview-ng/pdfview-ng.ts
Module build failed (from ../node_modules/#ngtools/webpack/src/index.js):
Error: /root/myProject/node_modules/nativescript-pdfview-ng/pdfview-ng.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format ([link][1]).
at AngularCompilerPlugin.getCompiledFile (/root/myProject/node_modules/#ngtools/webpack/src/angular_compiler_plugin.js:719:23)
at plugin.done.then (/root/myProject/node_modules/#ngtools/webpack/src/loader.js:41:31)
at process._tickCallback (internal/process/next_tick.js:68:7)
Are you using NativeScript 5.x?
If so, make sure to prefix the plugin with "nativescript-", since {N} 5.x the module resolution seems to have changed with regards to Webpack'ed build.

Go - use of internal package [...] not allowed

I tried to clone and build the project from the stellar bridge-server github repository. After quite a lot of steps I am facing following errors:
[ERROR] github.com\stellar\go\services\bridge\internal\handlers\main.go:8:2: use of internal package github.com/stellar/go/services/bridge/internal/db not allowed
[ERROR] github.com\stellar\go\services\bridge\internal\handlers\main.go:9:2: use of internal package github.com/stellar/go/services/bridge/internal/listener not allowed
[ERROR] github.com\stellar\go\services\bridge\internal\handlers\main.go:10:2: use of internal package github.com/stellar/go/services/bridge/internal/submitter not allowed
( ... many more issues of same format ... )
I imported the dependencies and different packages but when I try to compile and install it I get this errors. I moved some folders to their upper folder to have a same directory as in repo wished but the errors are still the same.
I'm pretty confused and do not understand this problem. I'm totaly new in packaging directory system.
What is the problem here and what should I do?
Thank you for your help.

Resources