Write a text file in Appveyor script - command-line

I have a problem when writing a simple text file with appveyor. Here is the simple script:
version: 1.0.{build}-{branch}
shallow_clone: true
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
TOOLSET: msvc-14.1
ARCH: x86_64
install:
build: off
test_script:
- echo ^<Where are my symbols^> > hello.txt
- more hello.txt
This leads to an error in the console:
Build started
Fetching repository commit (2be7d4b)...OK
Total: 274 bytes in 1 files
echo ^<Where are my symbols^> > hello.txt
Command exited with code 1
I have tried the commands in on desktop but everything is working.

This escape symbol will not work this way because internally we use call before your cmd when executing command from the custom PowerShell host.
Workarounds:
Use PowerShell
test_script:
- ps: Set-Content -Value "<Where are my symbols>" -Path .\hello.txt
- more hello.txt
Check-in .cmd file with your command which uses ^ escape symbol and run it.

Related

Deno: Denon installation with fish in mac

Using fish for the installation of denon don't recognize it
steps:
Open fish terminal
deno install -qAf --unstable https://deno.land/x/denon/denon.ts
export PATH="/Users/user/.deno/bin:$PATH"
denon --init
output:
fish: Unknown command: denon
Deno version:
deno 1.28.3 (release, x86_64-apple-darwin)
v8 10.9.194.5
typescript 4.8.3
Denon 2.5.0
Solution:
export PATH="/Users/user/.deno/bin:$PATH"  ✔  ⬢ 16.17.0 
source ~/.profile
you could get the next error:
~/.cargo/env (line 4): 'case' builtin not inside of switch block
case ":${PATH}:" in
^
from sourcing file ~/.cargo/env
called on line 1 of file ~/.profile
from sourcing file ~/.profile
.: Error while reading file '/Users/user/.cargo/env'
go to .config/fish/
and nano config.fish
and paste the next exports so, it looks like this:
if status is-interactive
# Commands to run in interactive sessions can go here
export PATH="$HOME/.cargo/bin:$PATH"
export PATH="/Users/user/.deno/bin:$PATH"
end

Why Github workflows doesn't recognize command?

I built a github workflow and for some reason it doesn't recognize the dita.bat file as a command. All the files are present in the repo and checkout is performed.
Error:
ant
ant.bat
dita
dita.bat
sudo: ./dita.bat: command not found
Error: Process completed with exit code 1.
Github workflow step:
- name: Build WebHelp Responsive
run: |
cd oxygen-publishing-engine-3.x/bin
ls
sudo ./dita.bat --input=../../doc/project-documentation/search-service-
doc.ditamap --format=webhelp-responsive -
Dwebhelp.publishing.template=../../templates/webhelp-documentation-template --
output=../../doc/project-documentation/out
Please add chmod +x filename before calling your script.

VS Code and pytest: Where is the default junit-xml output path defined and why is there one?

I am trying to run a debug the tests of my Python project inside the VS Code interface.
I followed the instruction from VS Code's website using pytest but when trying to run a test the output fails:
============================= test session starts =============================
platform win32 -- Python 3.8.10, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: c:\Users\myUserName\Projects\myProjectName
plugins: localserver-0.5.0
collected 1 item
myProjectName\tests\test_static_analysis.py . [100%]
- generated xml file: C:\Users\MYUSERNAME\AppData\Local\Temp\tmp-26696NTXW7ChqfMEN.xml
-
============================== 1 passed in 0.18s ==============================
Error: Error: cannot open file:///c%3A/Users/myUserName/Projects/myProjectName/C. Detail:
Unable to read file 'c:\Users\myUserName\Projects\myProjectName\C' (Error: Unable to resolve
non-existing file 'c:\Users\myUserName\Projects\myProjectName\C')
Error: Error: cannot open file:///c%3A/Users/myUserName/Projects/myProjectName/C. Detail:
Unable to read file 'c:\Users\myUserName\Projects\myProjectName\C' (Error: Unable to resolve
non-existing file 'c:\Users\myUserName\Projects\myProjectName\C')
Maybe VS Code doesn't have the authorization to write in AppData.
What concerns me is why is VS Code launching pytest with a junit-xml output option?
The command actually executed by VS Code is:
c:; cd 'c:\Users\myUserName\Projects\myProjectName'; & 'C:\ProgramData\Anaconda3\envs\venv-myProjectName\python.exe' 'c:\Users\myUserName\.vscode\extensions\ms-python.python-2021.8.1105858891\pythonFiles\lib\python\debugpy\launcher' '53774' '--' 'c:\Users\myUserName\.vscode\extensions\ms-python.python-2021.8.1105858891\pythonFiles\testlauncher.py' 'c:\Users\myUserName\Projects\myProjectName' 'pytest' '--override-ini' 'junit_family=xunit1' '--rootdir' 'c:\Users\myUserName\Projects\myProjectName' '--junit-xml=C:\Users\MYUSERNAME\AppData\Local\Temp\tmp-26696pYh1w3pF2cXx.xml' './myProjectName/tests/test_static_analysis.py::TestStaticAnalysisVesselForceOnLateralCenter::test_pos_surge_on_vessel'
When going in Settings > python.testing.pytestArgs it is empty.
Where is this output path defined?
How can I change it to be in the local working directory?
Do I need to have a junit-xml output? Is it mandatory for VS Code UI to work?

How do I pipe input to a command using powershell in a Dockerfile?

I'm trying to write a Dockerfile to build a windows image containing the android sdk.
During the installation of the sdk, the sdkmanager requires you to enter 'y' several times to accept licenses before continuing. I've been able to automate this in a normal powershell outside docker with the following line:
"y`n" * 8 | & '.\bin\sdkmanager.bat' --licenses
However, when I try to put this in the Dockerfile, it doesn't work. The sdkmanager ignores the input and just exits immediately at the first prompt.
Dockerfile (the triple quotes seem necessary to prevent them being stripped):
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2016
RUN iwr -UseBasicParsing https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip -OutFile sdk-tools.zip
RUN Expand-Archive sdk-tools.zip 'C:\Program Files (x86)\Android\android-sdk'
RUN """y`n""" * 8 | & 'C:\Program Files (x86)\Android\android-sdk\tools\bin\sdkmanager.bat' --licenses
RUN & 'C:\Program Files (x86)\Android\android-sdk\tools\bin\sdkmanager.bat' tools platform-tools
Output:
Step 7/14 : RUN iwr -UseBasicParsing https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip -OutFile sdk-tools.zip
---> Using cache
---> dfb0b47e99b8
Step 8/14 : RUN Expand-Archive sdk-tools.zip 'C:\Program Files (x86)\Android\android-sdk'
---> Using cache
---> a87ab84f86d0
Step 9/14 : RUN """y`n""" | & 'C:\Program Files (x86)\Android\android-sdk\tools\bin\sdkmanager.bat' --licenses
---> Running in b5caf5584ba3
Warning: File C:\Users\ContainerAdministrator\.android\repositories.cfg could not be loaded.
7 of 7 SDK package licenses not accepted. 100% Computing updates...
Review licenses that have not been accepted (y/N)?
Removing intermediate container b5caf5584ba3
---> 2d88d3c72d9a
Step 10/14 : RUN & 'C:\Program Files (x86)\Android\android-sdk\tools\bin\sdkmanager.bat' tools platform-tools
---> Running in 27e8f5e804e9
I assume this is maybe a docker build limitation where it doesn't wait for user input. Is there any way around this?

OmniORB compilation error Windows 7 64 bit

Has anyone encountered the error below when compiling omniORB_4.1.6 64-bit for windows?
'RegQueryValueEx failed - error 109'
I followed the procedure in the readme.win32 and I get linking errors in the omniDyamic, codesets etc.. So someone suggested to rebuild the omniorb_root/src/tools/win32 and copy it in bin/x86_win32/. That's what I did and when I recompile the whole omniORB, the error is as below:
../../../../bin/x86_win32/omkdepend -D__cplusplus -D_MSC_VER -DIDLMODULE_VERSION
="0x2630" -DMSDOS -DOMNIIDL_EXECUTABLE -Ic:/python27/include -Ic:/python27/PC -I
c:/python27/include/python2.7 -DPYTHON_INCLUDE=<Python.h> -I. -I. -I../../../../
include -D__WIN32__ -D_WIN32_WINNT=0x0501 -D__x86__ -D__NT__ -D__OSVERSION__=4 -
D_CRT_SECURE_NO_DEPRECATE=1 idlc.cc idlpython.cc idlfixed.cc idlconfig.cc idldum
p.cc idlvalidate.cc idlast.cc idlexpr.cc idlscope.cc idlrepoId.cc idltype.cc idl
util.cc idlerr.cc lex.yy.cc y.tab.cc
RegQueryValueEx failed - error 109
-----------------------------------------------------------------------------------------------
make[4]: Entering directory `/cygdrive/c/Software/COTS/omniORB/omniORB_4.1.6/src
/tool/omniidl/cxx/cccp'
../../../../../bin/x86_win32/clwrapper -gnuwin32 -c -O2 -MD -GS -GR -Zi -nologo
-DHAVE_CONFIG_H -I. -I. -I. -I../../../../../include -D__WIN32__ -D_WIN32_WINNT=
0x0501 -D__x86__ -D__NT__ -D__OSVERSION__=4 -D_CRT_SECURE_NO_DEPRECATE=1 -Focexp
.o cexp.c
RegQueryValueEx failed - error 109
I'm going to answer my own question because it seems nobody has encountered this problem, and the mailing list is so quiet.
Someone suggested to me to recompile the src\tools\win32. So that's what I did and I copied the .exe files generated to bin\x86_win32.
I then compiled all the omniORB and get the RegQueryValueEx error.
The reason for this is when you check the src\tools\win32\bccwrapper.c in the void GetMounts(void) function,
it looks for this path in the registry:
Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\%02X.
When I checked that using regedit, I noticed that in the mounts->00, 01, 02, 03 etc.. keys, there are no 'unix' and 'native' string values inside those keys.
So I decided to delete all the keys and retained just the 00 and added a 'unix' and 'native' string value.
After which, I recompiled the src\tools\win32 and copied over the created .exe files to bin\x86_win32 and finally when I recompiled all the omniOrb, it started compiling (need to copy the ssl libs too) and finished successfully.
I really don't even know how the following got into my registry:
Software\Cygnus Solutions\CYGWIN.DLL setup\b15.0\mounts\%02X.
Best regards,
Mark
I spent quite some time trying to compile OmniORB on windows 10 with visual studio 2017.
Assuming Cygwin64 was installed in directory
c:\software\cygwin64
, the compilation of OmniORB is quite straightforward:
open a command terminal (cmd)
in that terminal, setup the Visual environment:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
then, append the PATH (yes append and not prepend):
set PATH=%PATH%;c:\software\cygwin64\bin
then, in file config\config.mk, uncomment this line
platform = x86_win32_vs_15
in file platforms\x86_win32_vs_15, set PYTHON to target the python executable, in my case Python 3.6.5
PYTHON = /cygdrive/c/software/Python/python
finally start the compilation with make:
make export
Hope this helps.