Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CDT setup for new branch name of cdt-lsp #984

Merged
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
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Dockerfile text
*.yaml text
*.yml text
.dockerignore text
uid_entrypoint text

# Qt
*.pro text
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-cleanliness.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Run Check Code Cleanliness with Docker
uses: addnab/docker-run-action@v3
with:
image: quay.io/eclipse-cdt/cdt-infra-plus-eclipse-install-github@sha256:6949adee26f78e9968e16d52bc3accfd7b51d0f16c473ad4b6f1caee849ab519
image: quay.io/eclipse-cdt/cdt-infra-github@sha256:3d745b7b84e3f9f9492cc1d280ea3b44028a92c7e9748d1ea8771fed211b5dc4
options: -v ${{ github.workspace }}:/work
run: |
set -x
Expand Down
4 changes: 2 additions & 2 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ To build CDT plug-ins you need a standard Maven & Java development environment.
The CI build automatically run code cleanliness checks. To run them on your computer it is recommended to use the Docker image, for example like this from the root of the checked out CDT repo:

```sh
docker run --rm -it -v $(git rev-parse --show-toplevel):/work -w /work/$(git rev-parse --show-prefix) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined quay.io/eclipse-cdt/cdt-infra-plus-eclipse-install:latest releng/scripts/check_code_cleanliness.sh
docker run --rm -it -v $(git rev-parse --show-toplevel):/work -w /work/$(git rev-parse --show-prefix) --cap-add=SYS_PTRACE --security-opt seccomp=unconfined quay.io/eclipse-cdt/cdt-infra:latest releng/scripts/check_code_cleanliness.sh
```

### Profiles
Expand Down Expand Up @@ -160,7 +160,7 @@ An additional tip is to set the following in `.gitconfig` to allow you to diff `

When the host is Windows, getting docker to behave as encoded in the pom.xml may be challenging, instead a command like this will probably work (replace your path to git root). Note that running this in git bash causes problems because of the /work in the command line arguments. (TODO integrate this command line way of running into the pom.xml so the original instructions work.)

`docker 'run' '--rm' '-t' '-v' 'D:\cdt\git\org.eclipse.cdt:/work' '-w' '/work/core/org.eclipse.cdt.core.native' 'quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest' 'make' '-C' 'native_src' 'rebuild'`
`docker 'run' '--rm' '-t' '-v' 'D:\cdt\git\org.eclipse.cdt:/work' '-w' '/work/core/org.eclipse.cdt.core.native' 'quay.io/eclipse-cdt/cdt-infra:latest' 'make' '-C' 'native_src' 'rebuild'`

See also `jniheaders` profile above.

6 changes: 6 additions & 0 deletions NewAndNoteworthy/CDT-12.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ This is the New & Noteworthy page for CDT 12.0 which is part of Eclipse 2025-03

# Release Notes

## Minimum version of GLIBC required

The minimum version of GLIBC required is now 2.31.
This version can be found in Ubuntu 20.04 and later, RHEL 9.0 and later and other distros as well.
CDT's native components will likely work with older versions of glibc too, assuming they provide the required APIs for Eclipse CDT.

# Managed Build

## Other objects for GNU archive files
Expand Down
Binary file not shown.
Binary file not shown.
Binary file modified core/org.eclipse.cdt.core.linux.ppc64le/os/linux/ppc64le/libpty.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified core/org.eclipse.cdt.core.macosx/os/macosx/aarch64/libpty.jnilib
Binary file not shown.
Binary file not shown.
Binary file modified core/org.eclipse.cdt.core.macosx/os/macosx/x86_64/libpty.jnilib
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion core/org.eclipse.cdt.core.native/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.core.native;singleton:=true
Bundle-Version: 6.3.500.qualifier
Bundle-Version: 6.3.600.qualifier
Bundle-Activator: org.eclipse.cdt.internal.core.natives.CNativePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Expand Down
2 changes: 2 additions & 0 deletions core/org.eclipse.cdt.core.native/native_src/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.o
*.obj
38 changes: 34 additions & 4 deletions core/org.eclipse.cdt.core.native/native_src/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#*******************************************************************************
# Copyright (c) 2002, 2015, 2020 QNX Software Systems and others.
# Copyright (c) 2002, 2015, 2024 QNX Software Systems and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -11,6 +11,7 @@
# Contributors:
# QNX Software Systems - initial API and implementation
# Torbjörn Svensson - Bug 521515 - Adopted jenkins build
# Tue Ton - support for Windows on Arm64
#*******************************************************************************/
SHELL=/bin/bash -o pipefail
ifeq ($(JAVA_HOME),)
Expand All @@ -20,13 +21,15 @@ endif
REPRODUCIBLE_BUILD_WRAPPER := $(shell git rev-parse --show-toplevel)/releng/scripts/reproducible_build_wrapper.py

OS_DIR_WIN32_X86_64 := ../../org.eclipse.cdt.core.win32.x86_64/os/win32/x86_64
OS_DIR_WIN32_AARCH64 := ../../org.eclipse.cdt.core.win32.aarch64/os/win32/aarch64
OS_DIR_LINUX_X86_64 := ../../org.eclipse.cdt.core.linux.x86_64/os/linux/x86_64
OS_DIR_LINUX_AARCH64 := ../../org.eclipse.cdt.core.linux.aarch64/os/linux/aarch64
OS_DIR_LINUX_PPC64LE := ../../org.eclipse.cdt.core.linux.ppc64le/os/linux/ppc64le
OS_DIR_MACOS_X86_64 := ../../org.eclipse.cdt.core.macosx/os/macosx/x86_64
OS_DIR_MACOS_AARCH64 := ../../org.eclipse.cdt.core.macosx/os/macosx/aarch64

COMMON_CFLAGS := -Wall -pedantic -Werror
COMMON_CFLAGS := -Wall -pedantic -Werror -std=gnu11
COMMON_CCFLAGS := -Wall -pedantic -Werror -std=gnu++14

UNAME = $(shell uname)
ifeq ($(UNAME),Linux)
Expand All @@ -52,12 +55,20 @@ LIBS = \
$(OS_DIR_MACOS_AARCH64)/libspawner.jnilib \
$(OS_DIR_MACOS_AARCH64)/libpty.jnilib
else
ifeq ($(findstring ARM64,$(UNAME)),ARM64)
COMMON_CFLAGS := -Wall -pedantic -std=gnu11
COMMON_CCFLAGS := -Wall -pedantic -std=gnu++14
LIBS = \
$(OS_DIR_WIN32_AARCH64)/starter.exe \
$(OS_DIR_WIN32_AARCH64)/spawner.dll
else
LIBS = \
$(OS_DIR_WIN32_X86_64)/starter.exe \
$(OS_DIR_WIN32_X86_64)/spawner.dll \
$(OS_DIR_WIN32_X86_64)/pty.dll
endif
endif
endif

all: $(LIBS)

Expand All @@ -72,7 +83,9 @@ MAC_TO_SIGN=$(OS_DIR_MACOS_X86_64)/libspawner.jnilib \
$(OS_DIR_MACOS_AARCH64)/libpty.jnilib
WIN_TO_SIGN=$(OS_DIR_WIN32_X86_64)/starter.exe \
$(OS_DIR_WIN32_X86_64)/spawner.dll \
$(OS_DIR_WIN32_X86_64)/pty.dll
$(OS_DIR_WIN32_X86_64)/pty.dll \
$(OS_DIR_WIN32_AARCH64)/starter.exe \
$(OS_DIR_WIN32_AARCH64)/spawner.dll
### This block of code also exists in native/org.eclipse.cdt.native.serial/native_src/Makefile
TMPDIR := $(shell mktemp -d -t production-XXXXXXXXXX)
.PHONY: production
Expand Down Expand Up @@ -116,11 +129,28 @@ $(OS_DIR_WIN32_X86_64)/spawner.dll: win/iostream.c win/raise.c win/spawner.c win
$(OS_DIR_WIN32_X86_64)/pty.dll: win/pty.cpp win/pty_dllmain.cpp win/util.c
mkdir -p $(dir $@) && \
$(REPRODUCIBLE_BUILD_WRAPPER) \
x86_64-w64-mingw32-g++ $(COMMON_CFLAGS) -o $@ -Iinclude -Iwin/include -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32" \
x86_64-w64-mingw32-g++ $(COMMON_CCFLAGS) -o $@ -Iinclude -Iwin/include -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32" \
-DUNICODE \
$^ \
-Wl,--kill-at --shared -L$(OS_DIR_WIN32_X86_64) -lwinpty -static-libstdc++ -static-libgcc

# Windows aarch64
$(OS_DIR_WIN32_AARCH64)/starter.exe: win/starter.c win/util.c
mkdir -p $(dir $@) && \
$(REPRODUCIBLE_BUILD_WRAPPER) \
aarch64-w64-mingw32-gcc $(COMMON_CFLAGS) -o $@ -Iinclude -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32" \
-DUNICODE \
$^ \
-lpsapi

$(OS_DIR_WIN32_AARCH64)/spawner.dll: win/iostream.c win/raise.c win/spawner.c win/Win32ProcessEx.c win/util.c
mkdir -p $(dir $@) && \
$(REPRODUCIBLE_BUILD_WRAPPER) \
aarch64-w64-mingw32-gcc $(COMMON_CFLAGS) -o $@ -Iinclude -I"$(JAVA_HOME)/include" -I"$(JAVA_HOME)/include/win32" \
-DUNICODE \
$^ \
-Wl,--kill-at --shared

# Linux x86_64
$(OS_DIR_LINUX_X86_64)/libspawner.so: unix/spawner.c unix/io.c unix/exec_unix.c unix/exec_pty.c unix/openpty.c unix/pfind.c
mkdir -p $(dir $@) && \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static void close_all_fds_fallback(unsigned int from_fd_inclusive) {
}
}

static void close_all_fds() {
static void close_all_fds(void) {
unsigned int from_fd = STDERR_FILENO + 1;
if (sys_close_range_wrapper(from_fd) == 0)
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ static void close_all_fds_fallback(unsigned int from_fd_inclusive) {
}
}

static void close_all_fds() {
static void close_all_fds(void) {
unsigned int from_fd = STDERR_FILENO + 1;
if (sys_close_range_wrapper(from_fd) == 0) {
return;
Expand Down
3 changes: 2 additions & 1 deletion core/org.eclipse.cdt.core.native/native_src/win/util.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2020 Torbjörn Svensson and others.
* Copyright (c) 2020, 2024 Torbjörn Svensson and others.
*
* This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -16,6 +16,7 @@

#include <stdio.h>
#include <tchar.h>
#include <errno.h>

static bool spawner = false;
static bool spawnerDetails = false;
Expand Down
3 changes: 2 additions & 1 deletion core/org.eclipse.cdt.core.native/plugin.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
###############################################################################
# Copyright (c) 2003, 2015 IBM Corporation and others.
# Copyright (c) 2003, 2024 IBM Corporation and others.
#
# This program and the accompanying materials
# are made available under the terms of the Eclipse Public License 2.0
Expand All @@ -24,4 +24,5 @@ fragmentName.linux.x86_64 = C/C++ Development Tools Core Native Utilities for Li
fragmentName.linux.aarch64 = C/C++ Development Tools Core Native Utilities for Linux (aarch64)
fragmentName.win32 = C/C++ Development Tools Core Native Utilities for Windows
fragmentName.win32.x86_64 = C/C++ Development Tools Core Native Utilities for Windows (x86_64)
fragmentName.win32.aarch64 = C/C++ Development Tools Core Native Utilities for Windows (aarch64)
fragmentName.macosx = C/C++ Development Tools Core Native Utilities for MacOS X
6 changes: 3 additions & 3 deletions core/org.eclipse.cdt.core.native/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<relativePath>../../pom.xml</relativePath>
</parent>

<version>6.3.500-SNAPSHOT</version>
<version>6.3.600-SNAPSHOT</version>
<artifactId>org.eclipse.cdt.core.native</artifactId>
<packaging>eclipse-plugin</packaging>

Expand Down Expand Up @@ -79,15 +79,15 @@
<configuration>
<target>
<exec executable="docker" newenvironment="false" failOnError="true">
<!-- docker run -\-rm -t -v $(git rev-parse -\-show-toplevel):/work -w /work/$(git rev-parse -\-show-prefix) quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest make -C native_src rebuild -->
<!-- docker run -\-rm -t -v $(git rev-parse -\-show-toplevel):/work -w /work/$(git rev-parse -\-show-prefix) quay.io/eclipse-cdt/cdt-infra:latest make -C native_src rebuild -->
<arg value="run" />
<arg value="--rm" />
<arg value="-t" />
<arg value="-v" />
<arg value="${project.basedir}/../..:/work" />
<arg value="-w" />
<arg value="/work/core/org.eclipse.cdt.core.native" />
<arg value="quay.io/eclipse-cdt/cdt-infra-eclipse-full:latest" />
<arg value="quay.io/eclipse-cdt/cdt-infra:latest" />
<arg value="make" />
<arg value="-C" />
<arg value="native_src" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

public class Messages extends NLS {
public static String PTY_FailedToStartConPTY;
public static String PTY_FailedToStartNativePTY;
public static String PTY_FailedToStartPTY;
public static String PTY_FailedToStartWinPTY;
public static String PTY_NoClassDefFoundError;
public static String Util_exception_cannotCreatePty;
public static String Util_exception_cannotSetTerminalSize;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@
# Martin Oberhuber (Wind River) - [303083] Split from CCorePluginResources.properties
###############################################################################

PTY_FailedToStartConPTY=Failed start a new style ConPTY. This is expected on Windows machines before Windows 10 1904 version and will fall back to WinPTY. Please consider upgrading to a newer version of Windows 10 to take advantage of the new improved console behavior.
PTY_FailedToStartConPTY=Failed start a new style ConPTY. This is expected on Windows machines before Windows 10 1904 version and will fall back to WinPTY. Please consider upgrading to a newer version of Windows to take advantage of the new improved console behavior.
PTY_FailedToStartNativePTY=Failed to load the PTY library. This may indicate a configuration problem, but can be ignored if no further problems are observed.
PTY_FailedToStartPTY=Failed to load the PTY library. This may indicate a configuration problem, but can be ignored if no further problems are observed.
PTY_FailedToStartWinPTY=Failed start WinPTY due to an exception. Please consider upgrading to a newer version of Windows to take advantage of the new improved console behavior.
PTY_NoClassDefFoundError=Failed start a new style ConPTY due to NoClassDefFoundError which probably means that the optional dependency on JNA is not available. Consider updating your product to include JNA to enable the ConPTY.
Util_exception_cannotCreatePty=Cannot create pty
Util_exception_closeError=close error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,14 +239,18 @@ public synchronized void close() throws IOException {
}
boolean res;

res = ConPTYKernel32.INSTANCE.CloseHandle(handles.processInformation.hThread);
checkErr(res, "CloseHandle processInformation.hThread"); //$NON-NLS-1$
if (handles.processInformation != null) {
res = ConPTYKernel32.INSTANCE.CloseHandle(handles.processInformation.hThread);
checkErr(res, "CloseHandle processInformation.hThread"); //$NON-NLS-1$

res = ConPTYKernel32.INSTANCE.CloseHandle(handles.processInformation.hProcess);
checkErr(res, "CloseHandle processInformation.hProcess"); //$NON-NLS-1$
res = ConPTYKernel32.INSTANCE.CloseHandle(handles.processInformation.hProcess);
checkErr(res, "CloseHandle processInformation.hProcess"); //$NON-NLS-1$
}

ConPTYKernel32.INSTANCE.DeleteProcThreadAttributeList(handles.startupInfo.lpAttributeList);
handles.threadAttributeListMemory.clear();
if (handles.startupInfo != null) {
ConPTYKernel32.INSTANCE.DeleteProcThreadAttributeList(handles.startupInfo.lpAttributeList);
handles.threadAttributeListMemory.clear();
}

ConPTYKernel32.INSTANCE.ClosePseudoConsole(handles.pseudoConsole.getValue());

Expand Down
Loading
Loading