Skip to content

Apparent bug with paths when deploying dependencies #1110

@jmcdonagh

Description

@jmcdonagh

Hi, using latest Ceedling gem downloaded from your GH release artifacts.

I have a big monorepo managed by rake that I am trying to integrate with ceedling for all the C stuff and C dependencies. One of the dependencies is bash. Here is the relevant configuration from my root project.yaml:

:dependencies:
  :deps:
    - :name: bash
      :paths:
        :fetch: zarf/vendor/bash
        :source: zarf/vendor/bash
        :build: zarf/vendor/bash
        :artifact: zarf/vendor/bash
      :fetch:
        :method: :none
      :build:
        - "./configure --prefix /opt/slithernix --bindir /opt/slithernix/bin"
        - make -j8
      :artifacts:
        :dynamic_libraries:
          - bash
          - bashbug

first off, as a suggestion, artifacts should support an 'executables' field because sometimes dependencies are just a standalone executable and don't need to be linked. i know by default this example breaks linking, but that's not the issue I am here for (aware that i can alter the linking config elsewhere in project.yaml).

The issue is when trying to deploy, the code's FileUtils.cp call is simply looking at the value of the current element in dynamic libraries, but it does not prefix that value with the artifacts path. so, what happens with this config is when you do a

ceedling -v debug dependencies:deploy

you get

🧨 EXCEPTION: No such file or directory @ rb_sysopen - bash

Debug Backtrace ==>
/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:2290:in `initialize': (Errno::ENOENT)
	/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:2290:in `open'
	/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:2290:in `copy_file'
	/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:1088:in `copy_file'
	/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:887:in `block in cp'
	/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:2481:in `block in fu_each_src_dest'
	/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:2495:in `fu_each_src_dest0'
	/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:2479:in `fu_each_src_dest'
	/Users/jmcdonagh/.rvm/rubies/ruby-3.2.8/lib/ruby/3.2.0/fileutils.rb:886:in `cp'
	/Users/jmcdonagh/.rvm/gems/ruby-3.2.8@slithernix-monorepo/gems/ceedling-1.0.1/plugins/dependencies/lib/dependencies.rb:345:in `deploy_if_required'

so if you open up dependencies.rb and go to the deploy_if_required function, and add:

src_path = File.join(@dependencies[lib_path][:paths][:artifact], lib_path)

around line 343 before the deploying dependency log message, and change the FileUtils.cp first arg from lib_path to src_path, it works.

Now, what is more confusing here is that in the docs the examples for dynamic_libraries show paths. yet if i use a path, it "double paths" me and compiles every time because, naturally, rake/make need to see the file there to satisfy the target and zarf/vendor/bash/zarf/vendor/bash/bash is not a thing.

BTW- I am a pretty skilled non-Rails Ruby developer. if you need some help here I can probably squeeze you in. This is an awesome tool and actually a way better version of a piece of garbage I threw together for this exact problem (C dependency management in a monorepo).

Metadata

Metadata

Assignees

No one assigned

    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