Bug 4614 - In shallow git checkout, build fails with `version.h:32:54: error: invalid suffix "d76d2" on integer constant` due to wrong version number.
Summary: In shallow git checkout, build fails with `version.h:32:54: error: invalid su...
Status: RESOLVED WONTFIX
Alias: None
Product: Claws Mail (GTK 2)
Classification: Unclassified
Component: Other (show other bugs)
Version: 3.19.1
Hardware: PC Linux
: P3 minor
Assignee: users
URL:
Depends on:
Blocks:
 
Reported: 2022-07-14 20:12 UTC by linux.felixbecker2
Modified: 2022-07-14 21:50 UTC (History)
1 user (show)

See Also:


Attachments

Description linux.felixbecker2 2022-07-14 20:12:33 UTC
A shallow git checkout leads to version number generation that is invalid and makes a build fail:

```
git clone --single-branch --depth 1 --shallow-submodules --branch gtk2 git://git.claws-mail.org/claws.git claws-mail
./autogen.sh
make
```

fails with errors like

```
claws.c: In function 'claws_get_version':
version.h:32:54: error: invalid suffix "d76d2" on integer constant
   32 | #define VERSION_NUMERIC         MAKE_NUMERIC_VERSION(5d76d2, 5d76d2, \
      |                                                      ^~~~~~
```

After the `./autogen`, there is a file `version` which contains  
```
echo 5d76d2
```

If instead of the above git clone command I use

```
git clone git://git.claws-mail.org/claws.git claws-mail
git switch gtk2
git checkout gtk2
./autogen.sh
make
```

those errors does not occur, and `version` contains  
```
echo 3.19.0-48-g5d76d2
```

Regards!

Note You need to log in before you can comment on or make changes to this bug.