So I have this very simple script which just tries to create a text file and then read it.
version: 1.0.{build}-{branch}
shallow_clone: true
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
ARCH: x86_64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
ARCH: x86
install:
- if %ARCH% == x86 ( set TRIPLET=x86-windows ) else ( set TRIPLET=x64-windows )
- if %ARCH% == x86 ( set AM=32 ) else ( set AM=64 )
- git clone -b master --depth 1 https://github.com/boostorg/boost.git boost-root
- cd boost-root
build: off
test_script:
- set PATH=%ADDPATH%%PATH%
- |-
set VCPKG=%APPVEYOR_BUILD_FOLDER%\..\vcpkg\installed\%TRIPLET%
set "CHUNK=^<include^>%VCPKG%\include ^<search^>%VCPKG%\lib"
echo using zlib : : %CHUNK% ; > config.jam
echo using libjpeg : : %CHUNK% ; >> config.jam
echo using libpng : : ^<name^>libpng16 %CHUNK% ; >> config.jam
echo using libtiff : : %CHUNK% ; >> config.jam
more config.jam
When I run it I get the following error:
Cannot access file C:\projects\gil\boost-root\config.jam
Command exited with code 1
Is there something obviously wrong that I'm missing?
I think set "CHUNK=^<include^>%VCPKG%\include ^<search^>%VCPKG%\lib" breaks something in environment variables. Try moving first " after =, like set CHUNK="^<include^>%VCPKG%\include ^<search^>%VCPKG%\lib".
Related
I am trying to build libtorrent using b2 by following libtorrent building with boost build but I am facing this error when I do b2 install --prefix=PRIFIX:
LDFLAGS =
OS = LINUX
Jamfile:944: in install-paths
ERROR: rule "version.boost-build" unknown in module "Jamfile</home/pavan/projects/torrents/libtorrent_install/libtorrent-2.0.7>".
Jamfile:1063: in install-pkg-config
Jamfile:1094: in load-aux
/home/pavan/boost_install/boost_1_80_0/tools/build/src/build/project.jam:378: in load-jamfile
/home/pavan/boost_install/boost_1_80_0/tools/build/src/build/project.jam:64: in load
/home/pavan/boost_install/boost_1_80_0/tools/build/src/build/project.jam:142: in project.find
/home/pavan/boost_install/boost_1_80_0/tools/build/src/build-system.jam:618: in load
/home/pavan/boost_install/boost_1_80_0/tools/build/src/kernel/modules.jam:294: in import
/home/pavan/boost_install/boost_1_80_0/tools/build/src/kernel/bootstrap.jam:135: in module scope
pavan#pavan-B550-GAMING-X-V2:~/projects/torrents/libtorrent_install/libtorrent-2.0.7$ ls
after going through the line number in Jamfile (944) I can see this:
local boost-build-version = [ SPLIT_BY_CHARACTERS [ version.boost-build ] : "-" ] ;
I have followed the same steps on another machine I did not see this error, am I missing something ?
There was a change in boost-build in boost-1.80 where this way of accessing its version number was removed.
It was fixed here (but hasn't been released yet).
You can fix it by applying this patch:
--- a/Jamfile
+++ b/Jamfile
## -22,6 +22,8 ## ECHO "CXXFLAGS =" $(CXXFLAGS) ;
ECHO "LDFLAGS =" $(LDFLAGS) ;
ECHO "OS =" [ os.name ] ;
+jam-version = [ modules.peek : JAM_VERSION ] ;
+
if $(BOOST_ROOT)
{
ECHO "building boost from source directory: " $(BOOST_ROOT) ;
## -163,10 +165,11 ## rule linking ( properties * )
# which only works on ELF targets with gcc
result += <linkflags>-Wl,--export-dynamic <linkflags>-rdynamic ;
}
- else
+ else if [ version.version-less $(jam-version) : 1990 0 ]
{
- # backtraces don't work with visibility=hidden, so we only add that in
- # the else-block
+ # the visibility feature was introduced in boost-1.69. This was close to
+ # when the verisoning scheme changed from year to (low) version numbers.
+ # in boost-1.70
result += <visibility>hidden ;
}
## -941,8 +944,10 ## rule install-paths ( properties * )
# package.paths was introduced in boost-1.70 (2018.02)
# however, boost build's versioning scheme changed in boost-1.71 to version
# 4.0
- local boost-build-version = [ SPLIT_BY_CHARACTERS [ version.boost-build ] : "-" ] ;
- if [ version.version-less [ SPLIT_BY_CHARACTERS $(boost-build-version[1]) : "." ] : 2018 03 ]
+ # so, if versions are 4.0+ we want to use package.paths, but if it's a year,
+ # say 2018, that means it's old and we use the fallback below. Any version <
+ # 1990 is considered the 4.0 and later numbering scheme.
+ if [ version.version-less 1990 0 : $(jam-version) ]
{
import option ;
import property ;
I have a github action that wants to test if a specific path has been created, and I'm running into a problem where github has
USERNAME=runneradmin
TMP=C:\Users\RUNNER~1\AppData\Local\Temp
The test script (VIRTUAL_ENV is set by the activate.bat script):
echo on
set "WORKON_HOME=%TMP%\wo home %RANDOM%"
mkdir "%WORKON_HOME%"
cd /d "%WORKON_HOME%"
virtualenv "name with spaces"
cd "name with spaces"
call Scripts\activate.bat
if "%WORKON_HOME%\name with spaces"=="%VIRTUAL_ENV%" (
echo workon home and virtualenv are equal
) else (
echo. "%WORKON_HOME%\name with spaces" is not equal to "%VIRTUAL_ENV%"
)
if "%CD%"=="%VIRTUAL_ENV%" (
echo cd and virtualenv are equal
) else (
echo. "%CD%" is not equal to "%VIRTUAL_ENV%"
)
exit /b 1
The output is (the difference is RUNNER~1 vs runneradmin):
"C:\Users\RUNNER~1\AppData\Local\Temp\wo home 14549\name with spaces" is not equal to "C:\Users\runneradmin\AppData\Local\Temp\wo home 14549\name with spaces"
"C:\Users\RUNNER~1\AppData\Local\Temp\wo home 14549\name with spaces" is not equal to "C:\Users\runneradmin\AppData\Local\Temp\wo home 14549\name with spaces"
The action yaml for completeness:
name: BUG
on: [ push, pull_request, workflow_dispatch ]
jobs:
ci-test:
name: BUG
runs-on: windows-latest
steps:
- uses: actions/checkout#v2
- uses: actions/setup-python#v2
with:
python-version: 3.9
- run: pip install virtualenv
- shell: cmd
run: set
- name: Run tests
shell: cmd
run: |
tests\bug.bat
How can I make the paths compare equal?
I found an answer using a subroutine and the %~s1 magic string to get the 8.3 version of the file name:
echo on
set "WORKON_HOME=%TMP%\wo home %RANDOM%"
mkdir "%WORKON_HOME%"
cd /d "%WORKON_HOME%"
virtualenv "name with spaces"
cd "name with spaces"
call Scripts\activate.bat
call:shorten "%WORKON_HOME%\name with spaces",WO
call:shorten "%VIRTUAL_ENV%",VE
if "%WO%"=="%VE%" (
echo workon home and virtualenv are equal
) else (
echo. "%WORKON_HOME%\name with spaces" is not equal to "%VIRTUAL_ENV%"
)
goto:eof
:shorten
for %%T in ("%~s1") do set "%~2=%%T"
exit /b 0
Using MSYS2 and following Zsh on Windows via MSYS2 guide I installed Zsh shell on my Windows 10 Pro workstation. I installed Oh My Zsh! too via curl and powerlevel10k theme. Now I'd like to use this shell with new Windows Terminal (Preview) so in profiles.json I added this configuration:
{
"guid": "{00000000-0000-0000-bb55-000000000003}",
"acrylicOpacity" : 0.75,
"closeOnExit" : true,
"commandline" : "\"C:\\msys64\\usr\\bin\\zsh.exe\" -i -l",
"historySize" : 9001,
"icon" : "C:\\msys64\\mingw64\\share\\git\\git-for-windows.ico",
"name" : "Oh my Zsh!",
"padding" : "0, 0, 0, 0",
"snapOnInput" : true,
"startingDirectory" : "%USERPROFILE%",
"useAcrylic" : true
}
this works roughly but the prompt is not shown correctly and, every time I start the terminal, the following error is shown:
[ERROR]: gitstatus failed to initialize.
Your Git prompt may disappear or become slow.
Run the following command to retry with extra diagnostics:
GITSTATUS_LOG_LEVEL=DEBUG gitstatus_start POWERLEVEL9K
If this command produces no output, add the following parameter to ~/.zshrc:
GITSTATUS_LOG_LEVEL=DEBUG
With this parameter gitstatus will print additional information on error.
If i run GITSTATUS_LOG_LEVEL=DEBUG gitstatus_start POWERLEVEL9K, I get:
[ERROR]: gitstatus failed to initialize.
Your Git prompt may disappear or become slow.
The content of /tmp/gitstatus.197609.3944.1583052616.xtrace.log (gitstatus_start xtrace):
+(anon):7> (( ! _GITSTATUS_STATE_POWERLEVEL9K ))
+(anon):8> [[ -r /proc/version && 'MSYS_NT-10.0-19041 version 3.0.7-338.x86_64 (Alexx#WARLOCK) (gcc version 9.1.0 (GCC) ) 2019-07-11 10:58 UTC' == *Microsoft* ]]
+(anon):11> print -rn
+(anon):12> zsystem flock -f lock_fd /tmp/gitstatus.197609.3944.1583052616.lock
+(anon):13> [[ 14 == <1-> ]]
+(anon):15> typeset -gi '_GITSTATUS_LOCK_FD_POWERLEVEL9K=lock_fd'
+(anon):18> '(anon)' /proc/self/fd/16
+(anon):1> typeset -gi 'GITSTATUS_DAEMON_PID_POWERLEVEL9K=4011'
+(anon):2> sysopen -r -o cloexec -u resp_fd -- /proc/self/fd/16
+(anon):3> [[ 18 == <1-> ]]
+(anon):4> typeset -gi '_GITSTATUS_RESP_FD_POWERLEVEL9K=resp_fd'
+(anon):107> typeset -gi '_GITSTATUS_STATE_POWERLEVEL9K=1'
+(anon):110> (( ! async ))
+(anon):111> (( _GITSTATUS_CLIENT_PID_POWERLEVEL9K == sysparams[pid] ))
+(anon):113> local pgid
+(anon):114> (( 0 < 20 ))
+(anon):115> [[ -t 18 ]]
+(anon):116> sysread -s 20 -t 5.0000000000 -i 18 'pgid[$#pgid+1]'
+(anon):116> return
^ this command failed (5)
The content of /tmp/gitstatus.197609.3944.1583052616.daemon.log (gitstatus daemon log):
+(anon):20> local pgid=4011
+(anon):21> [[ 4011 == <1-> ]]
+(anon):91> (( lock_fd == -1 ))
+(anon):25> trap '' PIPE
+(anon):27> [[ -z '' ]]
+(anon):28> local kernel
+(anon):94> zsystem flock -- /tmp/gitstatus.197609.3944.1583052616.lock
+(anon):29> kernel=+(anon):29> uname -s
+(anon):29> kernel=msys_nt-10.0-19041
+(anon):30> [[ -n msys_nt-10.0-19041 ]]
+(anon):33> [[ '' == /* ]]
+(anon):35> (( 0 ))
+(anon):37> [[ -n '' ]]
+(anon):40> local os
+(anon):41> case msys_nt-10.0-19041 (linux)
+(anon):41> case msys_nt-10.0-19041 (cygwin_nt-*)
+(anon):41> case msys_nt-10.0-19041 (mingw | msys)
+(anon):41> case msys_nt-10.0-19041 (*)
+(anon):49> os=msys_nt-10.0-19041
+(anon):51> local arch
+(anon):52> arch=+(anon):52> uname -m
+(anon):52> arch=x86_64
+(anon):53> [[ -n x86_64 ]]
+(anon):54> local daemons=( /c/Users/icolumbro/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/usrbin/gitstatusd-msys_nt-10.0-19041-x86_64 /c/Users/icolumbro/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/usrbin/gitstatusd-msys_nt-10.0-19041-x86_64-static /c/Users/icolumbro/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/bin/gitstatusd-msys_nt-10.0-19041-x86_64 /c/Users/icolumbro/.oh-my-zsh/custom/themes/powerlevel10k/gitstatus/bin/gitstatusd-msys_nt-10.0-19041-x86_64-static )
+(anon):57> daemons=( )
+(anon):58> daemons=( )
+(anon):59> (( 0 ))
+(anon):59> return
+(anon):86> local -i ret=1
+(anon):87> kill -- -4011
Your system information:
zsh: 5.8
uname -a: MSYS_NT-10.0-19041 z800 3.0.7-338.x86_64 2019-07-11 10:58 UTC x86_64 Msys
If you need help, open an issue and attach this whole error message to it:
https://github.com/romkatv/gitstatus/issues/new
Can you help me to configure Windows Terminal to use Oh My Zsh! with powerlevel10k theme correctly, please?
I have Zsh installed on Windows natively based on MSYS2 too. It's not on the Virtual Machine guest nor the Windows Subsystem for Linux. So you can have the best performance with the Linux shell on Windows, native compilers for Windows, tight engagement with the OS, and many other benefits.
The steps of setting up the environment are documented on the README of my dotfiles. I'm not going to copy the steps here as the paragraph is long and I don't want to go through it again just for converting the format for Stack Overflow. Please follow the section prerequisite for Windows and installation. I'm sure you can set it up properly on your machine as I built this document on Windows 10 and just tested it on a fresh installed Windows 11.
I have been trying to source this script from Xilinx install but it outputs an error.
source /opt/Xilinx/14.7/ISE_DS/settings32.csh
# Copyright (c) 1995-2013 Xilinx, Inc. All rights reserved.
set SETTINGS_FILE=.settings32.csh
set XIL_SCRIPT_LOC="/opt/Xilinx/14.7/ISE_DS"
if ( $# != 0 ) then
# The first argument is the location of Xilinx Installation.
# Don't detect the installation location.
set XIL_SCRIPT_LOC="$1"
else
# XIL_SCRIPT_LOC should point to script location
set XIL_SCRIPT_LOC_TMP_UNI=`echo $_ | cut -d" " -f 2`
set XIL_SCRIPT_LOC_TMP_UNI_TAIL=${XIL_SCRIPT_LOC_TMP_UNI:t}
set XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC_TMP_UNI:h}
if ( "$XIL_SCRIPT_LOC_TMP_UNI" != "" ) then
if ( "$XIL_SCRIPT_LOC_TMP_UNI" == "$XIL_SCRIPT_LOC_TMP_UNI_TAIL" ) then
set XIL_SCRIPT_LOC_TMP_UNI="./"
endif
set XIL_SCRIPT_LOC_TMP_UNI=`readlink -f ${XIL_SCRIPT_LOC_TMP_UNI}`
if ( $? == 0 ) then
set XIL_SCRIPT_LOC=${XIL_SCRIPT_LOC_TMP_UNI}
endif
endif
unset XIL_SCRIPT_LOC_TMP_UNI_TAIL
unset XIL_SCRIPT_LOC_TMP_UNI
endif
set xlnxInstLocList=""
set xlnxInstLocList="${xlnxInstLocList} common"
set xlnxInstLocList="${xlnxInstLocList} EDK"
set xlnxInstLocList="${xlnxInstLocList} PlanAhead"
set xlnxInstLocList="${xlnxInstLocList} ISE"
set XIL_SCRIPT_LOC_TMP_UNI=${XIL_SCRIPT_LOC}
foreach i $( xlnxInstLocList )
set d="${XIL_SCRIPT_LOC_TMP_UNI}/$i"
set sfn="$d/$SETTINGS_FILE"
if ( -e "$sfn" ) then
echo source "$sfn" "$d"
source "$sfn" "$d"
endif
end
bash: /opt/Xilinx/14.7/ISE_DS/settings32.csh: line 42: syntax error:
unexpected end of file
Can someone see the error in the script?
I'm trying to compile the bitcoin client for windows from ubutno but everytime I try to build it I keep getting this error:
/usr/lib/ruby/1.9.1/psych.rb:207:in `parse': (../bitcoin/contrib/gitian-descriptors/boost-win32.yml): could not find expected ':' while scanning a simple key at line 21 column 1 (Psych::SyntaxError)
I have investigated a bit about it and found that this is normally caused by some typo in the YML file. However I hardly know anything about ruby and was hoping that some of you guys could help me solve this problem.
My yml file is:
---
name: "boost"
suites:
- "lucid"
architectures:
- "i386"
packages:
- "mingw32"
- "faketime"
- "zip"
reference_datetime: "2011-01-30 00:00:00"
remotes: []
files:
- "boost_1_49_0.tar.bz2"
script: |
TMPDIR="$HOME/tmpdir"
mkdir -p $TMPDIR/bin/$GBUILD_BITS $TMPDIR/include
tar xjf boost_1_49_0.tar.bz2
cd boost_1_49_0
echo "--- tmp_dir_helpers.orig.hpp 2012-06-10 01:39:25.403268210 +0200
+++ tmp_dir_helpers.hpp 2012-06-10 01:41:14.653823479 +0200
## -19,9 +19,9 ##
#include <string>
#if defined(BOOST_INTERPROCESS_WINDOWS)
- //#define BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME
- //#define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
- //#include <boost/interprocess/detail/win32_api.hpp>
+ #define BOOST_INTERPROCESS_HAS_WINDOWS_KERNEL_BOOTTIME
+ #define BOOST_INTERPROCESS_HAS_KERNEL_BOOTTIME
+ #include <boost/interprocess/detail/win32_api.hpp>
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
//#include <sys/sysctl.h>
//#if defined(CTL_KERN) && defined (KERN_BOOTTIME)" > useboottime.patch
patch boost/interprocess/detail/tmp_dir_helpers.hpp useboottime.patch
echo "using gcc : 4.4 : i586-mingw32msvc-g++
:
<rc>i586-mingw32msvc-windres
<archiver>i586-mingw32msvc-ar
<cxxflags>-frandom-seed=boost1
;" > user-config.jam
./bootstrap.sh --without-icu
./bjam toolset=gcc target-os=windows threadapi=win32 threading=multi variant=release link=static --user-config=user-config.jam --without-mpi --without-python -sNO_BZIP2=1 -sNO_ZLIB=1 --layout=tagged --build-type=complete $MAKEOPTS stage
for lib in chrono date_time exception filesystem graph iostreams math_c99f math_c99l math_c99 math_tr1f math_tr1l math_tr1 prg_exec_monitor program_options random regex serialization signals system test_exec_monitor thread_win32 unit_test_framework wave wserialization; do
mkdir $lib
(cd $lib ; ar xf ../stage/lib/libboost_${lib}-mt-s.a)
mv $lib $TMPDIR/bin/$GBUILD_BITS
done
cp -a boost $TMPDIR/include
cd $TMPDIR
export LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1
export FAKETIME=$REFERENCE_DATETIME
zip -r boost-win32-1.49.0-gitian2.zip *
cp boost-win32-1.49.0-gitian2.zip $OUTDIR
Thank you in advance and sorry if I'm asking to much :)
Edit:
by the way, I'm using Ruby 1.9.1 and my machine is running Ubuntu 13.0