Skip to content

Initial support for GNU/Hurd#2088

Open
pinotree wants to merge 1 commit into
abseil:masterfrom
pinotree:hurd
Open

Initial support for GNU/Hurd#2088
pinotree wants to merge 1 commit into
abseil:masterfrom
pinotree:hurd

Conversation

@pinotree

@pinotree pinotree commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Tweak configuration & tests so that most of abseil works on the Hurd:

  • enable available TLS (__thread, in practice)
  • enable available mmap
  • enable available POSIX semaphores
  • enable available POSIX write()
  • disable the ELF symbolizer: while the object format is ELF, the symbolizer uses bits (i.e. mmap files in /proc) not currently available
  • use the available /proc/self/exe
  • tweak a log test for the different value of EBADF
  • tweak the strerror test for the GNU libc Hurd string representation of -1

@mkruskal-google

mkruskal-google commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

How many more changes will be needed for this? This looks fairly minimal, but Hurd is not in our support matrix, and we don't test against it. So it may be accidentally broken again by future changes.

To evaluate whether or not this is a good idea, it would be good to see the full scope of the necessary changes. The more you need to touch, the less likely it is to be stable

@pinotree

Copy link
Copy Markdown
Contributor Author

How many more changes will be needed for this?

It is mostly this; I just rebased this PR with an additional fix for absl_strerror_test that I missed.

As for things to do:

  • NumbersTest.Atod in absl_numbers_test fails, I have not investigated the reason
  • I did not go through the list of skipped/disabled tests to see whether there is something important/missing; I do not expect negative surprises here though
  • the StrError implementation and its test assume that the values of the POSIX errnos start from 1; on the Hurd they start from 0x40000001 instead, so
    • the caching done by NewStrErrorTable is not effective for actual errnos; that said, the fallback that calls strerror_r() works just fine
    • StrErrorTest.MultipleThreads is not really testing actual errnos

My plan is to send changes for each separately, so it is easier to review them.

So it may be accidentally broken again by future changes.

That is fine for me. Once abseil is changed to build/work on the Hurd, I do not expect a constant stream of changes to keep it up-to-date -- followup fixes should be easy to do and to review (IMHO).

@mkruskal-google

Copy link
Copy Markdown
Contributor

I think for something like this it might be easier to review it in totality. My worry is that we accept this PR (which seems pretty minimal) and then the next one seems too invasive.

@mkruskal-google mkruskal-google self-requested a review June 24, 2026 04:35
Tweak configuration & tests so that most of abseil works on the Hurd:
- enable available TLS ("__thread", in practice)
- enable available mmap
- enable available POSIX semaphores
- enable available POSIX write()
- disable the ELF symbolizer: while the object format is ELF, the
  symbolizer uses bits (i.e. "mmap" files in /proc) not currently
  available
- use the available /proc/self/exe
- tweak a log test for the different value of EBADF
- tweak the strerror test for the GNU libc Hurd string representation
  of -1
@pinotree

pinotree commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

I think for something like this it might be easier to review it in totality. My worry is that we accept this PR (which seems pretty minimal) and then the next one seems too invasive.

Sorry for the late answer. I checked a bit more, and I think this is the biggest set of changes needed for the the Hurd. Hence it should be ready for review.

Comment thread absl/debugging/internal/symbolize.h
ValueWithStr(Eq("Bad file descriptor"))),
ValueWithLiteral(Eq(" [")),
AnyOf(ValueWithStr(Eq("8")), ValueWithStr(Eq("9"))),
AnyOf(ValueWithStr(Eq("8")), ValueWithStr(Eq("9")), ValueWithStr(Eq("1073741833"))),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a little magical, where does this number come from?? Do we need tests to pass on Hurd? We don't run these in CI anyway and they're likely to backslide, so I'd be tempted to say we should revert all these test changes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a little magical, where does this number come from??

It's simply the decimal value of EBADF, as I wrote in the commit/PR message:

tweak a log test for the different value of EBADF

In the Hurd implementation of GNU libc, the POSIX errnos start at 0x40000001 (the first). This is because there are different ranges of error values, and the POSIX values are one of those ranges (in addition to e.g. the Mach errors, IPC errors, etc).

$ grep -r EBADF /usr/include/i386-gnu/
/usr/include/i386-gnu/bits/errno.h:  EBADF                          = 0x40000009,       /* Bad file descriptor */
/usr/include/i386-gnu/bits/errno.h:#define EBADF                          0x40000009

$ errno EBADF
EBADF 1073741833 Bad file descriptor

See also the GNU libc Hurd sources: https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mach/hurd/bits/errno.h;h=3b54f5855e21091123ab0669402550968f0746cf;hb=d70dd7d72273ac1aa53b435156de3f50f0c5a868#l37

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea my larger point is: is there any significant value to submitting fixes to get tests working on Hurd? I get that it was useful to produce this PR, but you only need the prod code to work right?

The test changes seem particularly confusing without context, and like they (marginally) weaken the tests in the platforms we do support.

The non-test changes all look fine to me

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

Successfully merging this pull request may close these issues.

3 participants