Pcynlitx with classic

Dear readers.

I want to publish an innovative meta-programming platform on snap store. The name of the platform is “Pcynlitx”. The platform is an outcome a scientific research project and it produces cybernetic thread management system. Actually, this system is an intelligent integrated development environment and it produces project-specific cybernetic thread management library based on the programmer needs. The platform receives the programmer requirements from the graphical user interface and the meta-programs on the platform produce thread management library in each time. The libraries are produced on the locations in which the programmer specified. Therefore, the platform must reach at least the user directories. This is the reason why a classic confinement is required. First of all, I want to learn whether constructing such a snap package with strict confinement is possible. If it is, how can i construct snap package. My snapcraft.yaml file is given in below.

name: pcynlitx
base: core20
version: ‘1.0’
icon: snap/gui/icon.png
license: GPL-3.0
summary: An intelligent ide which is specialized to multithreading
description: |
Pcynlitx is an intelligent software development environment which is
specialized to the multithreading application. Thanks to the its
meta-programming systems, it buils a cybernetic thread management
library that best fits the programmer needs.
grade: stable
confinement: classic

apps:
pcynlitx:
command: usr/bin/Pcynlitx

parts:
pcynlitx:
plugin: nil
source: src/
source-type: local
override-build: |
mkdir -pv $SNAPCRAFT_PART_INSTALL/usr/bin
mkdir -pv $SNAPCRAFT_PART_INSTALL/usr/share/Pcynlitx
mkdir -pv $SNAPCRAFT_PART_INSTALL/usr/share/Pcynlitx/icons
cd $SNAPCRAFT_PART_SRC/usr/bin
cp * $SNAPCRAFT_PART_INSTALL/usr/bin
cd $SNAPCRAFT_PART_SRC/usr/share/Pcynlitx/icons
cp *.png $SNAPCRAFT_PART_INSTALL/usr/share/Pcynlitx/icons
cd $SNAPCRAFT_PART_SRC/usr/share/Pcynlitx
cp Intro_File.png $SNAPCRAFT_PART_INSTALL/usr/share/Pcynlitx
stage-packages:
- g++
- build-essential
- libgtk-3-0
- libwxbase3.0-0v5
- libwxbase3.0-dev
- libwxgtk3.0-gtk3-0v5
- libwxgtk3.0-gtk3-dev
- wx-common
- wx-i18n
- fonts-liberation
- fonts-linuxlibertine
override-stage: |
snapcraftctl stage
cd $SNAPCRAFT_PART_SRC/usr/bin
cp * $SNAPCRAFT_STAGE/usr/bin
cd $SNAPCRAFT_PART_SRC/usr/share/Pcynlitx/icons
cp *.png $SNAPCRAFT_STAGE/usr/share/Pcynlitx/icons
cd $SNAPCRAFT_PART_SRC/usr/share/Pcynlitx
cp Intro_File.png $SNAPCRAFT_STAGE/usr/share/Pcynlitx

If classic is necessary, how can i publish my work. I have seen that atom editor uses classic confinement. I have uploaded the package but I did not released yet.

In addition, I have found that snapcraft as a very important project and I always want to be in a contact with snapcraft team.

Thanks and best regards.

Erkam Murat Bozkurt.

M.Sc in Control Systems Engineering.

Istanbul / Turkey

www.pcynlitx.tech

About pcynlitx classic confinement

Dear readers.

Sorry, I forgot to mention an important point in my previous mail.
Please read the previous mail before this mail.

The meta programs that are used by pcynlitx construct cybernetic thread control library.
However, in this programming paradigm, the programmers make declarations about the C++ headers and source files to the graphical user interface of the pcynlitx platform before cybernetic control library construction.

Then, the pcynlitx platforms builds autonomuos thread management library
based on this meta-information. Therefore, the platform must perform both read and write operations on particular C++ source files. Then, the platform construct special C++ thread management library to the location which is declareted by the programmer.
I think classic confinement is necessary in this case. If the strict confinement can be applied in this platform, how can i acieve this.

I have posted my snapcraft.yaml file in my previous mail.

My web page and github repo are given in below.

http://www.pcynlitx.tech/

Thanks for everything and best regards.

@Erkam I merged your other thread with this original one - please try and keep one single thread/topic for this discussion. Thanks.

Thank you very much alex.

Sorry, I am very amateour in forums.In addition, I want to ask you something. Currently, I have only uploaded the snap package to the system and I didn’t select the release option on the ubuntu one account. I think release option must be selected after manual review. Is this action true ? Do I need to release it before manual review? Which action is more suitable for me?

Alex Murray via snapcraft.io <forum@forum.snapcraft.io>, 4 Mar 2021 Per, 03:13 tarihinde şunu yazdı:

Hi @Erkam, this sounds like a very interesting project!

I see you mention pcynlitx needs to access particular C++ source files and header files. Are those sources files in a particular location on the system we could make the snap to get access by plugging some interface? On the other side, if it needs access to files from the host for the purposes of compilation - i.e.: host’s installed header files (e.g.: in /usr/include); .so files (e.g.: in /lib and /usr/lib); /usr/local/src, etc., it clearly follows under the supported compilers/IDE categories (since you are also saying pcynlitx is “An intelligent ide which is specialized to multithreading”. Could you please confirm?

Thanks!

Thank you very much for your interest.

Actually, I am very new in snapcraft development and I don’t know possible solutions and terminologies. Therefore, I need your guidance. I will try to explain my requests briefly.

However, unfourtunatelly, pcynlitx is an innovative platform and explaining its requirements is difficult. Basically, pcynlitx works based on a new software development paradigm. Currently, a research article about this software development method is under review in a high ranking journal. Although there are many similarities between IDEs and pcynlitx, there are some differences as well. Therefore, in order to clarify why pcynlitx requires interactive programming, I want to summarize the mechanism of pcynlitx at first.

In multi threading, the execution order of the threads are determined by operating systems and/or underlying hardware ( CPU cores ). In each running of a multi threaded software, different program flows are observed and the execution order of the threads are determined randomly by underlying hardware. This makes multi-threaded programs non-deterministic. In addition, this situation breaks down input-output stability of the multi-threaded programs. As a result of this, developing testing and debugging multi-threaded programs are very hard.

Pcynlitx makes this process more easy. In fact, pcynlitx produces project specific C++ class library which is used as cybernetic thread management library. The instances of the classes ( the cybernetic control objects ) managed the execution flows of the threads cybernetically. By this way, the multi-threaded software will be more stable and predictable. Because, the execution flows of the threads are controlled directly by the programmer and in each running of the software, the same program flows are observed.

In order to achieve this, pcynlitx follows more interactive software development process by means of its special purpose meta-programs. Meta programs are the programs that write code. In pcynlitx, the platform receives meta information about the software to be developed from its user. This information includes the parameters such as how many threads will be created, what are the names of the thread functions to be executed, what kind of variables and/or types are shared between the threads, how the threads will be communicated ext. Pcynlitx receives this meta-information from its user by means of a descriptor file ( Project Descriptor File ).

In practice, the users enter their preferences to the descriptor file with making selections by means of graphical user interface. Then, the descriptor file is automatically coded by pcynlitx.

In this declaration process, at first, the programmer must determine the location of the cybernetic thread control library which will be constructed by pcynlitx. In Linux, the programmer constructs a new project folder inside a user home directory. The pcynlitx can be available as debian package from the official web page and source code repository:

After the construction point is determined, the number of the threads to be created is determined by the user. Then, the classes and/or source files which are used on the operations which are performed between the threads are determined. These locations and files are generally inside user folders.

For instance, let we assume that the location of the libraries to be constructed is;

/home/erkam/Pcynlitx_Apps”

Then, let us assume that the programmer will use a class in which its instance is shared between the threads. In this case, the programmer performs a declaration about this class to the pcynlitx.

/home/erkam/print_classes/sources/printer.cpp”

/home/erkam/print_classes/headers/printer.h”

When a cybernetic control library is constructed, pcynlitx produces some special classes which their instances act as secure communication points from the threads to the instance of that class ( for the inter-thread operations ).

Finally, pcynlitx builds a library to the location specified as

/home/erkam/Pcynlitx_Apps/libThread_Server.a”

and related header files

/home/erkam/Pcynlitx_Apps/Thread_Server_Include”

When the pcynlitx snap version is constructed with strict confinement, I can only reach the folder “/snap/pcynlitx/x1” and this folder is accepted as read only. The pcynlitx can not write any information onto this directory. In addition, in compiling process, “pcynlitx” uses GNU g++ compiler, standard C/C++ libraries such as std::thread, std::fstream, many other standard libraries and of course, g++ compiler needs related shared libraries.

If every requirement of the g++ compiler including shared libraries and headers can be loadable into the snap sandbox, channels and/or interfaces to the shared libraries under root directory may not be necessary. However, if it is not possible, channels and/or interfaces are necessary. Beside this, in my opinion, reaching the user directories at least is mandatory. The user must use the files and folders placed on the user directories and pcynlitx must create files on the folders determined by the user.

How can I provide these properties without change strict confinement. The channels and/or interfaces can solve the problems that are faced in compiling process. However, I think, pcynlitx must construct source files and libraries on the home directory. On the other case, pcynlitx will be useless.

By plugging the home interface you can read and write the users files etc so I think that should allow pcynlitx to function under strict confinement given the description above. If this is not sufficient please reply and we can try and debug further. Thanks.

Thank you very much alex. After plugging home interface, I can reach the home directory. However, after that, I have faced a compiler configuration problem. The compiler can not find a header file placed in a different folder inside pcynlitx snap.

The output of the compiler is given below.

In file included from /snap/pcynlitx/x1/usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533:0,
from /snap/pcynlitx/x1/usr/include/c++/7/utility:68,
from /snap/pcynlitx/x1/usr/include/c++/7/tuple:38,
from /snap/pcynlitx/x1/usr/include/c++/7/mutex:38,
from ./Thread_Locker.h:5,
from ./Thread_Data_Manager.h:5,
from ./Thread_Manager.h:5,
from :0:
/snap/pcynlitx/x1/usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39:10: fatal error: features.h: No such file or directory
#include <features.h>
^~~~~~~~~~~~
compilation terminated.

The related header files is placed on the location is given in below

/snap/pcynlitx/x1/usr/include/c++/7/parallel

as

/snap/pcynlitx/x1/usr/include/c++/7/parallel/features.h

I have tried to solve problem with exporting CPLUS_INCLUDE_PATH on the override-stage step such as given in below

export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:$SNAPCRAFT_PART_INSTALL/usr/include/c++/7/parallel"

Mutex variables and threading library are defined in separate libraries as std::mutex and std::stread. I have added the latest snapcraft.yaml in below

name: pcynlitx
base: core18
version: ‘1.0’
icon: snap/gui/icon.png
license: GPL-3.0
summary: An intelligent ide which is specialized to multithreading
description: |
Pcynlitx is an intelligent software development environment which is
specialized to the multithreading application. Thanks to the its
meta-programming systems, it buils a cybernetic thread management
library that best fits the programmer needs.
grade: stable
confinement: strict

apps:
pcynlitx:
command: usr/bin/Pcynlitx
extensions: [gnome-3-28]
plugs: [home]

parts:
pcynlitx:
plugin: nil
source: src/
source-type: local
build-packages:

  • g++
  • build-essential
  • libgtk-3-0
  • libwxbase3.0-0v5
  • libwxbase3.0-dev
  • libwxgtk3.0-gtk3-0v5
  • libwxgtk3.0-gtk3-dev
  • wx-common
  • wx-i18n
  • fonts-liberation
  • fonts-linuxlibertine
    override-build: |
    mkdir -pv $SNAPCRAFT_PART_INSTALL/usr/bin
    mkdir -pv $SNAPCRAFT_PART_INSTALL/usr/share/Pcynlitx
    mkdir -pv $SNAPCRAFT_PART_INSTALL/usr/share/Pcynlitx/icons
    cd $SNAPCRAFT_PART_SRC/usr/bin
    cp * $SNAPCRAFT_PART_INSTALL/usr/bin
    cd $SNAPCRAFT_PART_SRC/usr/share/Pcynlitx/icons
    cp *.png $SNAPCRAFT_PART_INSTALL/usr/share/Pcynlitx/icons
    cd $SNAPCRAFT_PART_SRC/usr/share/Pcynlitx
    cp Intro_File.png $SNAPCRAFT_PART_INSTALL/usr/share/Pcynlitx
    cd $SNAPCRAFT_PART_SRC/usr/lib
    cp libwx_gtk3u_core-3.0.so.0 $SNAPCRAFT_PART_INSTALL/usr/lib/x86_64-linux-gnu
    cp libwx_gtk3u_core-3.0.so.0.4.0 $SNAPCRAFT_PART_INSTALL/usr/lib/x86_64-linux-gnu
    export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:$SNAPCRAFT_PART_INSTALL/usr/include/c++/7/parallel"
    stage-packages:
  • g++
  • build-essential
  • libgtk-3-0
  • libwxbase3.0-0v5
  • libwxbase3.0-dev
  • libwxgtk3.0-gtk3-0v5
  • libwxgtk3.0-gtk3-dev
  • wx-common
  • wx-i18n
  • fonts-liberation
  • fonts-linuxlibertine
    override-stage: |
    snapcraftctl stage
    cd $SNAPCRAFT_PART_SRC/usr/bin
    cp * $SNAPCRAFT_STAGE/usr/bin
    cd $SNAPCRAFT_PART_SRC/usr/share/Pcynlitx/icons
    cp *.png $SNAPCRAFT_STAGE/usr/share/Pcynlitx/icons
    cd $SNAPCRAFT_PART_SRC/usr/share/Pcynlitx
    cp Intro_File.png $SNAPCRAFT_STAGE/usr/share/Pcynlitx
    cd $SNAPCRAFT_PART_SRC/usr/lib
    cp libwx_gtk3u_core-3.0.so.0 $SNAPCRAFT_STAGE/usr/lib/x86_64-linux-gnu
    cp libwx_gtk3u_core-3.0.so.0.4.0 $SNAPCRAFT_STAGE/usr/lib/x86_64-linux-gnu
    export CPLUS_INCLUDE_PATH="$CPLUS_INCLUDE_PATH:$SNAPCRAFT_STAGE/usr/include/c++/7/parallel"

Alex Murray via snapcraft.io <forum@forum.snapcraft.io>, 30 Mar 2021 Sal, 11:03 tarihinde şunu yazdı: