Skip to content
This repository has been archived by the owner on Jan 1, 2021. It is now read-only.

Two quick questions #2

Open
kaithar opened this issue Sep 2, 2014 · 4 comments
Open

Two quick questions #2

kaithar opened this issue Sep 2, 2014 · 4 comments

Comments

@kaithar
Copy link

kaithar commented Sep 2, 2014

Hi, like the script, it's a rather nice base for what I was looking to do. I do have a couple of questions though...

1: Did you intend to nuke python 2.7 from the image? When trying to build I'm noticing this:

++ sed -n 's/.PYTHON_TARGETS="([^"])".*/\1/p'

  • pythonTarget='python2_7 python3_3'
  • pythonTarget=python3_3
  • echo 'PYTHON_TARGETS="python3_3"'
  • echo 'PYTHON_SINGLE_TARGET="python3_3"'

2: The build script mounts /usr/portage as a volume from the host, mounting as read only. That's not going to work too well if portage wants to pull something as it expects /usr/portage/distfiles to be writable. Is that intentional behaviour or just not encountered? Or, I suppose, encountered but not gotten round to fixing, heh?

@wking
Copy link
Contributor

wking commented Sep 2, 2014

On Tue, Sep 02, 2014 at 02:20:05PM -0700, kaithar wrote:

1: Did you intend to nuke python 2.7 from the image?

Yes. See #1.

2: The build script mounts /usr/portage as a volume from the host,
mounting as read only. That's not going to work too well if portage
wants to pull something as it expects /usr/portage/distfiles to be
writable.

Good catch. That's going to be a problem if the rebuild 1 needs
something that you don't already have in your distfiles.

For an alternative approach, you can volume-mount from a writeable
Portage image 2 or just drop the ‘ro’ flags.

@kaithar
Copy link
Author

kaithar commented Sep 3, 2014

facepalm forgot to check closed issues.
Would be nice to be able to have that optional ... there's still quite a bit of python2 only code knocking around and a lot of my own code hasn't been ported over yet.

For an alternative approach, you can volume-mount from a writeable
Portage image [2] or just drop the ‘ro’ flags.

Actually I've a better trick, now I'm awake enough to hunt out the option:

"""
DISTDIR = [path]
Defines the location of your local source file repository. After packages are built, it is safe to remove any and all files from this directory since they will be automatically fetched on demand for a given build. If you would like to selectively prune obsolete files from this directory, see eclean(1) from the gentoolkit package.

Use the PORTAGE_RO_DISTDIRS variable to specify one or more read-only directories containing distfiles.

Note that locations under /usr/portage are not necessarily safe for data storage. See the PORTDIR documentation for more information.
Defaults to /usr/portage/distfiles.
"""

Could set PORTAGE_RO_DISTDIRS to /usr/portage/distfiles and then point DISTDIR somewhere else for files that aren't already available. Would work better long term too.
Sharing /usr/portage rw feels a little unsafe heh.

Edit: I always forget that it doesn't word wrap indented blocks ¬_¬

@wking
Copy link
Contributor

wking commented Sep 3, 2014

On Wed, Sep 03, 2014 at 08:33:36AM -0700, kaithar wrote:

Would be nice to be able to have that optional ... there's still
quite a bit of python2 only code knocking around and a lot of my own
code hasn't been ported over yet.

The motivation for dropping Python 2 was to get a cleaner, smaller
tarball. From #gentoo-docker (now #gentoo-containers) on freenode,
2014-06-19:

13:23 < tianon> I was hoping I could purge either python2 or python3
(since it seems silly to have both), but portage depends on both :P

13:27 < tianon> that'd beg the question of how much space that
actually saves us :)

13:27 < wking> probably not much space, but it's a prettier world
with only Python 3 ;)
13:27 < tianon> #truth

15:37 < tianon> that shaves off about 5MB from the final xz
15:37 < tianon> nice

If you want Python 2, you can always clear PYTHON_TARGETS and
PYTHON_SINGLE_TARGET and re-emerge.

For an alternative approach, you can volume-mount from a writeable
Portage image [2] or just drop the ‘ro’ flags.

Actually I've a better trick, now I'm awake enough to hunt out the option:
[snip DISTDIR / PORTAGE_RO_DISTDIRS approach]

Sounds good to me. I imagine @tianon would merge a PR doing that.

@tianon
Copy link
Owner

tianon commented Sep 3, 2014

On 3 September 2014 10:28, W. Trevor King [email protected] wrote:

Actually I've a better trick, now I'm awake enough to hunt out the option:
[snip DISTDIR / PORTAGE_RO_DISTDIRS approach]

Sounds good to me. I imagine @tianon would merge a PR doing that.

+1 :)

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

No branches or pull requests

3 participants