How to get aliasing working?

I asked a question on Ask Ubuntu about how to make snaps depend on each other, which it seems is not possible. The only answer so far referred me to using aliases. However I cannot get them to work.

I’ve modified the example in the first post I referred to as follows:

    command: ui
    aliases: [ui]

    command: server
    aliases: [server]

    command: bar
    aliases: [bar]

I’ve updated the snap using snapcraft and I’ve installed it using the --devmode --dangerous flags, but I don’t see any of these commands being automatically aliased. Am I missing something?

I’m not sure aliases solve the reference problems, it depends how things are invoked, usually snap commands should invoke each other using internal names, the external commands/names are not always available.

That post about aliases is out-of-date as well, this has information about more recent changes/workings: Improving the aliases implementation

1 Like

should invoke each other using internal names

So in the example I referred to, the server should be able to see the bar application by just invoking it with bar right?

UPDATE: apparently server cannot spawn bar, I get a “permission denied” error.

I don’t remember what’s the status quo, it’s likely that /snap/bin is in the PATH but is not useful internally because of the access issues you mentioned. Not sure what’s the intention here. Somebody else can chime in on that.

I just saw that I cannot execute bar manualy because of a permission denied problem. I’m downloading the zip file of the application to see if the command referred in my snapcraft.yaml configuration does not have the right permissions…

I’m downloading the zip file of the application to see if the command referred in my snapcraft.yaml configuration does not have the right permissions…

No it doesn’t :frowning: The other problem ahead I see is that the executable contains some shared libraries packaged with it, and I’m not sure how or if snap handles that:

  inflating: bin/  
  inflating: bin/libz3.a             
  inflating: bin/            
  inflating: bin/        
  inflating: bin/Microsoft.Z3.dll    
  inflating: bin/Microsoft.Z3.xml    
   creating: bin/python/
  inflating: bin/python/   
   creating: bin/python/z3/
  inflating: bin/python/z3/     
  inflating: bin/python/z3/z3.pyc    
  inflating: bin/python/z3/  
  inflating: bin/python/z3/z3consts.pyc  
  inflating: bin/python/z3/  
  inflating: bin/python/z3/z3core.pyc  
  inflating: bin/python/z3/  
  inflating: bin/python/z3/z3num.pyc  
  inflating: bin/python/z3/  
  inflating: bin/python/z3/z3poly.pyc  
  inflating: bin/python/z3/  
  inflating: bin/python/z3/z3printer.pyc  
  inflating: bin/python/z3/  
  inflating: bin/python/z3/z3rcf.pyc  
  inflating: bin/python/z3/  
  inflating: bin/python/z3/z3types.pyc  
  inflating: bin/python/z3/  
  inflating: bin/python/z3/z3util.pyc  
  inflating: bin/python/z3/  
  inflating: bin/python/z3/__init__.pyc  
  inflating: bin/z3                  
   creating: include/
  inflating: include/z3++.h          
  inflating: include/z3.h            
  inflating: include/z3_algebraic.h  
  inflating: include/z3_api.h        
  inflating: include/z3_ast_containers.h  
  inflating: include/z3_fixedpoint.h  
  inflating: include/z3_fpa.h        
  inflating: include/z3_interp.h     
  inflating: include/z3_macros.h     
  inflating: include/z3_optimization.h  
  inflating: include/z3_polynomial.h  
  inflating: include/z3_rcf.h        
  inflating: include/z3_spacer.h     
  inflating: include/z3_v1.h         
  inflating: LICENSE.txt