[ 
https://issues.apache.org/jira/browse/ARROW-17353?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17611990#comment-17611990
 ] 

Kouhei Sutou commented on ARROW-17353:
--------------------------------------

How about defining a version for nightly and use it in {{dev/tasks/}} instead 
of replacing version in {{dev/tasks/r/github.packages.yml}} something like the 
following?

{noformat}
diff --git a/dev/archery/archery/crossbow/core.py 
b/dev/archery/archery/crossbow/core.py
index 560a9f1e19..bacc751a22 100644
--- a/dev/archery/archery/crossbow/core.py
+++ b/dev/archery/archery/crossbow/core.py
@@ -770,6 +770,14 @@ class Target(Serializable):
         # '10.0.0-SNAPSHOT'
         self.no_rc_snapshot_version = re.sub(
             r'\.(dev\d+)$', '-SNAPSHOT', self.no_rc_version)
+        # Substitute dev version with today
+        #
+        # Example:
+        #
+        # '10.0.0.dev235' ->
+        # '10.0.0.20221002'
+        self.no_rc_today_version = re.sub(
+            r'\.(dev\d+)\Z', date.today().strftime('.%Y%m%d'), 
self.no_rc_version)
 
     @classmethod
     def from_repo(cls, repo, head=None, branch=None, remote=None, version=None,
diff --git a/dev/tasks/macros.jinja b/dev/tasks/macros.jinja
index f68aa15d54..1b676b5ccf 100644
--- a/dev/tasks/macros.jinja
+++ b/dev/tasks/macros.jinja
@@ -269,7 +269,7 @@ on:
       rm -f apache-arrow*.rb.bak
 {% endmacro %}
 
-{%- macro github_change_r_pkg_version(is_fork, version = '\\2.\'\"$(date 
+%Y%m%d)\"\'' ) -%}
+{%- macro github_change_r_pkg_version(is_fork, version) -%}
   - name: Modify version
     shell: bash
     run: |
diff --git a/dev/tasks/r/github.packages.yml b/dev/tasks/r/github.packages.yml
index b5b9548d59..ac721b4f60 100644
--- a/dev/tasks/r/github.packages.yml
+++ b/dev/tasks/r/github.packages.yml
@@ -17,10 +17,6 @@
 
 {% import 'macros.jinja' as macros with context %}
 
-# This allows us to set a custom version via param:
-# crossbow submit --param custom_version=8.5.3 r-binary-packages
-# if the param is unset defaults to the usual Ymd naming scheme
-{% set package_version = custom_version|replace("Unset", "\\2.\'\"$(date 
+%Y%m%d)\"\'") %}
 {% set is_fork = macros.is_fork %}
 
 {{ macros.github_header() }}
@@ -35,7 +31,7 @@ jobs:
       pkg_version: {{ '${{ steps.save-version.outputs.pkg_version }}' }}
     steps:
       {{ macros.github_checkout_arrow()|indent }}
-      {{ macros.github_change_r_pkg_version(is_fork, package_version)|indent }}
+      {{ macros.github_change_r_pkg_version(is_fork, 
arrow.no_rc_today_version)|indent }}
       - name: Save Version
         id: save-version
         shell: bash
diff --git a/dev/tasks/tasks.yml b/dev/tasks/tasks.yml
index 2cd6c259ec..ccd3eeeea8 100644
--- a/dev/tasks/tasks.yml
+++ b/dev/tasks/tasks.yml
@@ -953,19 +953,19 @@ tasks:
     params:
       custom_version: Unset
     artifacts:
-      - r-lib__libarrow__bin__windows__arrow-[0-9\.]+\.zip
+      - r-lib__libarrow__bin__windows__arrow-{no_rc_today_version}\.zip
       # The centos job is currently disabled due to the
       # change to C++ 17
-      #- r-lib__libarrow__bin__centos-7__arrow-[0-9\.]+\.zip
-      - r-lib__libarrow__bin__ubuntu-18.04__arrow-[0-9\.]+\.zip
-      - r-lib__libarrow__bin__ubuntu-22.04__arrow-[0-9\.]+\.zip
-      - r-pkg__bin__windows__contrib__4.1__arrow_[0-9\.]+\.zip
-      - r-pkg__bin__windows__contrib__4.2__arrow_[0-9\.]+\.zip
-      - r-pkg__bin__macosx__contrib__4.1__arrow_[0-9\.]+\.tgz
-      - r-pkg__bin__macosx__contrib__4.2__arrow_[0-9\.]+\.tgz
-      - r-pkg__bin__macosx__big-sur-arm64__contrib__4.1__arrow_[0-9\.]+\.tgz
-      - r-pkg__bin__macosx__big-sur-arm64__contrib__4.2__arrow_[0-9\.]+\.tgz
-      - r-pkg__src__contrib__arrow_[0-9\.]+\.tar\.gz
+      #- r-lib__libarrow__bin__centos-7__arrow-{no_rc_today_version}\.zip
+      - r-lib__libarrow__bin__ubuntu-18.04__arrow-{no_rc_today_version}\.zip
+      - r-lib__libarrow__bin__ubuntu-22.04__arrow-{no_rc_today_version}\.zip
+      - r-pkg__bin__windows__contrib__4.1__arrow_{no_rc_today_version}\.zip
+      - r-pkg__bin__windows__contrib__4.2__arrow_{no_rc_today_version}\.zip
+      - r-pkg__bin__macosx__contrib__4.1__arrow_{no_rc_today_version}\.tgz
+      - r-pkg__bin__macosx__contrib__4.2__arrow_{no_rc_today_version}\.tgz
+      - 
r-pkg__bin__macosx__big-sur-arm64__contrib__4.1__arrow_{no_rc_today_version}\.tgz
+      - 
r-pkg__bin__macosx__big-sur-arm64__contrib__4.2__arrow_{no_rc_today_version}\.tgz
+      - r-pkg__src__contrib__arrow_{no_rc_today_version}\.tar\.gz
 
 
   ########################### Release verification ############################
{noformat}

This will generate "r-pkg_*.10.0.0.zip" not "r-pkg_*10.0.0.202210XX.zip" for 
"10.0.0-rc1" because "10.0.0-rc1" doesn't have ".devXXX". 

> [Release] R libarrow binaries have the wrong version number
> -----------------------------------------------------------
>
>                 Key: ARROW-17353
>                 URL: https://issues.apache.org/jira/browse/ARROW-17353
>             Project: Apache Arrow
>          Issue Type: Bug
>          Components: Developer Tools
>    Affects Versions: 9.0.0
>            Reporter: Jacob Wujciak-Jens
>            Priority: Blocker
>             Fix For: 10.0.0
>
>
> The libarrow binaries that are uploaded during the release process have the 
> wrong version number. This is an issue with the submit binaries 
> script/r-binary-packages job. The arrow version should be picked up by the 
> job even if not passed explicitly as a custom param.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to