snapcraft icon indicating copy to clipboard operation
snapcraft copied to clipboard

[craft-application/core24] $SNAPCRAFT_PROJECT_VERSION and other fields not replaced

Open lengau opened this issue 2 years ago • 1 comments

Bug Description

On core24, $SNAPCRAFT_PROJECT_VERSION and $SNAPCRAFT_PROJECT_NAME are not replaced in parts.

To Reproduce

Build the core24 snap at https://github.com/lengau/hello-snapcraftio

Compare to the (working) core22 snap.

Environment

Ubuntu Noble

snapcraft.yaml

name: hello
base: core24
build-base: devel
confinement: strict
grade: devel

platforms:
  amd64:
  arm64:
  armhf:
  ppc64el:
  riscv64:
  s390x:

version: "2.12.1"
summary: GNU Hello
description: GNU hello prints a friendly greeting.

apps:
  hello:
    command: bin/hello
  universe:
    # '"' is not allowed for commands.
    command: bin/hello -g $SAY
    environment:
      SAY: "Hello, universe!"

parts:
  gnu-hello:
    source: https://git.savannah.gnu.org/git/$SNAPCRAFT_PROJECT_NAME.git
    source-tag: v$SNAPCRAFT_PROJECT_VERSION
    plugin: autotools
    build-packages:
      - wget
      - gperf
      - texinfo
      - help2man
    autotools-configure-parameters:
      - --prefix=/
    stage:
      - -share/man
      - -share/info

Relevant log output

lengau@ratel:~/Projects/hello-snapcraftio$ snapcraft pack --verbosity=verbose
Starting snapcraft, version 8.0.5.post142+gitab1c86df                                                                                                                                                                                                
Logging execution to '/home/lengau/.local/state/snapcraft/log/snapcraft-20240327-201231.164719.log'                                                                                                                                                  
Launching managed ubuntu devel instance...                                                                                                                                                                                                           
Starting instance                                                                                                                                                                                                                                    
Creating instance from base instance                                                                                                                                                                                                                 
Starting instance                                                                                                                                                                                                                                    
Starting snapcraft, version 8.0.5.post142+gitab1c86df                                                                                                                                                                                                
Logging execution to '/tmp/snapcraft.log'                                                                                                                                                                                                            
Initialising lifecycle                                                                                                                                                                                                                               
Installing build-packages                                                                                                                                                                                                                            
Installing build-snaps                                                                                                                                                                                                                               
Pulling gnu-hello                                                                                                                                                                                                                                    
Failed to pull source: command ['git', 'clone', '--recursive', '--branch', 'v$SNAPCRAFT_PROJECT_VERSION', 'https://git.savannah.gnu.org/git/$SNAPCRAFT_PROJECT_NAME.git', '/root/parts/gnu-hello/src'] exited with code 128.                         
Recommended resolution: Make sure sources are correctly specified.                                                                                                                                                                                   
Failed to execute snapcraft in instance.                                                                                                                                                                                                             
Full execution log: '/home/lengau/.local/state/snapcraft/log/snapcraft-20240327-201231.164719.log'

Additional context

No response

lengau avatar Mar 28 '24 00:03 lengau

Thank you for reporting us your feedback!

The internal ticket has been created: https://warthogs.atlassian.net/browse/CRAFT-2655.

This message was autogenerated

Curiously, {SNAP,}CRAFT_PROJECT_GRADE is never replaced.

dilyn-corner avatar Mar 29 '24 17:03 dilyn-corner

I think this is the same as #4704, but I'm not sure

lengau avatar Apr 03 '24 22:04 lengau

Fixed via #4757.

CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION are still not evaluated. Tracking with https://github.com/canonical/craft-application/issues/320

mr-cal avatar Apr 25 '24 13:04 mr-cal