Skip to content
Merged
Show file tree
Hide file tree
Changes from 15 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
65 changes: 64 additions & 1 deletion .github/workflows/Ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,42 @@ jobs:
cling-version: '1.0'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-arm-gcc12-clang-repl-19
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '19'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-arm-gcc12-clang-repl-18
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '18'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-arm-gcc12-clang-repl-17
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '17'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-arm-gcc12-clang-repl-16
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '16'
cling: Off
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"
- name: ubu24-arm-gcc9-clang13-cling
os: ubuntu-24.04-arm
compiler: gcc-9
clang-runtime: '13'
cling: On
cling-version: '1.0'
llvm_enable_projects: "clang"
llvm_targets_to_build: "host;NVPTX"

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -337,6 +373,33 @@ jobs:
clang-runtime: '13'
cling: On
cling-version: '1.0'
- name: ubu24-arm-gcc12-clang-repl-19
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '19'
cling: Off
- name: ubu24-arm-gcc12-clang-repl-18
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '18'
cling: Off
- name: ubu24-arm-gcc12-clang-repl-17
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '17'
cling: Off
- name: ubu24-arm-gcc12-clang-repl-16
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '16'
cling: Off
cppyy: Off
- name: ubu24-arm-gcc9-clang13-cling
os: ubuntu-24.04-arm
compiler: gcc-9
clang-runtime: '13'
cling: On
cling-version: '1.0'

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -403,7 +466,7 @@ jobs:
sudo apt-get update
sudo apt-get install git g++ debhelper devscripts gnupg python3 doxygen graphviz python3-sphinx
sudo apt-get install -y libc6-dbg
sudo snap install valgrind
sudo apt-get install valgrind
sudo apt autoremove
sudo apt clean
# Install libraries used by the cppyy test suite
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/emscripten.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ jobs:
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.45"
- name: ubu24-arm-gcc12-clang-repl-19-emscripten
os: ubuntu-24.04-arm
compiler: gcc-12
clang-runtime: '19'
cling: Off
llvm_enable_projects: "clang;lld"
llvm_targets_to_build: "WebAssembly"
emsdk_ver: "3.1.45"
- name: osx15-arm-clang-clang-repl-19-emscripten
os: macos-15
compiler: clang
Expand Down
32 changes: 19 additions & 13 deletions lib/Interpreter/CppInterOp.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2828,7 +2828,11 @@ namespace Cpp {
#define DEBUG_TYPE "exec"

std::array<char, 256> buffer;
std::unique_ptr<FILE, decltype(&pclose)> pipe(popen(cmd, "r"), pclose);
struct file_deleter {
void operator()(FILE* fp) { pclose(fp); }
};
using file_pointer = std::unique_ptr<FILE, file_deleter>;
file_pointer pipe{popen(cmd, "r")};
LLVM_DEBUG(dbgs() << "Executing command '" << cmd << "'\n");

if (!pipe) {
Expand Down Expand Up @@ -3437,26 +3441,28 @@ namespace Cpp {
}

class StreamCaptureInfo {
std::unique_ptr<FILE, decltype(std::fclose)*> m_TempFile;
struct file_deleter {
void operator()(FILE* fp) { pclose(fp); }
};
using file_pointer = std::unique_ptr<FILE, file_deleter>;
file_pointer m_TempFile;
int m_FD = -1;
int m_DupFD = -1;

public:
#ifdef _MSC_VER
StreamCaptureInfo(int FD)
: m_TempFile(
[]() {
FILE* stream = nullptr;
errno_t err;
err = tmpfile_s(&stream);
if (err)
printf("Cannot create temporary file!\n");
return stream;
}(),
std::fclose),
: m_TempFile(file_pointer{[]() {
FILE* stream = nullptr;
errno_t err;
err = tmpfile_s(&stream);
if (err)
printf("Cannot create temporary file!\n");
return stream;
}()}),
m_FD(FD) {
#else
StreamCaptureInfo(int FD) : m_TempFile(tmpfile(), std::fclose), m_FD(FD) {
StreamCaptureInfo(int FD) : m_TempFile(file_pointer{tmpfile()}), m_FD(FD) {
#endif
if (!m_TempFile) {
perror("StreamCaptureInfo: Unable to create temp file");
Expand Down
Loading