Commit 95c45fe0 authored by Jérome Perrin's avatar Jérome Perrin

component/caddy: make it possible to extend the workspace

by using a trailing, \ we can do in another profile:

[buildout]
extends = ../../component/caddy/buildout.cfg

[gowork]
install +=
  github.com/xxx/yyy \
parent 41343688
...@@ -8,8 +8,9 @@ parts = ...@@ -8,8 +8,9 @@ parts =
caddy caddy
[gowork] [gowork]
# the trailing \ is so that we can user += in other components sharing the workspace
install = install =
github.com/mholt/caddy github.com/mholt/caddy \
[caddy] [caddy]
recipe = slapos.recipe.cmmi recipe = slapos.recipe.cmmi
......
  • @luke I had to do this so that to be able to "extend" the workspace with other packages here 41343688

    I might be misunderstanding, but I think we have one go workspace per software release.

    /cc @kirr

  • mentioned in commit kirr/slapos@f3a19ab9

    Toggle commit list
  • mentioned in merge request nexedi/slapos!430 (merged)

    Toggle commit list
  • @jerome, thanks for heads up. Yes, gowork is only one per whole build - it is umbrella place for everything from Go land - like e.g. eggs is umbrella place for Python etc. From this point of view gowork.install is similar to buildout.parts - it is only one and global.

    Regarding "" - I propose we drop it completely - please see (untested for now) nexedi/slapos!430 (merged).

  • Yes, thanks. If this works I'll drop this commit and update the rest of the MR where it's used ( nexedi/slapos!417 (merged) )

  • Thanks guys :)

  • By the way, buildout somehow supports installing different versions of eggs in different sections:

    [buildout]
    parts = a b
    
    [a]
    recipe = zc.recipe.egg
    eggs =
      slapos.recipe.cmmi==0.8
    interpreter = python-0.8
    
    [b]
    recipe = zc.recipe.egg
    eggs =
      slapos.recipe.cmmi==0.7
    interpreter = python-0.7
    $ ./bin/buildout 
    Creating directory '/tmp/xxx/eggs'.
    Getting distribution for 'zc.recipe.egg>=2.0.6'.
    Got zc.recipe.egg 2.0.7.
    Updating a.
    Getting distribution for 'slapos.recipe.cmmi==0.8'.
    Got slapos.recipe.cmmi 0.8.
    Getting distribution for 'slapos.recipe.build>=0.37'.
    Got slapos.recipe.build 0.39.
    Updating b.
    Getting distribution for 'slapos.recipe.cmmi==0.7'.
    Got slapos.recipe.cmmi 0.7.
    $ echo "import slapos.recipe.cmmi; print slapos.recipe.cmmi" | /tmp/xxx/bin/python-0.7
    
    >>> <module 'slapos.recipe.cmmi' from '/tmp/xxx/eggs/slapos.recipe.cmmi-0.7-py2.7.egg/slapos/recipe/cmmi/__init__.pyc'>
    
    >>> $ 
    $ echo "import slapos.recipe.cmmi; print slapos.recipe.cmmi" | /tmp/xxx/bin/python-0.8
    
    >>> <module 'slapos.recipe.cmmi' from '/tmp/xxx/eggs/slapos.recipe.cmmi-0.8-py2.7.egg/slapos/recipe/cmmi/__init__.pyc'>
    
    >>> $ 

    I'm not sure we are relying on it though.

    With go.work with don't have this flexibility. But once again, for now we don't seem to need it.

  • @jerome, if we ever needs this, we'll first need to upgrade gowork to support Go modules:

    https://golang.org/doc/go1.11#modules
    https://go.googlesource.com/proposal/+/master/design/24301-versioned-go.md

  • mentioned in commit kirr/slapos@fb7bfddb

    Toggle commit list
  • mentioned in commit nexedi/slapos@754acb1b

    Toggle commit list
  • mentioned in merge request nexedi/slapos!417 (merged)

    Toggle commit list
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment