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

sys/sys/param.h in freebsd/main loses comment after __FreeBSD_version #193

Closed
Ximalas opened this issue May 9, 2021 · 5 comments
Closed

Comments

@Ximalas
Copy link
Contributor

Ximalas commented May 9, 2021

Commit 9e0ba9536b7cbba0e81e561458e95aafb65ee485 removed the /* Master, propagated to newvers */ comment after __FreeBSD_version in sys/sys/param.h in FreeBSD's main branch aka 14.0-CURRENT.

synth now believes I'm running FreeBSD 1.0. I temporarily doctored my /usr/include/sys/param.h and that will hold up until the next time I upgrade my "LiveSystem".

The same commit says this is proper way to extract __FreeBSD_version:
awk '/^\#define[[:space:]]*__FreeBSD_version/ {print $3}'
I believe there's a small mistake in the regexp and it should be ^\#define[[:space:]]+__FreeBSD_version.

At any rate, get_osversion_from_param_header in src/replicant-platform.adb should be changed to cope with the missing comment.

@jrmarino
Copy link
Owner

jrmarino commented May 9, 2021

Thank you for a very detailed explanation with links.
At first glance, the get_osversion_from_param_header should not have been affected by removing the comment and the spaces that precede it. But obviously your experience says otherwise. I'll take a harder look.

@jrmarino
Copy link
Owner

jrmarino commented May 9, 2021

okay, I see the logic flaw now

jrmarino added a commit that referenced this issue May 9, 2021
The function would return "bad version" value if the input line did
not end in a non-digit character.  This bug was exposed when FreeBSD
removed the trailing comment from sys/param.h header.
This change should fix synth on FreeBSD 14.
@jrmarino
Copy link
Owner

jrmarino commented May 9, 2021

Okay, I believe I fixed it and created a new release, 2.11.
Can you let the port maintainer know so he can bring it in? And close the issue when that's done?

freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue May 9, 2021
This fixes jrmarino/synth#193
(sys/sys/param.h in freebsd/main loses comment after __FreeBSD_version)

MFH:	2021Q2
freebsd-git pushed a commit to freebsd/freebsd-ports that referenced this issue May 9, 2021
This fixes jrmarino/synth#193
(sys/sys/param.h in freebsd/main loses comment after __FreeBSD_version)

MFH:	2021Q2
(cherry picked from commit a53b9c8)
@fluffykhv
Copy link

@Ximalas
Copy link
Contributor Author

Ximalas commented May 9, 2021

Synth 2.11 works as expected in freebsd/src/main post commit 9e0ba9536b7cbba0e81e561458e95aafb65ee485.

@Ximalas Ximalas closed this as completed May 9, 2021
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

3 participants