Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
gnome-builder
gnome-builder
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 499
    • Issues 499
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 19
    • Merge Requests 19
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • GNOME
  • gnome-buildergnome-builder
  • Issues
  • #1370

Closed
Open
Opened Dec 23, 2020 by Adrien Plazas@aplazasDeveloper

The Rust template is broken

When creating a new Rust GTK template in Builder (3.38 or the current nightly: 3.38.0-80-g39f79014), building it, and running it, it instantaneously crashes with the following error: thread 'main' panicked at 'Could not load resources: Error { domain: g-file-error-quark, code: 4, message: "Failed to open file “/usr/local/share/rust-tuto/rust-tuto.gresource”: open() failed: No such file or directory" }', src/main.rs:17:10.

After searching a bit, I noticed that on a brand new project the PKGDATADIR config variable has the right path for a split second and then it's overwritten with a wrong path:

rust-wrong-config

I also noticed that dropping config.rs from rust_sources in src/meson.build fixes the issue: I can build and run the template correctly. I am not submitting a MR because I have no idea what side effects removing that file could have.

diff --git a/src/plugins/meson-templates/resources/src/meson-rs.build b/src/plugins/meson-templates/resources/src/meson-rs.build
index a29405ba4..e88bc685e 100644
--- a/src/plugins/meson-templates/resources/src/meson-rs.build
+++ b/src/plugins/meson-templates/resources/src/meson-rs.build
@@ -28,7 +28,6 @@ run_command(
 )
 
 rust_sources = files(
-  'config.rs',
   'main.rs',
   'window.rs',
 )
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: GNOME/gnome-builder#1370