Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lengau opened this issue Mar 28, 2024 · 4 comments
Labels
bug Actual bad behavior that don't fall into maintenance or documentation

Comments

@lengau
Copy link
Contributor

lengau commented Mar 28, 2024

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 lengau added the bug Actual bad behavior that don't fall into maintenance or documentation label Mar 28, 2024
Copy link

Thank you for reporting us your feedback!

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

This message was autogenerated

@dilyn-corner
Copy link

dilyn-corner commented Mar 29, 2024

Curiously, {SNAP,}CRAFT_PROJECT_GRADE is never replaced.

@lengau
Copy link
Contributor Author

lengau commented Apr 3, 2024

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

@mr-cal
Copy link
Collaborator

mr-cal commented Apr 25, 2024

Fixed via #4757.

CRAFT_PROJECT_NAME and CRAFT_PROJECT_VERSION are still not evaluated. Tracking with canonical/craft-application#320

@mr-cal mr-cal closed this as completed Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Actual bad behavior that don't fall into maintenance or documentation
Projects
None yet
Development

No branches or pull requests

3 participants