Stack and git are incompatible in Windows 7? - windows

I have been using Stack for dependencies management and building system for Haskell programs in Windows 7 Pro without problems.
stack --version
Version 1.3.2, Git revision 3f675146590da4f3edf768b89355f798229da2a5 x86_64 hpack-0.15.0
I have recently installed git for Windows, and Stack cannot download lts files anymore. It seems that Stack is trying using the new git client instead of the internal one.
git --version
git version 2.13.3.windows.1
The error I get when I try to create a new project is the following:
C:\proj>stack new newProject
Downloading template "new-template" to create project "newProject" in newProject\ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- newProject\newProject.cabal
Selecting the best among 11 snapshots...
Fetching package index ...fatal: Not a git repository: '.git'
Process exited with ExitFailure 128: C:\dev\git\apps\Git\cmd\git.EXE --git-dir=.git fetch --tags
Failed to fetch package index, retrying.
removeDirectoryRecursive: permission denied (Acceso denegado.)
If I rename the directory where git is installed, Stack works again. But that is not a real solution.
Any help will be apreciated

Related

How can I install using cargo when offline?

I want to use bat and lsd in my work area.
But my company's Centos 6 Linux server is disconnected from the internet for security.
But we can do it that is install something that is helping to work.
> cargo install --locked bat
Updating crates.io index
warning: spurious network error (2 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
warning: spurious network error (1 tries remaining): failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
error: failed to fetch `https://github.com/rust-lang/crates.io-index`
Caused by:
failed to resolve address for github.com: Temporary failure in name resolution; class=Net (12)
How can I do that?
The directions below aren't much different for any other crate.
Download the repository:
git clone https://github.com/sharkdp/bat.git --depth 1 --branch v0.18.1
cd bat
This just gets the 0.18.1 version of the bat crate.
Use cargo vendor to download and bundle up the package's dependencies on the local machine:
cargo vendor
optionally specify a toolchain if different than the other machine (i.e. cargo +<TOOLCHAIN> vendor)
optionally specify a target if different than the other machine (i.e. cargo vendor --target <TARGET>)
Be sure to follow the directions at the end to create/add to the .cargo/config.toml file. You can also inspect all the dependencies that are now in the vendor/ directory.
Zip up and transfer the whole current directory to the other machine.
Use cargo install to install it:
cargo install --offline --path <PATH>
use --path to tell it the directory to install from
use --offline to prevent it from accessing the network for any reason

Getting error while running mediapipe on macOS; Building C++ command-line example apps

I am trying to use mediapipe for a university project and have installed it, even successfully ran the Hello World! in C++ example app but when I am trying to build the C++ command-line example, it is giving me errors.
I ran this:
bazel build -c opt --define MEDIAPIPE_DISABLE_GPU=1 mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu
and the result I got is this:
DEBUG: /private/var/tmp/_bazel_kanzashaikh/c191ae13e9137350b50f6a19ce94bf21/external/rules_foreign_cc/workspace_definitions.bzl:15:10: WARNING: This branch is deprecated and no longer recieving updates. Please update to main or choose a specific commit to pin in your workspace.
INFO: Build option --compilation_mode has changed, discarding analysis cache.
ERROR: Error fetching repository: java.io.IOException: The repository's path is "/usr/local/opt/opencv#3" (absolute: "/usr/local/opt/opencv#3") but this directory does not exist.
ERROR: /Users/kanzashaikh/development/mediapipe/third_party/BUILD:178:6: //third_party:opencv_binary depends on #macos_opencv//:opencv in repository #macos_opencv which failed to fetch. no such package '#macos_opencv//': The repository's path is "/usr/local/opt/opencv#3" (absolute: "/usr/local/opt/opencv#3") but this directory does not exist.
ERROR: Analysis of target '//mediapipe/examples/desktop/hand_tracking:hand_tracking_cpu' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.194s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 237 targets co
nfigured)
How do I solve it?
before building desktop examples, you should setup opencv. also for android examples you should setup android sdk and ndk.
there is a builtin script for setting up opencv and you can execute it.
for setting up opencv:
bash setup_opencv.sh
and for android sdk and ndk:
bash setup_android_sdk_and_ndk.sh
I am assuming you are running a M1 machine, as Homebrew is now installing Intel binaries under /usr/local and ARM ones under /opt/homebrew.
In your case, when building, bazel is looking for opencv#3 package at /usr/local/opt/opencv#3 and immediately throws an error as the package is located at /opt/homebrew/opt/opencv#3.
Thus, you have two choices:
Open WORKSPACE file from your bazel project and modify the path for each package accordingly
Make a symbolic link to /opt/homebrew/opt in /usr/local by running: sudo ln -s /opt/homebrew/opt opt

Errors for building Tensorflow 1.8 from sources for C/C++ on MacOS High Sierra

When compiling Tensorflow from source with the following commands
brew install automake libtool
git clone https://github.com/tensorflow/tensorflow && cd tensorflow
git checkout r1.8
export ANDROID_TYPES="-D__ANDROID_TYPES_FULL__"
tensorflow/contrib/makefile/build_all_ios.sh
The following errors were thrown
In file included from /Users/xxx/tensorflow/tensorflow/contrib/makefile/downloads/eigen/unsupported/Eigen/CXX11/ThreadPool:58:
/Users/xxx/tensorflow/tensorflow/contrib/makefile/downloads/eigen/unsupported/Eigen/CXX11/src/ThreadPool/SimpleThreadPool.h:153:5: error:
thread-local storage is not supported for the current target
EIGEN_THREAD_LOCAL PerThread per_thread;
/Users/xxx/tensorflow/tensorflow/contrib/makefile/downloads/eigen/unsupported/Eigen/CXX11/src/ThreadPool/ThreadLocal.h:15:35: note:
expanded from macro 'EIGEN_THREAD_LOCAL'
#define EIGEN_THREAD_LOCAL static __thread
Is there any solution to fix this error? I tried to remove the whole folder and clone again but results the same error.

Installing python Github package error: package directory 'src' does not exist

I am new at installing external Github packages into python.
I successfully cloned a package by running the command
git clone https://github.com/vishnubob/python-midi.git
However, when I ran
python setup.py install
I received the error:
No sequencer available for 'win32' platform.
C:\Python27\lib\site-packages\setuptools\dist.py:341: UserWarning:
Normalizing 'v0.2.3' to '0.2.3'
normalized_version,
running install
running bdist_egg
running egg_info
creating midi.egg-info
writing midi.egg-info\PKG-INFO
writing top-level names to midi.egg-info\top_level.txt
writing dependency_links to midi.egg-info\dependency_links.txt
writing manifest file 'midi.egg-info\SOURCES.txt'
**error: package directory 'src' does not exist**
Is this a directory problem? And is there another approach to install this package (possible via pip)?
The readme on git hub has: "I am extremely interested in supporting OS-X and Win32 sequencers as well, but I need platform expert who can help me. Are you that person? Please contact me if you would like to help."
So it is simply not supported on Win32.

'Executable named git not found on path:' when running stack

After a recent change in the repository that I am working, I can no longer build. When trying to run any stack command, such as stack build, I get the following error:
$ stack build
Executable named git not found on path: ["/home/matthew/.stack/snapshots/x86_64-linux-nix/lts-8.23/8.0.2/bin","/nix/store/kikxl1m9gg1rh9yfi9ly9bkl39zdb6z7-postgresql-9.5.6/bin","/nix/store/xczvw3rlvr1ind8s88i7yx0vasl4gzxm-ghc-8.0.2/bin","/nix/store/sxngsdy5y53j8fkb912hbpgamb2bpv5q-patchelf-0.9/bin","/nix/store/9ngvanddznmrbf74cvy0pmrqimk3i56x-paxctl-0.9/bin","/nix/store/c07gdr6cm43j1cphadzafq185k711vx4-coreutils-8.26/bin","/nix/store/7pyzxi7k5l6nym972gi2nq8s9f9b2q0j-findutils-4.6.0/bin","/nix/store/gjwa02cchnj2r69dlqjixjmdn0ws7f1v-diffutils-3.5/bin","/nix/store/xk38vw7z7bfr8173vdwfrfamxqcaj7hi-gnused-4.4/bin","/nix/store/r6s8rcd28wsk4gwviyc93343bq5zwlqq-gnugrep-3.0/bin","/nix/store/bvs3nyfflhsb75cfn4ff2a6xnksdzx9f-gawk-4.1.3/bin","/nix/store/g3skr3kss1fqqzl5viyg178qbcp4cdky-gnutar-1.29/bin","/nix/store/kdx0bwfy20q6blpgpdb7psbn1y435r56-gzip-1.8/bin","/nix/store/f2fg211g8zy5k624dwx0g7z32cm148mr-bzip2-1.0.6.0.1-bin/bin","/nix/store/adjkz7lhgvl3y3hpkzfsmpk15f0jrnmr-gnumake-4.2.1/bin","/nix/store/lpk84rsbha199vm3k54498lqv2jswqj8-bash-4.4-p5/bin","/nix/store/1hdv6h68f7xy9k0lhxqf26saz0w0r39i-patch-2.7.5/bin","/nix/store/vkbh4xbgxvx3v9813d4kdwv8ggwrp038-xz-5.2.2-bin/bin"]
It seems that my stack program does not know the correct path to my git program.
How can I specify my git path to stack?
I have verified that I do have git installed at the following path.
$ which git
/nix/var/nix/profiles/default/bin/git
I am on nixos 17.03.
Edit.
I am sure that the stack build and which git commands were run in the same environment as they were run back to back in the same shell.
My path is
$ echo $PATH
/home/matthew/bin:/run/wrappers/bin:/run/wrappers/bin:/home/matthew/.nix-profile/bin:/home/matthew/.nix-profile/sbin:/home/matthew/.nix-profile/lib/kde4/libexec:/nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/nix/var/nix/profiles/default/lib/kde4/libexec:/run/current-system/sw/bin:/run/current-system/sw/sbin:/run/current-system/sw/lib/kde4/libexec
This shows the /nix/var/nix/profiles/default/bin is in the path, which contains git.
Also, in my stack.yaml file when I set system-ghc: true I get an 'access rights' error instead of the 'Executable named git not found' error.
$ stack build
Warning: /home/matthew/backup/azara_work/platform/api/stack.yaml: Unrecognized field in NixOptsMonoid: system-ghc
Cloning into '/home/matthew/backup/azara_work/platform/api/.stack-work/downloaded/4FnxEtHDACVR'...
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Process exited with ExitFailure 128: /nix/var/nix/profiles/default/bin/git clone --recursive git#github.com:seanhess/rollbar-haskell.git /home/matthew/backup/azara_work/platform/api/.stack-work/downloaded/4FnxEtHDACVR
Add this to either ~/.stack/config.yaml
or local stack.yaml (if it already has a nix: block)
nix:
enable: true
packages: [git]

Resources