bugMyPaint - Bugs: bug #20399, [OSX] scons: prefix=/somewhere...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #20399: [OSX] scons: prefix=/somewhere installs stuff and shouldn't. [ALL] --install-sandbox must not be relative

Submitted by:  Ryan Schmidt <ryandesign>
Submitted on:  Wed 02 Jan 2013 05:57:42 PM UTC  
 
Severity: 3 - NormalPriority: 5 - Normal
Status: Need InfoPrivacy: Public
Assigned to: NoneOpen/Closed: Open
Release: 1.1.0Planned Release: None
Operating System: OS X 10.8

Fri 04 Jan 2013 06:52:45 PM UTC, comment #5:

The problem occurs with both scons 2.0.1 and scons 2.2.0, regardless of whether I specify prefix=/opt/local when I run scons. /opt/local/ is the default prefix in SConstruct when the OS is darwin (a.k.a. OS X).

The problem does not occur if I edit SConstruct and change it so that...

...nor if I run scons with prefix=/usr/local or prefix=some nonexistent directory inside the MacPorts work directory (which is where MacPorts will allow ports to write things at build time). Setting prefix=/nonexistent/directory (a nonexistent directory that MacPorts will not allow ports to write to) results in an error right away before anything is built:

I'm not quite sure what to make of all this but I can certainly set prefix to a nonexistent directory in the work directory to avoid the problem for now.

---------

Thank you for the tip about using an absolute --install-sandbox. I thought I had tried that before, and I tried it again now to verify that it doesn't work right for me: it tries to chmod directories outside of the sandbox, which fails.

The MacPorts sandbox directory is called "destroot" and is created at the same level as (not inside of) the source directory. Trying to use that gives a permission error. It correctly installs mypaint inside the sandbox, but then tries to chmod the corresponding parent directory outside of the sandbox, which MacPorts does not permit:

Following instead the direction in the README that it must be a directory under the source directory, I get instead a file-not-found error. Same problem, but it's installing a different file. It succeeds installing mypaint and chmod'ing its parent directory in the sandbox, then installs mypaint-brush.h in the sandbox and fails when trying to chmod its nonexistent parent directory outside of the sandbox:

+verbatim
DEBUG: Executing command line: cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_MyPaint/MyPaint/work/mypaint-1.1.0" && /opt/local/bin/scons install python_binary=/opt/local/bin/python2.7 python_config=/opt/local/bin/python2.7-config prefix=/opt/local --install-sandbox=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_graphics_MyPaint/MyPaint/work/mypaint-1.1.0/destroot
...
Install file: "mypaint" as "destroot/opt/local/bin/mypaint"
Chmod("destroot/opt/local/bin/mypaint", 0755)
Install file: "brushlib/glib/mypaint-brush.h" as "destroot/opt/local/include/libmypaint/glib/mypaint-brush.h"
Chmod("destroot/opt/local/include/libmypaint/glib/mypaint-brush.h", 0644)
Chmod("/opt/local/include/libmypaint/glib", 0755)
scons: *** [destroot/opt/local/include/libmypaint/glib/mypaint-brush.h] /opt/local/include/libmypaint/glib: No such file or directory
scons: building terminated because of errors.
-verbatim-

Ryan Schmidt <ryandesign>
Fri 04 Jan 2013 05:47:16 PM UTC, comment #4:

Docs updated to reflect requirement for sandbox paths to be absolute: https://gitorious.org/mypaint/mypaint/commit/f37699e8b8d2df4a33a925f313f1f8c1329cac84

Andrew Chadwick <achadwick>
Project Administrator
Fri 04 Jan 2013 05:34:06 PM UTC, comment #3:

Retitled bug to reflect actual issue.

Cannot reproduce actual problem with

on Ubuntu 12.04 LTS. Building with a prefix results in no files being installed whatsoever, although it does create the prefix location if it can, which might be considered a bug.

Please check your versions, and try removing .sconsign.dblite and doing a clean rebuild.

---------------------------------------

Note that you do not have to supply a prefix during a MyPaint build. For an install you of course do have to. It's fine to build with just

then install with

and that will work fine (and just copy files). You can also skip the first step. MyPaint should be able to figure out locations at runtime.

--------------------------------------

Acknowledge the --install-sandbox thing. That's changed since the docs were written, I think (been a while since I touched that).

For now, it can be solved by using an absolute path pointing under the current directory,

which results in only one "SANDBOX" being created rather than four. I'll update the docs to reflect this.

Andrew Chadwick <achadwick>
Project Administrator
Fri 04 Jan 2013 03:00:13 PM UTC, comment #2:

Just to clarify: my problem is not that libmypaint.a gets installed; it's that anything gets installed when I just run "scons prefix=/somewhere"; nothing should get installed until I run "scons prefix=/somewhere install". The README confirms this, and it's how other projects that use scons work.

To update MyPaint in MacPorts to 1.1.0, I ended up building MyPaint using "scons prefix=/somewhere --install-sandbox=path/to/sandbox" as mentioned in the README. This was rather inconvenient because in fact four sandboxes got created—one each in ".", "./po", "./brushlib" and "./brushlib/po". I then had to manually combine these four sandboxes into one in order to install. It worked but is highly unorthodox; I've never seen any other program build that way (and I have some familiarity with other packages—I maintain 400 packages in MacPorts). Maybe that's just how --install-sandbox works; I was unfamiliar with this option.

Ryan Schmidt <ryandesign>
Fri 04 Jan 2013 02:25:44 PM UTC, comment #1:

Confirmed here, using

$ scons
$ scons prefix=/tmp/somewhere

I'd like to be able to say "Consider adding enable_introspection=true. This will require g-ir-scanner which on my system is packaged in gobject-introspection", however for me and even after ldconfig, libmypaint-tests.so is missing.

libmypaint.a is not required at runtime. For now, it (and its headers) could be removed if all you want is a running MyPaint program.

Andrew Chadwick <achadwick>
Project Administrator
Wed 02 Jan 2013 05:57:42 PM UTC, original submission:

Hello, I'm the maintainer of MyPaint in MacPorts, trying to update our port to 1.1.0.

When I have MacPorts run "scons", it tries to install libmypaint.a into $prefix/lib. Things should not be getting installed when I run "scons"; that shouldn't happen until I run "scons install".

MacPorts has safeguards to ensure that kind of thing does not happen, resulting in a permission error being displayed:

I'm attaching the full log. I don't understand scons so I don't know where or why this is happening.

Ryan Schmidt <ryandesign>

 

Attached Files
file #16891:  main.log added by ryandesign (17kB - application/octet-stream)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by achadwick (Posted a comment)
  • -unavailable- added by ryandesign (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 04 Jan 2013 05:34:06 PM UTCachadwickStatusConfirmed=>Need Info
      SummaryRunning "scons" tries to install libmypaint.a=>[OSX] scons: prefix=/somewhere installs stuff and shouldn't. [ALL] --install-sandbox must not be relative
    Fri 04 Jan 2013 02:25:44 PM UTCachadwickStatusNone=>Confirmed
    Wed 02 Jan 2013 05:57:43 PM UTCryandesignAttached File-=>Added main.log, #16891
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup