• Login
Community
  • Login

Python plugin works in NPP 7.7 but does work in NPP 7.8 upward

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
24 Posts 2 Posters 1.8k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    Stier Hahn
    last edited by Jan 28, 2021, 1:45 PM

    Dear community,

    I need some help regarding supporting of my Python plugin.

    https://github.com/stier08/NppPyStandalone

    In a nutshell it allows calling scripts written in python directly from NPP IDE .

    The latest version linked against winpython 3.7 / boost 1.68 / vs toolset v140 works fine with npp.7.7.1.bin

    However, starting from NPP 7.8 upward I’m getting an error “<plugin> is not compatible with current version of notepad++.”

    Apparently something has changes in NPP and I cant figure out what exactly…

    To troubleshoot the problem I built a bare minimal Plugin ( based on https://github.com/npp-plugins/plugindemo

    by linking it with boost::python

    #include <boost/python/module.hpp>
    #include <boost/python/class.hpp>
    #include <boost/utility.hpp>

    without calling any python stuff.

    and even such a small change cases loading error in NPP 7.9.

    NPP 7.7 works fine.

    Can someone suggest what is the root cause / what need to changes / how to troubleshoot this.

    Thank you in advance,
    stier08.

    E 1 Reply Last reply Jan 28, 2021, 1:54 PM Reply Quote 2
    • E
      Ekopalypse @Stier Hahn
      last edited by Ekopalypse Jan 28, 2021, 1:54 PM Jan 28, 2021, 1:54 PM

      @Stier-Hahn

      How do you compile the dll? Using Visual Studio, gcc …? Which version?

      Are the exports really exported? Using dumpbin like dumpbin /exports YOUR_PLUGIN.dll will give you that information.

      S 1 Reply Last reply Jan 28, 2021, 7:03 PM Reply Quote 0
      • E
        Ekopalypse
        last edited by Jan 28, 2021, 1:59 PM

        @Stier-Hahn said in Python plugin works in NPP 7.7 but does work in NPP 7.8 upward:

        NPP 7.7 works fine.

        Does that mean, the same, recently compiled dll, works here but not with 7.9.X??

        S 1 Reply Last reply Jan 28, 2021, 6:58 PM Reply Quote 0
        • S
          Stier Hahn @Ekopalypse
          last edited by Jan 28, 2021, 6:58 PM

          @Ekopalypse thank you for your feedback.
          I’ve created a minimal binary that works with 7.7 and does not work with 7.8

          https://github.com/stier08/NppPyStandalone/releases/tag/NppPluginTemplate_minimal_boost-1_68_0_vs2019_toolset_v140_wp37_01

          Source code https://github.com/stier08/NppPyStandalone/tree/minimal_boost-1_68_0_vs2019_toolset_v140_wp37

          My setup is as follows

          boost-1_68_0
          vs2019
          toolset v140
          wp37 (Winpython32-3.7.7.1dot)

          Plugin does work with
          https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v7.7.1/npp.7.7.1.bin.7z

          but does not work with

          https://github.com/notepad-plus-plus/notepad-plus-plus/releases/download/v7.8/npp.7.8.bin.7z

          1 Reply Last reply Reply Quote 0
          • S
            Stier Hahn @Ekopalypse
            last edited by Stier Hahn Jan 28, 2021, 7:05 PM Jan 28, 2021, 7:03 PM

            @Ekopalypse said in Python plugin works in NPP 7.7 but does work in NPP 7.8 upward:

            /exports

            see my previous post on build setup

            here is what I get with dumpin

            Microsoft ® COFF/PE Dumper Version 14.28.29336.0
            Copyright © Microsoft Corporation. All rights reserved.

            Dump of file NppPluginTemplate.dll

            File Type: DLL

            Section contains the following exports for NppPluginTemplate.dll

            00000000 characteristics
            6013057D time date stamp Thu Jan 28 19:42:05 2021
                0.00 version
                   1 ordinal base
                   6 number of functions
                   6 number of names
            
            ordinal hint RVA      name
            
                  1    0 000010E0 beNotified
                  2    1 000010C0 getFuncsArray
                  3    2 000010B0 getName
                  4    3 000010F0 isUnicode
                  5    4 000010F0 messageProc
                  6    5 00001040 setInfo
            

            Summary

                2000 .data
                1000 .gfids
                6000 .rdata
                1000 .reloc
                1000 .rsrc
                D000 .text
            
            1 Reply Last reply Reply Quote 0
            • E
              Ekopalypse
              last edited by Jan 28, 2021, 7:09 PM

              Let me do some tests with your code and the mentioned npp versions.

              1 Reply Last reply Reply Quote 0
              • E
                Ekopalypse
                last edited by Jan 28, 2021, 7:18 PM

                Works for me

                8b16aa0a-e0b6-4f72-ba92-e5895457c5aa-image.png

                Where is your python3.dll located in 7.8?
                Should be within your plugin directory.

                S 1 Reply Last reply Jan 28, 2021, 8:10 PM Reply Quote 2
                • S
                  Stier Hahn @Ekopalypse
                  last edited by Jan 28, 2021, 8:10 PM

                  @Ekopalypse i’ve bin using same setup. I.e. only plugin dll is located in plugin dir. And python dir in path.

                  E 1 Reply Last reply Jan 28, 2021, 8:12 PM Reply Quote 2
                  • E
                    Ekopalypse @Stier Hahn
                    last edited by Jan 28, 2021, 8:12 PM

                    @Stier-Hahn
                    and there is no other python3 dll (64bit) in the path before the 32bit one?

                    S 1 Reply Last reply Jan 28, 2021, 8:16 PM Reply Quote 0
                    • S
                      Stier Hahn @Ekopalypse
                      last edited by Stier Hahn Jan 28, 2021, 8:18 PM Jan 28, 2021, 8:16 PM

                      @Ekopalypse will check tmr in more details.

                      I can tell for sure (99%) I do not have any 64 bit builds of python on my box.

                      Ps
                      I’m still wondering that it works for me in 7.7 but not in 7.8. Just for my understanding were there any changes that could cause such behavior? Changes in dll lookup order or something

                      1 Reply Last reply Reply Quote 0
                      • E
                        Ekopalypse
                        last edited by Jan 28, 2021, 8:17 PM

                        Starting from 7.8 plugins are allowed to load their own dlls from within the plugin directory.

                        1 Reply Last reply Reply Quote 2
                        • E
                          Ekopalypse
                          last edited by Jan 28, 2021, 8:18 PM

                          Ah - could it be that path is not evaluted anymore? I guess so.

                          S 1 Reply Last reply Jan 28, 2021, 8:20 PM Reply Quote 1
                          • S
                            Stier Hahn @Ekopalypse
                            last edited by Jan 28, 2021, 8:20 PM

                            @Ekopalypse could you please check if it works for you if python dll is located in path and not in plugin dir

                            E 2 Replies Last reply Jan 28, 2021, 8:20 PM Reply Quote 0
                            • E
                              Ekopalypse @Stier Hahn
                              last edited by Jan 28, 2021, 8:20 PM

                              @Stier-Hahn - currently trying

                              E 1 Reply Last reply Jan 28, 2021, 8:22 PM Reply Quote 0
                              • E
                                Ekopalypse @Ekopalypse
                                last edited by Ekopalypse Jan 28, 2021, 8:24 PM Jan 28, 2021, 8:22 PM

                                @Stier-Hahn
                                Yes, it is not found but then I do get

                                6925989c-f96a-49a9-bc06-d9fe35ba80a0-image.png

                                1 Reply Last reply Reply Quote 1
                                • E
                                  Ekopalypse
                                  last edited by Jan 28, 2021, 8:23 PM

                                  and next window is
                                  81824459-8282-4997-9a08-23912af2543b-image.png

                                  1 Reply Last reply Reply Quote 0
                                  • E
                                    Ekopalypse
                                    last edited by Jan 28, 2021, 8:24 PM

                                    but npp 7.7 works.

                                    1 Reply Last reply Reply Quote 1
                                    • E
                                      Ekopalypse @Stier Hahn
                                      last edited by Jan 28, 2021, 8:26 PM

                                      @Stier-Hahn

                                      I start to remember that I read some conversation about
                                      security concerns regarding sideloading dlls.

                                      S 1 Reply Last reply Jan 29, 2021, 9:46 AM Reply Quote 1
                                      • S
                                        Stier Hahn @Ekopalypse
                                        last edited by Jan 29, 2021, 9:46 AM

                                        @Ekopalypse so, I’ve tested my minimal plugin build in 7.8 with python37.dll inside plugin dir and it works.

                                        My question from the top of the thread has been solved.

                                        Thank you very much!

                                        ps

                                        I still need to check if my main plugin will be working…
                                        Struggling to upgrade third-party libs and other dependencies…

                                        1 Reply Last reply Reply Quote 2
                                        • E
                                          Ekopalypse
                                          last edited by Jan 29, 2021, 11:18 AM

                                          If there is anything we can do to help let us know.

                                          S 1 Reply Last reply Jan 29, 2021, 4:00 PM Reply Quote 0
                                          7 out of 24
                                          • First post
                                            7/24
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors