Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error at build: Cannot convert from int64 to time_t #1420

Open
raspbeguy opened this issue Sep 3, 2024 · 7 comments
Open

Error at build: Cannot convert from int64 to time_t #1420

raspbeguy opened this issue Sep 3, 2024 · 7 comments

Comments

@raspbeguy
Copy link

Describe the bug

I'm trying to build release version 4.11.0.

At build time, I've got several errors:

../src/Services/CalendarEvents/Util.vala:164.16-164.25: error: Assignment: Cannot convert from `int64' to `time_t'
  164 |         time_t start_unix = start_time.as_timet_with_zone (system_timezone);
      |                ^~~~~~~~~~                                                   
../src/Services/CalendarEvents/Util.vala:165.16-165.23: error: Assignment: Cannot convert from `int64' to `time_t'
  165 |         time_t end_unix = end_time.as_timet_with_zone (system_timezone);

To Reproduce
After installing all dependencies, try to compile by running:

meson build --prefix=/usr
cd build
ninja

Expected behavior
Build should succeed

Desktop (please complete the following information):

  • OS or DE: Alpine Linux

Additional context
Trying to package the program for the Alpine distro.

@raspbeguy raspbeguy changed the title Error at build: Cannot convert from int64' to time_t' Error at build: Cannot convert from int64 to time_t Sep 3, 2024
@raspbeguy
Copy link
Author

raspbeguy commented Sep 4, 2024

Seems to be fixed by casting to time_t the result of start_time.as_timet_with_zone (system_timezone).

Now I've got:

src/io.github.alainm23.planify.p/Services/CalendarEvents/CalendarEvents.c: In function 'services_calendar_events_constructor':
src/io.github.alainm23.planify.p/Services/CalendarEvents/CalendarEvents.c:2297:31: error: '_NL_TIME_FIRST_WEEKDAY' undeclared (first use in this function)
 2297 |         _tmp8_ = nl_langinfo (_NL_TIME_FIRST_WEEKDAY);
      |                               ^~~~~~~~~~~~~~~~~~~~~~

This error seems to be related to glibc. Alpine Linux uses musl instead of glibc.

@raspbeguy
Copy link
Author

Vala error seems to come from:

../src/Services/CalendarEvents/CalendarEvents.vala: In function 'services_calendar_events_constructor':
../src/Services/CalendarEvents/CalendarEvents.vala:68:24: error: '_NL_TIME_FIRST_WEEKDAY' undeclared (first use in this function)
   68 |         int week_start = Posix.NLTime.FIRST_WEEKDAY.to_string ().data[0];
      |                        ^~~~~~~~~~~~~~~~~~~~~~

@golamrabbiazad
Copy link
Contributor

yesterday, I built the project and it was successfully built with 0 errors. Please ensure that your valac compiler version is up to date, preferably v0.56.17.

@raspbeguy
Copy link
Author

I am using valac 0.56.16 (version available in Alpine Linux Edge) which isn't that old. I will try to update it, but I'm not convinced that's the problem. Did you try to build it with musl libc?

@golamrabbiazad
Copy link
Contributor

No, I haven't tried to build with musl libc. Is it a dependency for this project?

@golamrabbiazad
Copy link
Contributor

Actually, I have satisfied the dependency needs for the project, built it, and it was successfully built.

@raspbeguy
Copy link
Author

This is not. Musl is a libc, like glibc. Glibc is adopted by most Linux distros, except a few like Alpine, which chose to replace glibc by musl.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants