Skip to content

[Bug] Cocoapods not downloading the updated tag source #161

@hystericcore

Description

@hystericcore

What happened?

  pod 'Macros', :macro => {
    :git => '.../macros.git',
    :tag => '0.0.1',
  }

First of all, thank you for this CocoaPods SPM plugin.

I'm trying to use this plugin to integrate the Swift macro into the CocoaPods project, and I'm using this :macro since I don't want to use the SPM for now. But when I update the tag, 0.0.1 -> 0.0.2, it seems that CocoaPods uses the 0.0.1 cache and doesn't download the updated sources.

Am I missing some configuration? and when I manually updated the plugin locally to follow the updated version when it creates a podspec, it seems to try to download the updated sources.

    def prepare_macro_pod_dir(name, requirement)
      link = requirement[:git] || "N/A"
>      spec_version_val = (requirement[:tag] || requirement[:version] || "0.0.1").to_s
      podspec_content = <<~HEREDOC
        Pod::Spec.new do |s|
          s.name = "#{name}"
>          s.version = "#{spec_version_val}" # instead of fixed "0.0.1"
          s.summary = "#{name}"
          s.description = "#{name}"
          s.homepage = "#{link}"
          s.license = "MIT"
          s.authors = "[email protected]"
          s.source = #{requirement}
          s.source_files = "Sources/**/*"
        end
      HEREDOC

CocoaPods environment

Stack

   CocoaPods : 1.15.2
        Ruby : ruby 3.1.6p260 (2024-05-29 revision a777087be6) [arm64-darwin23]
    RubyGems : 3.3.27
        Host : macOS 15.4.1 (24E263)
       Xcode : 16.0 (16A242d)
         Git : git version 2.39.5 (Apple Git-154)
Ruby lib dir : /Users/hyunjoon.park/.rbenv/versions/3.1.6/lib

               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/hyunjoon.park/.rbenv/versions/3.1.6/bin/pod

Podfile

require 'json'
require 'xcodeproj'

if is_skip_pods_integration_enabled
  install! 'cocoapods',
    integrate_targets: false,
    skip_pods_project_generation: true
end

ios_deployment_target = '12.0'
swift_version = '5.0'

platform :ios, ios_deployment_target
plugin 'cocoapods-spm'

config_cocoapods_spm(
  dont_prebuild_macros: true,
)

inhibit_all_warnings!
use_frameworks!

if is_skip_pods_integration_enabled
  project 'AppName',
    'Debug' => :debug,
    'Release' => :release,
    'Testing' => :testing
else
  project 'AppName'
end

...

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions