Edgewall Software
Modify

Opened 16 years ago

Closed 15 years ago

#233 closed defect (worksforme)

Build step cwd not properly set

Reported by: jkyllo-trac@… Owned by: osimons
Priority: minor Milestone:
Component: Recipe commands Version: dev
Keywords: Cc: jkyllo-trac@…
Operating System: Linux

Description

While setting up a system for lint reports, I found that pylint was unable to find my package due to the cwd not getting set. I was able to observe this by using sh:exec build steps with "ls" and "pwd" as well as a python script with this in it:

import sys for p in sys.path: print p

ls showed the correct files but pwd should that bitten-slave was not switching to the correct directory. The python script showed my standard path plus the directory from which bitten-slave was started. I imagine this was because the build step was inheriting this path from bitten-slave. It was quite strange but after some digging I found that the cwd passed to Command Line? on line 124 of source:trunk/bitten/build/shtool.py was not getting set. The only chance it had of being set was when the 'output' parameter of the 'execute' function was not set.

I simply shifted the if/else blocks for setting dir_ to the left one tabstop and now pylint is able to find my module as expected. I have attached a patch to illustrate this but it is, of course, pretty trivial. If this behavior is incorrect please let me know as there should be some way for dir_ to be set to ctxt.basedir for the normal case. The patch is against revision [519].

Attachments (1)

bitten-basedir.patch (557 bytes) - added by jkyllo-trac@… 16 years ago.
Patch changing source:trunk/bitten/build/shtool.py to properly set the cwd for sh steps.

Download all attachments as: .zip

Change History (6)

Changed 16 years ago by jkyllo-trac@…

Patch changing source:trunk/bitten/build/shtool.py to properly set the cwd for sh steps.

comment:1 Changed 16 years ago by jkyllo-trac@…

Correction, that's against source:trunk/bitten/build/shtools.py

comment:2 Changed 16 years ago by jkyllo-trac@…

  • Cc jkyllo-trac@… added

comment:3 Changed 15 years ago by flavour@…

This seems to be a duplicate of #283

comment:4 Changed 15 years ago by osimons

  • Owner changed from cmlenz to osimons

Closed #283 as a duplicate of this ticket.

That said, using latest trunk and a simple build recipe, I can't really find anything wrong. Here is the steps I used for pylint - testing both python:exec and sh:execute after a previous step to checkout (and 'bitten' is the package inside the checkout):

  <step id="pylint" description="pylint sh:execute">
    <sh:exec executable="pylint" output="pylint.out"
            args="--output-format=parseable bitten" />
    <python:pylint file="pylint.out" />
  </step>
  <step id="pylint" description="pylint python:exec">
    <python:exec module="pylint.lint" output="pylint-report.txt"
            args="--output-format=parseable bitten" />
    <python:pylint file="pylint-report.txt" />
  </step>

I've also stared at the patch attached to this ticket, and really cannot detect what actually changes in it? Apart from perhaps whitespace?

If this is still a problem, could anyone please help me reproduce this on latest trunk (r641) by providing a failing build script, and if this perhaps is specific to the source code contents then I'd like a pointer to some publicly available source code that also produce the error.

comment:5 Changed 15 years ago by osimons

  • Resolution set to worksforme
  • Status changed from new to closed

I don't find anything wrong using latest trunk (0.6dev), but by all means please reopen with details on how to reproduce the error if I'm mistaken.

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain osimons.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.