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

build failed on DragonFlyBSD-6.4 #130617

Closed
leleliu008 opened this issue Feb 27, 2025 · 5 comments · Fixed by #130634
Closed

build failed on DragonFlyBSD-6.4 #130617

leleliu008 opened this issue Feb 27, 2025 · 5 comments · Fixed by #130634
Labels
OS-unsupported type-bug An unexpected behavior, bug, or error

Comments

@leleliu008
Copy link
Contributor

leleliu008 commented Feb 27, 2025

Bug report

Bug description:

2025-02-27T04:16:40.9317730Z /usr/bin/cc -pthread  -fno-strict-overflow -Wsign-compare -DNDEBUG -g -O3 -Wall -I/root/.xbuilder/run/1051/auxroot/include -fPIC -fno-common -Os    -I/root/.xbuilder/run/1051/auxroot/include -fPIC -fno-common -Os     -g -std=c11 -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration -fvisibility=hidden  -I./Include/internal -I./Include/internal/mimalloc  -I. -I./Include -I/root/.xbuilder/run/1051/auxroot/include   -I/root/.xbuilder/run/1051/auxroot/include/tirpc -I/root/.xbuilder/run/1051/auxroot/include   -I/root/.xbuilder/run/1051/auxroot/include/tirpc  -DPy_BUILD_CORE_BUILTIN -c ./Modules/timemodule.c -o Modules/timemodule.o
2025-02-27T04:16:41.0793065Z In file included from ./Include/Python.h:64,
2025-02-27T04:16:41.0798014Z                  from ./Modules/timemodule.c:3:
2025-02-27T04:16:41.0798662Z ./Modules/timemodule.c: In function 'time_clockid_converter':
2025-02-27T04:16:41.0799495Z ./Include/pymacro.h:23:25: error: static assertion failed: "sizeof(clk_id) == sizeof(*p)"
2025-02-27T04:16:41.0800210Z  #  define static_assert _Static_assert
2025-02-27T04:16:41.0800628Z                          ^~~~~~~~~~~~~~
2025-02-27T04:16:41.0801204Z ./Include/pymacro.h:77:13: note: in expansion of macro 'static_assert'
2025-02-27T04:16:41.0801791Z              static_assert((cond), #cond); \
2025-02-27T04:16:41.0802179Z              ^~~~~~~~~~~~~
2025-02-27T04:16:41.0802658Z ./Modules/timemodule.c:201:5: note: in expansion of macro 'Py_BUILD_ASSERT'
2025-02-27T04:16:41.0803366Z      Py_BUILD_ASSERT(sizeof(clk_id) == sizeof(*p));
2025-02-27T04:16:41.0803764Z      ^~~~~~~~~~~~~~~
2025-02-27T04:16:41.1033318Z gmake: *** [Makefile:3534: Modules/timemodule.o] Error 1
2025-02-27T04:16:41.1037795Z gmake: *** Waiting for unfinished jobs....

fulllogs:
https://github.com/leleliu008/python-distribution/actions/runs/13558699714/job/37897846484

CPython versions tested on:

3.13

https://www.python.org/ftp/python/3.13.2/Python-3.13.2.tgz

Operating systems tested on:

DragonFlyBSD-6.4

Linked PRs

@leleliu008 leleliu008 added the type-bug An unexpected behavior, bug, or error label Feb 27, 2025
@vstinner
Copy link
Member

vstinner commented Feb 27, 2025

What is the size of the clockid_t type on DragonFlyBSD?

@leleliu008
Copy link
Contributor Author

What is the size of the clockid_t type on DragonFlyBSD?

sizeof(clockid_t) => 8
typedef unsigned long __clockid_t;
typedef __clockid_t clockid_t;

@leleliu008
Copy link
Contributor Author

I guess adding the following code to https://github.com/python/cpython/blob/main/Modules/timemodule.c#L188-L192 would work:

#elif defined(__DragonFly__)
    long clk_id = PyLong_AsLong(obj);

@vstinner
Copy link
Member

I guess adding the following code to https://github.com/python/cpython/blob/main/Modules/timemodule.c#L188-L192 would work: (...)

Yes, it looks like a good fix. Do you want to propose a PR?

vstinner pushed a commit that referenced this issue Feb 28, 2025
Signed-off-by: leleliu008 <leleliu008@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 28, 2025
…H-130634)

(cherry picked from commit e419817)

Co-authored-by: leleliu008 <leleliu008@gmail.com>
Signed-off-by: leleliu008 <leleliu008@gmail.com>
@vstinner
Copy link
Member

Fixed by change e419817.

vstinner pushed a commit that referenced this issue Feb 28, 2025
) (#130666)

gh-130617 : fix time_clockid_converter on DragonFlyBSD (GH-130634)
(cherry picked from commit e419817)

Signed-off-by: leleliu008 <leleliu008@gmail.com>
Co-authored-by: leleliu008 <leleliu008@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-unsupported type-bug An unexpected behavior, bug, or error
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants