diff mbox series

[2/2,v2] sassc: fix runtime version

Message ID 20250425065438.377577-2-yi.zhao@windriver.com
State New
Headers show
Series [1/2,v2] libsass: fix runtime version | expand

Commit Message

Yi Zhao April 25, 2025, 6:54 a.m. UTC
The sassc_version.h should be generated from sassc_version.h.in. But
there is already a sassc_version.h file in source directory. When ${S}
!= ${B}, the sassc_version.h is generated in build directory, and the
original sassc_version.h in source directory is not overwritten.
However, the latter is used during the build, resulting in a missing
runtime version. Remove sassc_version.h from source directory to ensure
that the one in build directory is used during the build.

Before the fix:
$ sassc --version
sassc: [NA]
libsass: [NA]
sass2scss: 1.1.1
sass: 3.5

After the fix:
$ sassc  --version
sassc: 3.6.2
libsass: 3.6.6
sass2scss: 1.1.1
sass: 3.5

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
 ...assc_version.h-from-source-directory.patch | 61 +++++++++++++++++++
 meta/recipes-support/sass/sassc_git.bb        |  4 +-
 2 files changed, 64 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch

Comments

Richard Purdie April 25, 2025, 7:11 a.m. UTC | #1
On Fri, 2025-04-25 at 14:54 +0800, Yi Zhao via lists.openembedded.org wrote:
> The sassc_version.h should be generated from sassc_version.h.in. But
> there is already a sassc_version.h file in source directory. When ${S}
> != ${B}, the sassc_version.h is generated in build directory, and the
> original sassc_version.h in source directory is not overwritten.
> However, the latter is used during the build, resulting in a missing
> runtime version. Remove sassc_version.h from source directory to ensure
> that the one in build directory is used during the build.
> 
> Before the fix:
> $ sassc --version
> sassc: [NA]
> libsass: [NA]
> sass2scss: 1.1.1
> sass: 3.5
> 
> After the fix:
> $ sassc  --version
> sassc: 3.6.2
> libsass: 3.6.6
> sass2scss: 1.1.1
> sass: 3.5
> 
> Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
> ---
>  ...assc_version.h-from-source-directory.patch | 61 +++++++++++++++++++
>  meta/recipes-support/sass/sassc_git.bb        |  4 +-
>  2 files changed, 64 insertions(+), 1 deletion(-)
>  create mode 100644 meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch
> 
> diff --git a/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch b/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch
> new file mode 100644
> index 0000000000..04f42d7322
> --- /dev/null
> +++ b/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch
> @@ -0,0 +1,61 @@
> +From b5d03d5313d4cc19a7e6e9ba5fd74d1f8400cd46 Mon Sep 17 00:00:00 2001
> +From: Yi Zhao <yi.zhao@windriver.com>
> +Date: Thu, 24 Apr 2025 21:28:55 +0800
> +Subject: [PATCH] Remove sassc_version.h from source directory
> +
> +The sassc_version.h should be generated from sassc_version.h.in. If the
> +build directory is out of the source directory, the sassc_version.h is
> +generated in build directory and the original sassc_version.h in source
> +directory is not overwritten. However, the latter is used during the
> +build, resulting in a missing runtime version:
> +
> +$ sassc --version
> +sassc: [NA]
> +libsass: [NA]
> +sass2scss: 1.1.1
> +sass: 3.5
> +
> +Remove sassc_version.h from source directory to ensure that the
> +sassc_version.h in build directory is used during the build.
> +
> +Also remove '--dirty' option from 'git describe' command line in
> +version.sh to get rid of '-dirty' suffix from version number that
> +was introduced with this change.
> +
> +Upstream-Status: Inactive-Upstream [lastcommit: 2020 lastrelease: 2020]

I think this is still worth submitting upstream since the rest of the
project is active and it may be this component hasn't needed changes
rather than being inactive.

I'd note "Add a deprecation message to the readme":

https://github.com/sass/sassc/pull/275/commits/0d4b8c835b79baa776a8636be0cb74ed4a969d64

which may mean we should look at what is using this in core and if
changes should be made. It looks like the only user is libadwaita and
the dependency is optional there...

Cheers,

Richard
Yi Zhao April 25, 2025, 7:22 a.m. UTC | #2
On 4/25/25 15:11, Richard Purdie wrote:
> On Fri, 2025-04-25 at 14:54 +0800, Yi Zhao via lists.openembedded.org wrote:
>> The sassc_version.h should be generated from sassc_version.h.in. But
>> there is already a sassc_version.h file in source directory. When ${S}
>> != ${B}, the sassc_version.h is generated in build directory, and the
>> original sassc_version.h in source directory is not overwritten.
>> However, the latter is used during the build, resulting in a missing
>> runtime version. Remove sassc_version.h from source directory to ensure
>> that the one in build directory is used during the build.
>>
>> Before the fix:
>> $ sassc --version
>> sassc: [NA]
>> libsass: [NA]
>> sass2scss: 1.1.1
>> sass: 3.5
>>
>> After the fix:
>> $ sassc  --version
>> sassc: 3.6.2
>> libsass: 3.6.6
>> sass2scss: 1.1.1
>> sass: 3.5
>>
>> Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
>> ---
>>   ...assc_version.h-from-source-directory.patch | 61 +++++++++++++++++++
>>   meta/recipes-support/sass/sassc_git.bb        |  4 +-
>>   2 files changed, 64 insertions(+), 1 deletion(-)
>>   create mode 100644 meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch
>>
>> diff --git a/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch b/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch
>> new file mode 100644
>> index 0000000000..04f42d7322
>> --- /dev/null
>> +++ b/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch
>> @@ -0,0 +1,61 @@
>> +From b5d03d5313d4cc19a7e6e9ba5fd74d1f8400cd46 Mon Sep 17 00:00:00 2001
>> +From: Yi Zhao <yi.zhao@windriver.com>
>> +Date: Thu, 24 Apr 2025 21:28:55 +0800
>> +Subject: [PATCH] Remove sassc_version.h from source directory
>> +
>> +The sassc_version.h should be generated from sassc_version.h.in. If the
>> +build directory is out of the source directory, the sassc_version.h is
>> +generated in build directory and the original sassc_version.h in source
>> +directory is not overwritten. However, the latter is used during the
>> +build, resulting in a missing runtime version:
>> +
>> +$ sassc --version
>> +sassc: [NA]
>> +libsass: [NA]
>> +sass2scss: 1.1.1
>> +sass: 3.5
>> +
>> +Remove sassc_version.h from source directory to ensure that the
>> +sassc_version.h in build directory is used during the build.
>> +
>> +Also remove '--dirty' option from 'git describe' command line in
>> +version.sh to get rid of '-dirty' suffix from version number that
>> +was introduced with this change.
>> +
>> +Upstream-Status: Inactive-Upstream [lastcommit: 2020 lastrelease: 2020]
> I think this is still worth submitting upstream since the rest of the
> project is active and it may be this component hasn't needed changes
> rather than being inactive.

I will send it upstream.


Thanks,

Yi


>
> I'd note "Add a deprecation message to the readme":
>
> https://github.com/sass/sassc/pull/275/commits/0d4b8c835b79baa776a8636be0cb74ed4a969d64
>
> which may mean we should look at what is using this in core and if
> changes should be made. It looks like the only user is libadwaita and
> the dependency is optional there...
>
> Cheers,
>
> Richard
diff mbox series

Patch

diff --git a/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch b/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch
new file mode 100644
index 0000000000..04f42d7322
--- /dev/null
+++ b/meta/recipes-support/sass/sassc/0001-Remove-sassc_version.h-from-source-directory.patch
@@ -0,0 +1,61 @@ 
+From b5d03d5313d4cc19a7e6e9ba5fd74d1f8400cd46 Mon Sep 17 00:00:00 2001
+From: Yi Zhao <yi.zhao@windriver.com>
+Date: Thu, 24 Apr 2025 21:28:55 +0800
+Subject: [PATCH] Remove sassc_version.h from source directory
+
+The sassc_version.h should be generated from sassc_version.h.in. If the
+build directory is out of the source directory, the sassc_version.h is
+generated in build directory and the original sassc_version.h in source
+directory is not overwritten. However, the latter is used during the
+build, resulting in a missing runtime version:
+
+$ sassc --version
+sassc: [NA]
+libsass: [NA]
+sass2scss: 1.1.1
+sass: 3.5
+
+Remove sassc_version.h from source directory to ensure that the
+sassc_version.h in build directory is used during the build.
+
+Also remove '--dirty' option from 'git describe' command line in
+version.sh to get rid of '-dirty' suffix from version number that
+was introduced with this change.
+
+Upstream-Status: Inactive-Upstream [lastcommit: 2020 lastrelease: 2020]
+
+Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
+---
+ sassc_version.h | 8 --------
+ version.sh      | 2 +-
+ 2 files changed, 1 insertion(+), 9 deletions(-)
+ delete mode 100644 sassc_version.h
+
+diff --git a/sassc_version.h b/sassc_version.h
+deleted file mode 100644
+index 3ca12e3..0000000
+--- a/sassc_version.h
++++ /dev/null
+@@ -1,8 +0,0 @@
+-#ifndef SASSC_VERSION_H
+-#define SASSC_VERSION_H
+-
+-#ifndef SASSC_VERSION
+-#define SASSC_VERSION "[NA]"
+-#endif
+-
+-#endif
+diff --git a/version.sh b/version.sh
+index d56af99..cf97d82 100755
+--- a/version.sh
++++ b/version.sh
+@@ -1,5 +1,5 @@
+ if test "x$SASSC_VERSION" = "x"; then
+-  SASSC_VERSION=`git describe --abbrev=4 --dirty --always --tags 2>/dev/null`
++  SASSC_VERSION=`git describe --abbrev=4 --always --tags 2>/dev/null`
+ fi
+ if test "x$SASSC_VERSION" = "x"; then
+   SASSC_VERSION=`cat VERSION 2>/dev/null`
+-- 
+2.34.1
+
diff --git a/meta/recipes-support/sass/sassc_git.bb b/meta/recipes-support/sass/sassc_git.bb
index b7f57ca244..64e92f48cf 100644
--- a/meta/recipes-support/sass/sassc_git.bb
+++ b/meta/recipes-support/sass/sassc_git.bb
@@ -7,7 +7,9 @@  DEPENDS = "libsass"
 
 inherit autotools pkgconfig
 
-SRC_URI = "git://github.com/sass/sassc.git;branch=master;protocol=https"
+SRC_URI = "git://github.com/sass/sassc.git;branch=master;protocol=https \
+           file://0001-Remove-sassc_version.h-from-source-directory.patch"
+
 SRCREV = "66f0ef37e7f0ad3a65d2f481eff09d09408f42d0"
 S = "${WORKDIR}/git"
 PV = "3.6.2"