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

meson - room for improvements #38

Closed
asmorodskyi opened this issue Mar 25, 2021 · 12 comments
Closed

meson - room for improvements #38

asmorodskyi opened this issue Mar 25, 2021 · 12 comments
Assignees

Comments

@asmorodskyi
Copy link
Collaborator

  1. scripts - folder copied empty.
    Expected : needs to contain python script
  2. attempt to run scripts/collect_stats.py end up with Module not found "_phobe"
    Expected: meson script suppose to install need python module
@dcermak
Copy link
Collaborator

dcermak commented Mar 30, 2021

I cannot reproduce this behavior:

$ meson -Dprint_advanced_messages=true -Dprint_table=true -Dcheck_initial_settings=true -Dcollector=enabled -Dbuildtype=debugoptimized -Db_sanitize=address,undefined build
$ meson compile -C build
$ DESTDIR=./destdir meson install -C build
$ tree build/destdir/
build/destdir/
└── usr
    ├── lib
    │   └── systemd
    │       └── system
    │           └── phoebe.service
    └── local
        ├── bin
        │   ├── data_tool
        │   └── phoebe
        ├── etc
        │   └── phoebe
        │       └── settings.json
        ├── lib64
        │   └── phoebe
        │       └── libnetwork_plugin.so
        └── share
            └── phoebe
                └── rates.csv

12 directories, 6 files

So in my case there is no directory scripts present. Also, if meson would automatically install the scripts folder, then the rpmbuild CI would be broken, because it does not list that directory in the %files section:

How did you install the scripts directory?

@asmorodskyi
Copy link
Collaborator Author

I was simply following instruction which project suggests to new-comer https://github.com/SUSE/phoebe/blob/main/BUILDING.md , which is just meson build . Can you try this ? So I would assume allocator is not set also I am not sure how -Dbuildtype=debugoptimized changing behavior

@asmorodskyi
Copy link
Collaborator Author

@dcermak also I found another difference from what you are doing and what is defined in project's build instruction , you defining different destination directory for compile while project suggesting to compile in build directory directly . So to reproduce first issue you need to simply follow build instructions defined for this project step by step :)

@dcermak
Copy link
Collaborator

dcermak commented Mar 30, 2021 via email

@asmorodskyi
Copy link
Collaborator Author

  1. scripts - folder copied empty.
    Expected : needs to contain python script
  2. attempt to run scripts/collect_stats.py end up with Module not found "_phobe"
    Expected: meson script suppose to install need python module

so I would say that first point is addressed with #42 . But second one is still there , @mvarlese please not close this issue I will try to come up with something later ...

@dcermak
Copy link
Collaborator

dcermak commented Apr 6, 2021

  1. attempt to run scripts/collect_stats.py end up with Module not found "_phobe"
    Expected: meson script suppose to install need python module

The question here is: what does "install" mean here for you? Running meson build or meson install? Because those are two different things.

so I would say that first point is addressed with #42 . But second one is still there , @mvarlese please not close this issue I will try to come up with something later ...

@mvarlese
Copy link
Collaborator

mvarlese commented Apr 7, 2021

  1. attempt to run scripts/collect_stats.py end up with Module not found "_phobe"

@shunghsiyu could you, please, have a look at this specific issue?

@asmorodskyi
Copy link
Collaborator Author

The question here is: what does "install" mean here for you? Running meson build or meson install? Because those are two different things.

I meant meson install

@shunghsiyu
Copy link
Member

shunghsiyu commented Apr 8, 2021

  1. attempt to run scripts/collect_stats.py end up with Module not found "_phobe"
    Expected: meson script suppose to install need python module

The missing module "_phoebe" refers to build/scripts/_phoebe.abi3.so. Right now it works in our CI because I set the PYTHON_PATH environment variable to build/scripts.

For install I think the correct way is to place it at /usr/lib64/python3.8/site-packages/_phoebe.abi3.so (for Python 3.8 on openSUSE Tumbleweed x86_64); that way the Python interpreter can successfully import the "_phoebe" module since /usr/lib64/python3.8/site-packages/ is in the default module search path, so there's no need for the PYTHON_PATH environment variable change.

@dcermak
Copy link
Collaborator

dcermak commented Apr 8, 2021

  1. attempt to run scripts/collect_stats.py end up with Module not found "_phobe"
    Expected: meson script suppose to install need python module

The missing module "_phoebe" refers to build/scripts/_phoebe.abi3.so. Right now it works in our CI because I set the PYTHON_PATH environment variable to build/scripts.

For install I think the correct way is to place it at /usr/lib64/python3.8/site-packages/_phoebe.abi3.so (for Python 3.8 on openSUSE Tumbleweed x86_64); that way the Python interpreter can successfully import the "_phoebe" module since /usr/lib64/python3.8/site-packages/ is in the default module search path, so there's no need for the PYTHON_PATH environment variable change.

This sounds like a use case for the python extension module provided by meson: https://mesonbuild.com/Python-module.html#extension_module

@asmorodskyi
Copy link
Collaborator Author

@dcermak please check #45

@asmorodskyi
Copy link
Collaborator Author

with #45 and #46 I think all topics which I raised here are solved . @dcermak , @shunghsiyu - thanks I lot for your help 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants