fish-shell/src
Fabian Boehm 7b7d16da48 Revert libc time_t changes
This was based on a misunderstanding.

On musl, 64-bit time_t on 32-bit architectures was introduced in version 1.2.0,
by introducing new symbols. The old symbols still exist, to allow programs compiled against older versions
to keep running on 1.2.0+, preserving ABI-compatibility. (see musl commit 38143339646a4ccce8afe298c34467767c899f51)

Programs compiled against 1.2.0+ will get the new symbols, and will therefore think time_t is 64-bit.

Unfortunately, rust's libc crate uses its own definition of these types, and does not check for musl version.
Currently, it includes the pre-1.2.0 32-bit type.

That means:

- If you run on a 32-bit system like i686
- ... and compile against a C-library other than libc
- ... and pass it a time_t-containing struct like timespec or stat

... you need to arrange for that library to be built against musl <1.2.0.

Or, as https://github.com/ericonr/rust-time64 says:

> Therefore, for "old" 32-bit targets (riscv32 is supposed to default to time64),
> any Rust code that interacts with C code built on musl after 1.2.0,
> using types based on time_t (arguably, the main ones are struct timespec and struct stat) in their interface,
> will be completely miscompiled.

However, while fish runs on i686 and compiles against pcre2, we do not pass pcre2 a time_t.
Our only uses of time_t are confined to interactions with libc, in which case with musl we would simply use the legacy ABI.

I have compiled an i686 fish against musl to confirm and can find no issue.

This reverts commit 55196ee2a0.
This reverts commit 4992f88966.
This reverts commit 46c8ba2c9f.
This reverts commit 3a9b4149da.
This reverts commit 5f9e9cbe74.
This reverts commit 338579b78c.
This reverts commit d19e5508d7.
This reverts commit b64045dc18.

Closes #10634
2024-08-27 14:28:00 +02:00
..
bin Revert libc time_t changes 2024-08-27 14:28:00 +02:00
builtins Remove non-portable use of fstat 2024-08-06 14:15:57 +02:00
env Import portable_atomic::AtomicU64 when std does not provide it 2024-08-11 14:50:39 +02:00
fork_exec Replace nanosleep with stdlib wrapper (which is still broken) 2024-08-07 13:11:22 +02:00
history Remove unnecessary reference 2024-08-20 14:48:59 -05:00
tests Revert libc time_t changes 2024-08-27 14:28:00 +02:00
universal_notifier Add kqueue-based uvar notifier for BSD (#10674) 2024-08-26 17:10:26 -05:00
widecharwidth Move fish-rust to project root 2024-01-13 03:58:33 +01:00
wutil Revert libc time_t changes 2024-08-27 14:28:00 +02:00
abbrs.rs Replace C++ doc \return with "Return" 2024-05-06 14:59:36 -05:00
ast.rs tokenizer: Stop copying the start string 2024-05-07 16:59:35 +02:00
autoload.rs Replace C++ doc \return with "Return" 2024-05-06 14:59:36 -05:00
color.rs Convert colors::Flags to a bitflags enum 2024-05-07 14:03:38 -05:00
common.rs Expand tilde after brace expansion 2024-07-23 11:47:58 +02:00
complete.rs Make "complete -e" prevent completion autoloading 2024-08-24 08:30:52 +02:00
curses.rs Remove yet more dead code 2024-06-29 18:03:52 -07:00
editable_line.rs Remove some (hopefully) unnecessary clippy and compiler directives 2024-06-23 17:13:14 -07:00
env_dispatch.rs Revert "Resume repainting command line when colors change" 2024-08-25 18:41:31 -07:00
env_universal_common.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00
event.rs Remove parser library_data_pod_t ffi workaround 2024-06-02 20:27:44 -05:00
exec.rs Remove parser library_data_pod_t ffi workaround 2024-06-02 20:27:44 -05:00
expand.rs Expand tilde after brace expansion 2024-07-23 11:47:58 +02:00
fallback.rs Use File instead of OwnedFd in a few places (#10355) 2024-03-17 11:20:44 -05:00
fd_monitor.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00
fd_readable_set.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00
fds.rs Update nix to 0.29 2024-06-06 16:47:52 +02:00
fish_test_helper.c Port fish_test_helper to C 2024-06-12 08:11:16 +02:00
flog.rs Replace C++-style \p with Markdown backticks 2024-05-06 14:59:23 -05:00
function.rs Use NonZero types for 1-based line numbers 2024-07-07 20:58:09 -05:00
future_feature_flags.rs Deprecate builtin test's one- and zero-argument modes (#10365) 2024-04-21 14:25:54 +02:00
future.rs Remove backports for 1.67 2024-04-29 22:00:59 +02:00
global_safety.rs Simplify shared-from-this pattern 2024-03-09 10:09:03 +01:00
highlight.rs Remove unescape_string_in_place 2024-06-06 17:11:25 +02:00
history.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00
input_common.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00
input.rs Implement jump-till-matching-bracket input function 2024-06-30 11:58:10 -07:00
io.rs Import portable_atomic::AtomicU64 when std does not provide it 2024-08-11 14:50:39 +02:00
job_group.rs Rename printf crate to fish-printf 2024-06-09 12:29:09 -07:00
key.rs Show un-decodable inputs as bytes instead of the internal encoding 2024-08-14 15:16:14 +02:00
kill.rs Remove L! from sprintf calls 2024-01-13 08:52:54 +01:00
lib.rs Tweak the allowed clippy set and fix some 2024-06-30 11:38:15 -07:00
libc.c Revert libc time_t changes 2024-08-27 14:28:00 +02:00
libc.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00
locale.rs Remove some (hopefully) unnecessary clippy and compiler directives 2024-06-23 17:13:14 -07:00
nix.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00
null_terminated_array.rs Remove yet more dead code 2024-06-29 18:03:52 -07:00
operation_context.rs Make OperationContext not hold a Parser via Rc 2024-06-23 16:39:39 -07:00
output.rs Replace C++ doc \return with "Return" 2024-05-06 14:59:36 -05:00
pager.rs Remove yet more dead code 2024-06-29 18:03:52 -07:00
panic.rs Print panic message to stderr, like the stack trace 2024-04-02 07:34:19 +02:00
parse_constants.rs Rename printf crate to fish-printf 2024-06-09 12:29:09 -07:00
parse_execution.rs Remove RefCells from ExecutionContext and just make it mut 2024-06-29 18:03:52 -07:00
parse_tree.rs Use NonZero types for 1-based line numbers 2024-07-07 20:58:09 -05:00
parse_util.rs Replace C++ doc \return with "Return" 2024-05-06 14:59:36 -05:00
parser_keywords.rs Remove widestring-suffix uses 2024-01-13 08:52:54 +01:00
parser.rs Remove useless osttr->cstr->osstr roundtrip 2024-08-16 15:30:57 +02:00
path.rs Apply some clippy lints 2024-05-26 10:37:37 +02:00
print_help.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
proc.rs Import portable_atomic::AtomicU64 when std does not provide it 2024-08-11 14:50:39 +02:00
re.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
reader_history_search.rs Replace C++ doc \return with "Return" 2024-05-06 14:59:36 -05:00
reader.rs Correct iTerm2 version in CSI u workaround 2024-08-17 07:43:18 +02:00
redirection.rs Remove yet more dead code 2024-06-29 18:03:52 -07:00
screen.rs Work around broken rendering of pasted multibyte chars in non-UTF-8-ish locale 2024-08-03 11:32:59 +02:00
signal.rs Bring topic monitor naming in line with Rust conventions 2024-06-23 17:06:20 -07:00
termsize.rs Remove yet more dead code 2024-06-29 18:03:52 -07:00
threads.rs Split Reader off from ReaderData 2024-06-23 16:39:39 -07:00
timer.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00
tinyexpr.rs Remove yet more dead code 2024-06-29 18:03:52 -07:00
tokenizer.rs Allow clippy::ptr_arg and fix cases 2024-06-29 18:48:49 -07:00
topic_monitor.rs Rename binary_semaphore_t to BinarySemaphore 2024-06-29 18:07:11 -07:00
trace.rs Remove parser library_data_pod_t ffi workaround 2024-06-02 20:27:44 -05:00
util.rs Move fish-rust to project root 2024-01-13 03:58:33 +01:00
wait_handle.rs Replace C++ doc \return with "Return" 2024-05-06 14:59:36 -05:00
wchar_ext.rs Replace C++ doc \return with "Return" 2024-05-06 14:59:36 -05:00
wchar.rs Remove widestring-suffix uses 2024-01-13 08:52:54 +01:00
wcstringutil.rs Remove wcstringutil::split_string() 2024-05-21 12:54:52 -05:00
wgetopt.rs Reimplement WGetopter::exchange() using rotate_left 2024-04-17 12:41:16 -07:00
wildcard.rs Revert libc time_t changes 2024-08-27 14:28:00 +02:00