step by step guide to update code in a package

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

step by step guide to update code in a package

octavecontrib
Hi,
Based on information from the wiki
I am trying to update some code in certain functions in the 'control' package of Octave.
  1. I cloned the control package repository using mercurial.
  2. I made a commit to my local repository to have a save state to go back to.
  3. I modified the relevant .m file.
  4. The main Makefile has an option to build ('all'), check ('check') and run Octave ('run') with the modified files.
  5. The 'run' option in the Makefile however opens octave in no-gui mode. But the changes I made have to do with figures and plotting.
  6. So, I opened Ocatve separately and 'addpath()' both 'inst' and 'src' folders in my local repository.
  7. Upon trying to run some scripts to test, Octave complained of missing functions.
  8. So, I copied the 'PKG_ADD' file containing the 'autoload()' functions from the released package folder ('/usr/lib/x86_64-linux-gnu/octave/packages/control-3.0.0/x86_64-pc-linux-gnu-api-v51') to my local repository.
  9. I tested my modifications.
  10. I committed the modifications to my local repository.
  11. ???
Questions
  • Is there a STEP BY STEP tutorial or guide for package modification?
  • Is there some established WORKFLOW for package modification? (steps 6 and 8 above don't seem proper)
  • I want to know if the steps 1-9 above are correct and what to do next to submit the changes to the package maintainers.
Thanks in advance,
Reply | Threaded
Open this post in threaded view
|

Re: step by step guide to update code in a package

Doug Stewart-4
Do you know how to make a mercurial change set? The Next Step would be to show the maintainers of the control package, me being one of them , 
your ideas and get it approved.

On Sun, Aug 12, 2018, 3:52 PM octavecontrib, <[hidden email]> wrote:
Hi,
Based on information from the wiki
I am trying to update some code in certain functions in the 'control' package of Octave.
  1. I cloned the control package repository using mercurial.
  2. I made a commit to my local repository to have a save state to go back to.
  3. I modified the relevant .m file.
  4. The main Makefile has an option to build ('all'), check ('check') and run Octave ('run') with the modified files.
  5. The 'run' option in the Makefile however opens octave in no-gui mode. But the changes I made have to do with figures and plotting.
  6. So, I opened Ocatve separately and 'addpath()' both 'inst' and 'src' folders in my local repository.
  7. Upon trying to run some scripts to test, Octave complained of missing functions.
  8. So, I copied the 'PKG_ADD' file containing the 'autoload()' functions from the released package folder ('/usr/lib/x86_64-linux-gnu/octave/packages/control-3.0.0/x86_64-pc-linux-gnu-api-v51') to my local repository.
  9. I tested my modifications.
  10. I committed the modifications to my local repository.
  11. ???
Questions
  • Is there a STEP BY STEP tutorial or guide for package modification?
  • Is there some established WORKFLOW for package modification? (steps 6 and 8 above don't seem proper)
  • I want to know if the steps 1-9 above are correct and what to do next to submit the changes to the package maintainers.
Thanks in advance,
Reply | Threaded
Open this post in threaded view
|

Re: step by step guide to update code in a package

Mike Miller-2
In reply to this post by octavecontrib
On Sun, Aug 12, 2018 at 18:23:11 +0530, octavecontrib wrote:

> Hi,
> Based on information from the wiki
> https://wiki.octave.org/Contributing_to_the_development_of_packages/modules
> I am trying to update some code in certain functions in the 'control'
> package of Octave.
>
>    1. I cloned the control package repository using mercurial.
>    2. I made a commit to my local repository to have a save state to go
>    back to.
>    3. I modified the relevant .m file.
>    4. The main Makefile has an option to build ('all'), check ('check') and
>    run Octave ('run') with the modified files.
>    5. The 'run' option in the Makefile however opens octave in no-gui mode.
>    But the changes I made have to do with figures and plotting.
>    6. So, I opened Ocatve separately and 'addpath()' both 'inst' and 'src'
>    folders in my local repository.
>    7. Upon trying to run some scripts to test, Octave complained of missing
>    functions.
>    8. So, I copied the 'PKG_ADD' file containing the 'autoload()' functions
>    from the released package folder
>    ('/usr/lib/x86_64-linux-gnu/octave/packages/control-3.0.0/x86_64-pc-linux-gnu-api-v51')
>    to my local repository.
>    9. I tested my modifications.
>    10. I committed the modifications to my local repository.
>    11. ???
>
> Questions
>
>    - Is there a STEP BY STEP tutorial or guide for package modification?
Not really, but you may have a good start at establishing one.

>    - Is there some established WORKFLOW for package modification? (steps 6
>    and 8 above don't seem proper)

Personally, step 5-6 is not a problem for me. In the signal package,
step 7-8 is not a problem because the 'make all' target creates the
PKG_ADD file (and 'make clean' removes it) necessary for running all
compiled functions. The same could easily be done in the control
package.

>    - I want to know if the steps 1-9 above are correct and what to do next
>    to submit the changes to the package maintainers.

I'm not sure what step 2 means, making a commit before making any
changes? Is this about unfamiliarity with mercurial or distributed VCS
in general?

I would add a step like

  - Add one or more relevant unit tests to the .m file, and verify that
    'test func' and 'make check' passes all tests.

And to answer your question about what to do next,

  - Use 'hg export' to create mercurial patch files that you can submit
    on the Octave Savannah bug tracker or patch tracker. Alternatively,
    you may host your mercurial branch on a public repository (on
    bitbucket or sourceforge, for example) and mention the branch
    location in a bug report or patch ticket as a pull request.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: step by step guide to update code in a package

Sudeepam Pandey
In reply to this post by octavecontrib


On Mon 13 Aug, 2018, 1:23 AM octavecontrib, <[hidden email]> wrote:
Hi,
Based on information from the wiki
I am trying to update some code in certain functions in the 'control' package of Octave.
  1. I cloned the control package repository using mercurial.
  2. I made a commit to my local repository to have a save state to go back to.
  3. I modified the relevant .m file.
  4. The main Makefile has an option to build ('all'), check ('check') and run Octave ('run') with the modified files.
  5. The 'run' option in the Makefile however opens octave in no-gui mode. But the changes I made have to do with figures and plotting.
Not sure if this will solve your problem, but try making your modifications, then build the normal way and then to open GUI octave after building, try: 
>>./run-octave --gui
  1. So, I opened Ocatve separately and 'addpath()' both 'inst' and 'src' folders in my local repository.
  2. Upon trying to run some scripts to test, Octave complained of missing functions.
  3. So, I copied the 'PKG_ADD' file containing the 'autoload()' functions from the released package folder ('/usr/lib/x86_64-linux-gnu/octave/packages/control-3.0.0/x86_64-pc-linux-gnu-api-v51') to my local repository.
  4. I tested my modifications.
  5. I committed the modifications to my local repository.
  6. ???
I'm not sure if this method is correct, to me it seems that you are missing something here, but that is just a guess. Someone who is more familiar with this may acknowledge this later on.
Questions
  • Is there a STEP BY STEP tutorial or guide for package modification?
  • Is there some established WORKFLOW for package modification? (steps 6 and 8 above don't seem proper)
  • I want to know if the steps 1-9 above are correct and what to do next to submit the changes to the package maintainers.
Thanks in advance,
Reply | Threaded
Open this post in threaded view
|

Re: step by step guide to update code in a package

Mike Miller-4
In reply to this post by Mike Miller-2
On Sun, Aug 12, 2018 at 13:18:42 -0700, I wrote:
> Personally, step 5-6 is not a problem for me.

I should clarify. I think whether Octave runs in --gui or --no-gui mode
is a personal preference, not a bug in the makefile.

You could try 'make run OCTAVE="octave --gui"' to see if that helps get
the workflow that you want.

Even in command line mode, Octave should still allow you to use figures
and user interface controls.

Maybe someone has ideas about how to make it easier for the 'make run'
target to support users who want to use the GUI while keeping the
default behavior as is.

--
mike

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: step by step guide to update code in a package

octavecontrib
Hi,
Thanks for the helpful replies.
> The Next Step would be to show the maintainers of the control package, me being one of them your ideas and get it approved.
Do I do that via this mailing list or via the the patch tracker ? (I will have to sign up for it then)

> Not really, but you may have a good start at establishing one.
I was thinking of adding a page in the Octave wiki if my modification is accepted. An end to end tutorial by example.

> 'make all' target creates the PKG_ADD file (and 'make clean' removes it) necessary for running all compiled functions. The same could easily be done in the control package.
I will go through the 'make all' for 'signal' package to get an idea of how to generate PKG_ADD file for control also.

> Is this about unfamiliarity with mercurial or distributed VCS in general?
Yes, I have never used anything other than SVN with TortoiseSVN and never contributed to any project. I will go through the Mercurial tutorials linked when ever I face any difficulty.

> Add one or more relevant unit tests to the .m file, and verify that 'test func' and 'make check' passes all tests.
I am currently reading https://wiki.octave.org/Tests

> Use 'hg export' to create mercurial patch files that you can submit    on the Octave Savannah bug tracker or patch tracker. Alternatively,    you may host your mercurial branch on a public repository (on    bitbucket or sourceforge, for example) and mention the branch    location in a bug report or patch ticket as a pull request.
Thanks. I will probably follow the patch tracker route since I am not likely to be regular contributor. I will read the HG tutorial and learn how to make a patch file.

> You could try 'make run OCTAVE="octave --gui"' to see if that helps get the workflow that you want.
That didnt work for me since the gui started up in the last opened directory and so the '--path inst' and '--path src' were not visible to Octave. So they were not added in the path.

> Even in command line mode, Octave should still allow you to use figures and user interface controls.
Octave showed the figure as an 'ascii art' instead of opening a regular window.

> but try making your modifications, then build the normal way and then to open GUI octave after building, try: './run-octave --gui'
Since Octave started up in the 'last opened directory', i could'nt addpath('inst'). I had to addpath('/fullpath/to/my/clone/inst');
I will see the signal package as mentioned above to see how to make an add_pkg file or follow my existing workflow.
Reply | Threaded
Open this post in threaded view
|

Re: step by step guide to update code in a package

Mike Miller-4
On Wed, Aug 15, 2018 at 18:43:43 +0530, octavecontrib wrote:
> > The Next Step would be to show the maintainers of the control package, me
> > being one of them your ideas and get it approved.
> *Do I do that via this mailing list or via the the patch tracker ? (I will
> have to sign up for it then)*

I highly recommend all changes be sent via the bug/patch trackers. If
someone emails me directly, I ask them to file a bug report. But each
Octave Forge developer is free to use or ignore the bug tracker.

> I will go through the 'make all' for 'signal' package to get an idea of how
> to generate PKG_ADD file for control also.

That looks like an easy first contribution for you.

> > You could try 'make run OCTAVE="octave --gui"' to see if that helps get
> > the workflow that you want.
> That didnt work for me since the gui started up in the last opened
> directory and so the '--path inst' and '--path src' were not visible to
> Octave. So they were not added in the path.

This might be worth fixing by using a correct absolute path.

> > Even in command line mode, Octave should still allow you to use figures
> > and user interface controls.
> Octave showed the figure as an 'ascii art' instead of opening a regular
> window.

Ok, maybe the control package is running 'octave -W' or similar. In the
signal package 'make run' allows normal figures to be used.

So I see at least two or three bugs in the control package top-level
Makefile that you might want to help fix, in addition to the original
patch that you intended to contribute.

--
mike

signature.asc (849 bytes) Download Attachment