Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Usage of ContainerCommandLauncherFactory(2)::verifyIncludePaths and ..::verifyLanguageSettingEntries
  • From: Moritz Strübe <moritz.struebe@xxxxxxxxxx>
  • Date: Tue, 3 Nov 2020 10:28:02 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mathema.de; dmarc=pass action=none header.from=mathema.de; dkim=pass header.d=mathema.de; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WWLy+Wuzpkc1jcs9bK9oH2M2nRTK43f0HmakChJh3Vs=; b=dtLdySgDuW5A9B4bEaU7mlwp/7NGvTNCxpV51mNLZ/ogvpQOuJ714wWPFwhFJv/oyYG2jl8gl04wVsBoMEmdb59qtRs8kCa51YgWjkebqeHQhY4xf+o3TJe19iVicaJyPmO1UnxXVuju51iolapSriN97jmpxBXim8Dh+7r6RgmYVbvfRI1VsQrF25nf62MfbsDAaXGajvxFSxX0IaESC/uHMV7GJS/8l8VYUXwy00eW+t71yZy3aIseFgcytFWZdutXVhJ9OHv6ligBYkg34TkRlx5aL+xAhpufvM/fQsJXwDvl4Sg4PhdzKF+OZoG8KXtOOJQ9F3geVRDxUIu9FA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kDtheIJ9eOmni2kH31ArmS/SRq/oDnF0NklyCnvDKdQ6VEHpfXseZ9vI5zf19wDFqagEiXHXfHCM3Pc4UPbu4WnzMitSPLlLlslzPHKWpL17HoaJg9Dy2ejv7tXKptMTzt2+id/6msAC9TRVnGhXXE19XHn6+7y+5/41gGbB/RAvLMjoCm2oWhmDL5trCzNO8rRlWKzfsCNzxkIIj8RClN2VbDJuOCa5FcfmXt91xveXXpiycAgvnYmyZTmmlmnvWf2KpH95sxKGu43fbAdgfC5Xz3npUPblbt7nSJ76W69tvRhGkZIBKoF0RZ6p2KKzSiwmwjWL0I6bYLwfdgkoTg==
  • Delivered-to: cdt-dev@xxxxxxxxxxx
  • List-archive: <https://www.eclipse.org/mailman/private/cdt-dev>
  • List-help: <mailto:cdt-dev-request@eclipse.org?subject=help>
  • List-subscribe: <https://www.eclipse.org/mailman/listinfo/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=subscribe>
  • List-unsubscribe: <https://www.eclipse.org/mailman/options/cdt-dev>, <mailto:cdt-dev-request@eclipse.org?subject=unsubscribe>
  • User-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0

Hey Jeff,

thanks for the answer.


Am 02.11.2020 um 21:28 schrieb Jeff Johnston:
There are 3 interfaces: ICommandLauncherFactory, ICommandLauncherFactory2, and ICommandLauncherFactory3 that have been added over time to
support Docker Containers and ultimately Flatpak.

Out of curiosity: Why wasn't ICommandLauncherFactory extended, but new interfaces introduced?



Note, that for Containers, the system headers don't change without the Image changing.  Thus, in most cases, a single copy is needed per include path.  There is logic to recognize if the Image has updated or changed and the cache may be cleared.

Yep. I'm currently preparing a MR for linux-tools. I'm still a bit scared of adding the rm-functionalty if the container-id changes, but I hope to get there this week.  ;)

 There is also a UI page
where a user can delete the cached headers for an image and thus force a recopy if they have some complicated scenario where they
are changing the headers manually via a shell session.

Ok. Where is that? This stuff needs more documentation or maybe the documentation should be placed more visible. :-) I'm planning to do some once I got all the features I need implemented.


When the new CBuild model was added, the old methods for ICommandLauncherFactory do not get called in the build sequence.  Thus, ICommandLauncherFactory2 was added to deal with CBuild projects and the verifyIncludePaths() was added that does both copying and massaging in a single call.  Again, we are supporting Containers so the image headers are expected to be static.

Ok, but verifyIncludePaths is only called by providers, not when the project is loaded, right? Background: As long as I don't touch my workspace, everything is fine. Yet if delete the .../HEADERS/ folder to trigger copying the files, things break.



For Flatpak, the scenario changed yet again.  Initially CDT wasn't working properly with Flatpak as it only had a subset of tools/headers installed. I modified Flatpak CDT so it uses local tools and local headers, leaving it up to the end-user as is done for regular CDT.  The local headers are copied into a cache that the flatpak can access in the sandbox much like we do for Docker Images.  If the headers change, the user may have to do a manual remove of the headers and allow the system to recopy as needed.  A new interface: IContainerCommandLauncherFactory3 was added which adds the checkIfIncludesChanged() method to see if header files have been removed since the last copy.  The Flatpak change is very recent and hasn't been thoroughly tested/exercised in the wild.  There was a bug in Flatpak which didn't allow a Docker Connection to work (can't access the unix socket) and I haven't looked at Flatpak CDT since I reported that issue as Mat
was on vacation at the time and Flatpak wasn't being updated.

So, if I implement checkIfIncludesChanged (checking whether the docker-image still has the same ID and all necessary include folders are available) and return false, this should trigger verifyIncludePaths?

Cheers
Morty

--
MATHEMA Software GmbH
Schillerstraße 14 | 90409 Nürnberg

Telefon: +49 (0)911 180778-50
E-Mail: moritz.struebe@xxxxxxxxxx | Web: www.mathema.de

Geschäftsführer: Andreas Hanke, Thomas Haug
Handelsregister: HR B 35517, Nürnberg/Bayern



Back to the top