Skip to content

[desktop_drop] Linux snap build fails due to std::getenv not available #424

@OutdatedGuy

Description

@OutdatedGuy

When building a snap of a flutter linux app using desktop_drop plugin, the build fails with an error:

/root/parts/desktop-drop-example/build/linux/flutter/ephemeral/.plugin_symlinks/desktop_drop/linux/desktop_drop_plugin.cc:69:29: error: no member named 'getenv' in namespace 'std'; did you mean simply 'getenv'?

This does not happen when building using flutter build linux

Reproduce Steps

Steps to reproduce the behavior:

  1. Copy the sample snapcraft.yaml file into the snap/ directory at the root of the plugin's example app
  2. Install snapcraft and other things mentioned here: https://docs.flutter.dev/deployment/linux
  3. Run snapcraft --use-lxd
  4. See compilation error about desktop_drop_plugin.cc

Expected behavior

snapcraft --use-lxd should build without any compilation errors same as flutter build linux

Version (please complete the following information):

  • Flutter Version: v3.32.7
  • OS: Linux
  • plugin: desktop_drop: 0.6.0
snapcraft.yaml

name: desktop-drop-example
version: 1.0.0
summary: Desktop Drop Example
description: Demonstrates how to use the desktop_drop plugin.

confinement: strict
base: core22
grade: stable

slots:
  dbus-desktop-drop-example:
    interface: dbus
    bus: session
    name: rocks.outdatedguy.zoom_attendance_tracker

apps:
  desktop-drop-example:
    command: desktop_drop_example
    extensions: [gnome]
    plugs:
      - home
      - removable-media
      - desktop
    slots:
      - dbus-desktop-drop-example

parts:
  desktop-drop-example:
    source: .
    plugin: flutter
    flutter-target: lib/main.dart

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions