Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 66 additions & 0 deletions .github/workflows/build_win.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: win-embedr-build

on:
workflow_dispatch:
push:
branches: [master]
pull_request:
branches: [master]
types: [opened, synchronize, reopened]
release:
types: [created]

jobs:
build-windows:
name: Windows 64-bit
runs-on: windows-latest

env:
BITS: 64
R_ARCH: x64
Q_ARCH: w64
R_HOME: C:\R

steps:
- name: Check out repository
uses: actions/checkout@v5

- name: Set up R
uses: r-lib/actions/setup-r@v2
with:
r-version: "4.4.2"

- name: Check
shell: cmd
run: |
dir C:\R
dir C:\R\bin
dir C:\R\bin\x64

- name: Build embedr.dll
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path w64 | Out-Null
& C:\R\bin\x64\R.exe CMD SHLIB -o "w64/embedr.dll" embedr.c src/w64/q.lib -lws2_32 -liphlpapi
if ($LASTEXITCODE -ne 0) { exit 1 }

- name: Package distribution
shell: pwsh
run: |
$version = "${{ github.ref_name }}" -replace '[\\/:*?"<>|]', '-'

New-Item -ItemType Directory -Force -Path embedr | Out-Null
Copy-Item "w64" -Destination ".\embedr\w64" -Recurse
Copy-Item rinit.q -Destination .\embedr
Copy-Item rtest.q -Destination .\embedr
Copy-Item LICENSE -Destination .\embedr\LICENSE.embedr
Copy-Item README.md -Destination .\embedr\README.embedr

7z a "embedr_win64-$version.zip" ".\embedr\*"

- name: Upload workflow artifact
uses: actions/upload-artifact@v4
with:
name: embedr_win64
path: embedr_win*.zip
if-no-files-found: error
46 changes: 0 additions & 46 deletions appveyor.yml

This file was deleted.

1 change: 1 addition & 0 deletions embedr.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <sys/socket.h>
//#include <unistd.h>
#else
#include <winsock2.h>
#include <windows.h>
#include <process.h>
#endif
Expand Down
14 changes: 7 additions & 7 deletions src/rserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -720,17 +720,17 @@ K ropen(K x)
s=Rf_initEmbeddedR(argc, argv);
if (s<0) return krr("open failed");
if(dumb_socketpair(spair, 1) == -1){
return krr("Init failed for socketpair");
}
return krr("Init failed for socketpair");
}
sd1(-spair[0], &processR);
#ifndef WIN32
pthread_t t;
if(pthread_create(&t, NULL, pingmain, NULL))
R krr("poller_thread");
pingthread= &t;
if(pthread_create(&t, NULL, pingmain, NULL))
R krr("poller_thread");
pingthread= &t;
#else
if(_beginthreadex(0,0,pingmain,NULL,0,0)==-1)
R krr("poller_thread");
if(_beginthreadex(0,0,pingmain,NULL,0,0)==-1)
R krr("poller_thread");
#endif
ROPEN=mode;
return ki(ROPEN);
Expand Down
2 changes: 0 additions & 2 deletions src/socketpair.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@
#include <string.h>

#ifdef WIN32
# include <winsock2.h>
# include <ws2tcpip.h>
# include <windows.h>
# include <io.h>
#else
# include <sys/types.h>
Expand Down
Loading