egor-tensin / setup-cygwin Goto Github PK
View Code? Open in Web Editor NEWGitHub action to set up Cygwin
License: MIT License
GitHub action to set up Cygwin
License: MIT License
Hi!
I am using this Github action for the Exiv2 project. Few days ago I noticed that the Cygwin builds started to fail, and when I compare the failing jobs:
https://github.com/Exiv2/exiv2/actions/runs/3365823530/jobs/5585304895
With the non failing ones from 1 week ago:
https://github.com/Exiv2/exiv2/actions/runs/3332745648/jobs/5513973618
The only different that I see is that apparently chocolatey got upgraded from version 1.1.0 to 1.2.0. The error is not very informative and just says this:
Chocolatey installed 0/0 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
The system cannot find the file specified
Error: Process completed with exit code 1.
The pipeline can be found here: https://github.com/Exiv2/exiv2/blob/dc5dc0d2e39aba87e38cda8378ffd90b833877a6/.github/workflows/on_PR_windows_matrix.yml#L165
Do you know what could be happening? Or any other feedback that could help me to fix this situation?
Thanks in advance for your time and for this nice github action :)
I suspect this is a bug with Chocolatey, but I'm not managing to work out what's going on well enough, or to reproduce the problem without using this GitHub Action, so I'm reporting this here in the hope we can work out what's going on.
Clearest example of the problem is at https://github.com/me-and/Cygwin-Git/actions/runs/441220070: I've used the action in this repository to install zlib-devel in the "Install Cygwin" job. However if you look at the cygcheck.out file, which is generated in the "Generate cygcheck output" job and stored as an artefact in "cyg-install-logs", you can see the package isn't listed in the set of installed packages.
Looking through the installation logs, everything seems to be reporting itself as successful, and in particular the logs from Chocolatey seem to show it attempting to install the zlib-devel package, running the Cygwin installer, which doesn't seem to meaningfully do anything, and reports success.
Had to remove the --login
option, otherwise the working directory is changed, even w/ --norc
specified:
Run cmake -GNinja \
cmake -GNinja \
-S . -B build
cmake --build build
shell: C:\tools\cygwin\bin\bash.exe --login --norc -o igncr '{0}'
env:
CYGWIN:
Copying skeleton files.
These files are for the users to personalise their cygwin experience.
They will never be overwritten nor automatically updated.
'./.bashrc' -> '/home/runneradmin//.bashrc'
'./.bash_profile' -> '/home/runneradmin//.bash_profile'
'./.inputrc' -> '/home/runneradmin//.inputrc'
'./.profile' -> '/home/runneradmin//.profile'
CMake Error: The source directory "/home/runneradmin" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
Error: /home/runneradmin/build is not a directory
Error: Process completed with exit code 1.
If we cache cygwin packages, we can speed up CI process and save bandwidth for kernel.org
I tried https://github.com/Endle/wine-mono/blob/940e19c2abbc576f597e924270812721638b8eb1/.github/workflows/c-cpp.yml#L13 but t didn't work
- name: Get Date
id: get-date
run: |
echo "::set-output name=date::$(/bin/date -u "+%Y%m%d")"
echo "::set-output name=time::$(/bin/date -u "+%H%M%S")"
shell: bash
- name: Cache Cygwin
uses: actions/cache@v2
env:
cache-name: cache-cygwin-packages
with:
path: /cygdrive/c/tools/cygwin/packages
key: ${{ runner.os }}-${{ env.cache-name }}-${{ steps.get-date.outputs.date }}-${{ steps.get-date.outputs.time }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-${{ steps.get-date.outputs.date }}-
${{ runner.os }}-${{ env.cache-name }}-
thanks
Set up Cygwin
Chocolatey v2.2.2
Installing the following packages:
chocolatey
By installing, you accept licenses for the packages.
Invalid credentials specified.
Please provide credentials for: https://community.chocolatey.org/api/v2/
User name: Password: Chocolatey had an error on fv-az1565-626 (with user runneradmin):
System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
at System.Console.ReadKey(Boolean intercept)
at chocolatey.infrastructure.commandline.ReadKeyTimeout.ConsoleReadKey()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Unhandled Exception: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
at System.Console.ReadKey(Boolean intercept)
at chocolatey.infrastructure.commandline.ReadKeyTimeout.ConsoleReadKey()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Chocolatey v2.2.2
Upgrading the following packages:
cygwin
By upgrading, you accept licenses for the packages.
cygwin is not installed. Installing...
Invalid credentials specified.
Please provide credentials for: https://community.chocolatey.org/api/v2/
User name: Password: Chocolatey had an error on fv-az1565-626 (with user runneradmin):
System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
at System.Console.ReadKey(Boolean intercept)
at chocolatey.infrastructure.commandline.ReadKeyTimeout.ConsoleReadKey()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Unhandled Exception: System.InvalidOperationException: Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.
at System.Console.ReadKey(Boolean intercept)
at chocolatey.infrastructure.commandline.ReadKeyTimeout.ConsoleReadKey()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Chocolatey v2.2.2
Installing the following packages:
make;gcc-g++;zlib-devel
By installing, you accept licenses for the packages.
Invalid credentials specified.
Invalid credentials specified.
Invalid credentials specified.
Unable to connect to source 'https://community.chocolatey.org/api/v2/':
Failed to fetch results from V2 feed at 'https://community.chocolatey.org/api/v2/Packages()?$filter=tolower(Id)%20eq%20'cygwin'&semVerLevel=2.0.0' with following message : Response status code does not indicate success: 403 (Forbidden).
cygwin not installed. The package was not found with the source(s) listed.
Source(s): 'https://community.chocolatey.org/api/v2/'
NOTE: When you specify explicit sources, it overrides default sources.
If the package version is a prerelease and you didn't specify `--pre`,
the package may not be found.
Please see https://docs.chocolatey.org/en-us/troubleshooting for more
assistance.
Chocolatey installed 0/0 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
The system cannot find the file specified
Error: Process completed with exit code 1.
I would like to build a Python/C extension module for windows using cygwin and Gitbub actions.
Additionally to python3
there are only two things I need, gnu make
and gcc
.
As an initial step I created a minimal workflow. That fails miserably, after countless iterations.
Could you please help me with this problem, thanks.
Hi,
I'm the Cygwin maintainer for Git, and I'm trying to set up GitHub Actions to do CI-style builds, rather than my current manual build process, and for that I've been playing with this action. Unfortunately, this action currently causes the cygport unpack
build stage to fail for the Git project, because it sets CYGWIN=winsymlinks:nativestrict
. See https://github.com/me-and/Cygwin-Git/runs/1601065913 for an example of the failure.
I've been experimenting over at me-and/setup-cygwin@7119423 and confirmed that removing that symlinking behaviour gets the builds working as expected for my use case.
I can see three obvious-to-me approaches, all of which I'm happy with, but I'd like to know what you'd prefer before I submit a PR:
Add a new "CYGWINENV" input that defaults to an empty string, and sets the CYGWIN
environment variable to whatever it's configured with. This would not be back-compatible, but seems most likely to cause minimal surprise to people who are expecting Cygwin's default behaviour except when they've deliberately asked for something else.
Add a new "CYGWINENV" input that defaults to winsymlinks:nativestrict
but otherwise works as per the previous point. In my opinion this would violate the principle of least surprise, but would not require a backwards-incompatible change.
Don't make any changes, in which case I'll maintain my fork, probably taking option 1 above.
If you let me know which you prefer, I'll submit a PR with the relevant changes :)
Proof of concept:
on:
push:
branches: [ develop,cygwin ]
pull_request:
branches: [ develop ]
workflow_dispatch:
jobs:
win-build-upstream-mono:
runs-on: windows-2019
steps:
- uses: actions/checkout@v2
- name: Set up Cygwin
uses: egor-tensin/setup-cygwin@v3
with:
platform: x64
packages: git unzip
- name: check env
shell: bash
run: |
ls
pwd
ls -a
I have such error:
Run ls
ls
pwd
ls -a
shell: C:\tools\cygwin\bin\bash.EXE --noprofile -e -o pipefail {0}
env:
CYGWIN:
D:\a\_temp\a2ea1fad-fdcb-46f8-8a2c-62d654473fda: line 1: $'ls\r': command not found
Error: Process completed with exit code 127.
When using the action today, the output is:
[NuGet] One or more unresolved package dependency constraints detected in the Chocolatey lib folder. All dependency constraints must be resolved to add or update packages. If these packages are being updated this message may be ignored, if not the following error(s) may be blocking the current package operation: 'apache-httpd 2.4.55 constraint: chocolatey (>= 1.2.0)', 'cmake.install 3.27.4 constraint: chocolatey (>= 0.10.5)', 'php 8.2.10 constraint: chocolatey (>= 0.10.0)'
Unable to resolve dependency 'chocolatey': Unable to resolve dependencies. 'chocolatey 1.1.0' is not compatible with 'apache-httpd 2.4.55 constraint: chocolatey (>= 1.2.0)'.
Does it really try to install chocolatey itself?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.