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

Better solution for getting local offset on unix #380

Closed
tmccombs opened this issue Nov 2, 2021 · 29 comments
Closed

Better solution for getting local offset on unix #380

tmccombs opened this issue Nov 2, 2021 · 29 comments
Labels
A-local-offset Area: local offset C-tracking-issue Category: tracking issue for a feature/release E-hard Significant experience needed.

Comments

@tmccombs
Copy link

tmccombs commented Nov 2, 2021

Given that #293 is closed, but in such a way that UtcOffset::local_offset_at and current_local_offset are essentially useless on unix without also enabling the unsound_local_offset config in rustc flags. So I'm creating a new issue to track a solution that makes getting the local offset usable on unix again.

Some possible ways this could be solved are:

  1. Re-implement determining the offset, similar to what datetime_r does in pure rust. This will probably require reading zoneinfo files (see tzfile(5) man page).
  2. Hook into the lock on the environment variable in std somehow, this probably requires exposing an api for that from std.
@jhpratt
Copy link
Member

jhpratt commented Nov 2, 2021

There is an ongoing discussion on IRLO for how this can be achieved soundly. Exposing the environment lock has previously been ruled out.

@jhpratt jhpratt added A-local-offset Area: local offset C-tracking-issue Category: tracking issue for a feature/release E-hard Significant experience needed. labels Nov 2, 2021
@tmccombs
Copy link
Author

tmccombs commented Nov 2, 2021

Forgive my ignorance, what is IRLO?

@jhpratt
Copy link
Member

jhpratt commented Nov 2, 2021

Not an issue! IRLO is internals.rust-lang.org. You may also see URLO mentioned in some places, which is users.rust-lang.org.

@tmccombs
Copy link
Author

tmccombs commented Nov 3, 2021

For reference the aforementioned discussion is at https://internals.rust-lang.org/t/synchronized-ffi-access-to-posix-environment-variable-functions/15475

I did a little digging into 1. For linux specifically, I don't think it would be that difficult. The zoneinfo format isn't that complicated, and the tzfile crate already has an implementation of parsing it in rust (although that crate does depend on chrono). And reading the TZ environment doesn't look too complicated either. Unfortunately, according to this it looks like the zoneinfo format, location of zoneinfo files, and even the interpretaion of the :characters form of the TZ variable are implementation defined. But maybe most unices follow the same pattern? Or is it different on *BSDs and Mac?

This is probably also related to #193.

On a sidenote, I'm amazed that c/posix doesn't have any function that can get the local time or offset independently of the TZ environment variable. AFAICT the only ways to get the offset for a timezone other than the current one is to set the TZ variable with setenv or similar before calling localtime_r, or parsing zoneinfo files yourself, and the former isn't safe to do in a multi-threaded situation.

@jhpratt
Copy link
Member

jhpratt commented Nov 3, 2021

All the zoneinfo stuff is #193 and I don't believe that it's related to this issue in any way. I could be wrong, though: the time crate is my first foray into syscall-level APIs.

The Unix-provided method for getting the local offset is quite odd, admittedly. Unfortunately at this point there's near certainty that it won't change. That, plus the wider ecosystem impact, is why there is discussion regarding a proper solution upstream in stdlib.

@tmccombs
Copy link
Author

tmccombs commented Nov 3, 2021

I don't believe that it's related to this issue in any way. I could be wrong, though: the time crate is my first foray into syscall-level APIs

The timezone part of datetime_r doesn't involve a syscall. As I understand it tzset which may be called by localtime_r looks at the TZ environment variable, and depending on the value, may parse zoneinfo files to figure out the values for tzname (name of timezone and dst timezone), daylight (whether currently daylight savings), and timezone, which contains the UTC offset in seconds. Then localtime_r uses that information to get get a local time from a unix timestamp. The kernel isn't involved at all (although it is in getting the current unix epoch). So, to replace localtime_r we need to parse zoneinfo files, at least on linux.

jszwedko added a commit to jszwedko/rust-syslog that referenced this issue Nov 3, 2021
@jhpratt
Copy link
Member

jhpratt commented Nov 4, 2021

After some digging around I think I know where you were going with this. I can read the /etc/localtime file, parse it, and then do #193-related things to actually figure out the offset at the given point in time. Reading the /etc/localtime file could be replaced by calling tzset and reading the environment variable, but that runs into the same issue that already exists.

No idea how widely supported this is, but it works on at least Fedora (what I use) and presumably all of Linux. If this works then it's probably worth breaking this out into a separate crate

@jhpratt
Copy link
Member

jhpratt commented Nov 11, 2021

I don't believe this is applicable to Unix in general (please let me know if it is!), but I plan on using /proc/self/task on Linux to determine if multiple threads are running. If there are not, the call to localtime_r is sound. It's a band-aid solution but it's better than the status quo.

Plan on the change this weekend with a prompt release if it works.

@jhpratt
Copy link
Member

jhpratt commented Nov 12, 2021

^^ I have just released this as part of time 0.3.5. Linux users rejoice! Mac users…not so much.

@Morganamilo
Copy link

What about spawning a new process to call the function? That would guarintee there's only one thread. The crate could also cache the function so it's fast after the first call.

@jhpratt
Copy link
Member

jhpratt commented Nov 12, 2021

What would that process be executing, exactly?

Cacheing the value is a no-go as it could change during execution of the program.

@Morganamilo
Copy link

What would that process be executing, exactly?

Itself!

If the process were to:

  • fork to ensure one thread is running
  • then try get an env var though std to ensure we can read the env
  • then call the c function
  • send the value back through a pipe

I think that could work?

@jhpratt
Copy link
Member

jhpratt commented Nov 12, 2021

You can't call a library as if it's a binary — that just doesn't make sense.

@Morganamilo
Copy link

Fork duplicates the process, not calls a binary.

@tmccombs
Copy link
Author

tmccombs commented Nov 12, 2021

fork() is itself not safe if there are multiple threads, unless it immediately calls execve or similar. One reason being that another thread could hold a lock, and when the fork happens in the new process that lock will never be released.

@Morganamilo
Copy link

Yes that's the poing of the step "then try get an env var though std to ensure we can read the env".

But now I look, std has no try functions for the environment which makes this not possble.

@AngelicosPhosphoros
Copy link

Is it possible to get timezone information from files?
https://man7.org/linux/man-pages/man3/tzset.3.html#FILES

We can cache result in OnceCell then it should be fast.

@Morganamilo
Copy link

Morganamilo commented Nov 12, 2021

If you want a real hack though that probably shouldn't be implemented:

The internal code for Command::spawn() locks the env before forking so that it's safe to access in the fork.
You could in theory register this as a pre exec hook to run right after the fork and effectively get a lock to the env.

And now I'm thinking the actual c function is probably not safe to run in the fork so never mind.

@jhpratt
Copy link
Member

jhpratt commented Dec 23, 2021

While not perfect, obtaining the local offset is in the best state possible for the time being. The time crate is relying on the num_threads crate for Unix systems, which currently has support for Linux, FreeBSD, and MacOS.

Because the functionality has been made available again when soundness can be guaranteed for the three most widely used operating systems, I'm going to go ahead and close this. This isn't a tracking issue for the soundness concerns of environment variables in general, after all.

@jhpratt jhpratt closed this as completed Dec 23, 2021
@tmccombs
Copy link
Author

Limiting the functionality to single-threaded applications is still pretty crippling though. Getting the current offset before spawning additional threads isn't necessarily an option, because the offset can be different depending on the timestamp (especially in regions with daylight savings), so it may be necessary to get the local time for a different timestamp after multiple threads have started.

The only really good solution I see to this is to stop using localtime_r, and have a pure-rust implementation of determining the offset. There are a couple of existing crates (libtzfile and zoneinfo_compiled) that can parse TZIF files, which is what linux at least uses for timezone files, however, afaict they only support using the transitions, and don't support parsing the posix TZ string used in v2 and above, which in practice is probably only important for times in the far future.

@jhpratt
Copy link
Member

jhpratt commented Dec 24, 2021

Keep in mind that the soundness issue in in std, not time. As soon as std::env::set_var is deprecated, I will restore functionality to what it previously was. It seems excessive on my end to parse a slew of time zone information for this when the operating system provides a quick, simple way to obtain it already. All that's necessary is a deprecation in std.

There is consensus on deprecating std::env::set_var, by the way. It's only a matter of what will be present as a replacement.

@tmccombs
Copy link
Author

when the operating system provides a quick, simple way to obtain it already.

Maybe a little pedantic, but it is libc that provides that, not the operating system.

@jhpratt
Copy link
Member

jhpratt commented Dec 24, 2021

Yeah, you're right but it doesn't much matter either way.

jamessan added a commit to jamessan/alacritty that referenced this issue Jan 9, 2022
This also switches the timestamp format from local timezone to UTC since
getting the local timezone is fallible.  Rather than complicating the
code with a fallback to UTC, just use UTC all the time.

See time-rs/time#380 and time-rs/time#293 for more discussion.
jamessan added a commit to jamessan/alacritty that referenced this issue Jan 12, 2022
Due to unsoundness issues (c.f., time-rs/time#380 and time-rs/time#293),
determining the local timezone can only happen while single-threaded.

Use lazy_static to determine this early in startup and apply the offset
to the UTC timestamp before formatting.
jamessan added a commit to jamessan/alacritty that referenced this issue Jan 12, 2022
Due to unsoundness issues (c.f., time-rs/time#380 and time-rs/time#293),
determining the local timezone can only happen while single-threaded.

Determine the timezone early in startup and apply the offset to the UTC
timestamp before formatting.
jamessan added a commit to jamessan/alacritty that referenced this issue Jan 12, 2022
Due to unsoundness issues (c.f., time-rs/time#380 and time-rs/time#293),
determining the local timezone can only happen while single-threaded.

Determine the timezone early in startup and apply the offset to the UTC
timestamp before formatting.
jamessan added a commit to jamessan/alacritty that referenced this issue Jan 13, 2022
Due to unsoundness issues (c.f., time-rs/time#380 and time-rs/time#293),
determining the local timezone can only happen while single-threaded.

Determine the timezone early in startup and apply the offset to the UTC
timestamp before formatting.
chrisduerr pushed a commit to alacritty/alacritty that referenced this issue Jan 13, 2022
Due to unsoundness issues (c.f., time-rs/time#380 and time-rs/time#293),
determining the local timezone can only happen while single-threaded.

Determine the timezone early in startup and apply the offset to the UTC
timestamp before formatting.
chrisduerr pushed a commit to chrisduerr/alacritty that referenced this issue Jan 13, 2022
Due to unsoundness issues (c.f., time-rs/time#380 and time-rs/time#293),
determining the local timezone can only happen while single-threaded.

Determine the timezone early in startup and apply the offset to the UTC
timestamp before formatting.
chrisduerr pushed a commit to alacritty/alacritty that referenced this issue Jan 13, 2022
Due to unsoundness issues (c.f., time-rs/time#380 and time-rs/time#293),
determining the local timezone can only happen while single-threaded.

Determine the timezone early in startup and apply the offset to the UTC
timestamp before formatting.
@tmccombs
Copy link
Author

https://github.com/x-hgg-x/tz-rsis an implementation of localtime in pure rust.

@jhpratt
Copy link
Member

jhpratt commented Feb 24, 2022

Thanks. I was made aware of that crate a few days ago. I just need the time to review the open PRs before I can take a look at the code there. My backlog is growing to say the least.

ezhang7423 pushed a commit to ezhang7423/alacritty that referenced this issue Jun 14, 2022
commit ce29942
Merge: 7f4ceee d9c6c8d
Author: ezhang7423 <[email protected]>
Date:   Tue Jun 14 12:59:09 2022 -0700

    Merge branch 'master' of github.com:alacritty/alacritty

commit d9c6c8d
Author: Ally Tiritoglu <[email protected]>
Date:   Fri Jun 10 09:28:48 2022 -0700

    Update SGR escape sequence support

commit fdcf99b
Author: jeremycostanzo <[email protected]>
Date:   Thu Jun 9 23:08:18 2022 +0200

    Add vi action to center view around vi cursor

commit 90552e3
Author: Kirill Chibisov <[email protected]>
Date:   Thu Jun 9 19:31:08 2022 +0300

    Fix flickering during resize on Wayland

    This also fixes an issue of windows not being rendered while resizing.

    Fixes alacritty#6069.

commit 6dc670c
Author: Vasily Khoruzhick <[email protected]>
Date:   Wed Jun 8 02:02:57 2022 -0700

    Support dual source blending in GLES2 renderer

    GLES2 has GL_EXT_blend_func_extended extension that enables
    dual-source blending, so essentially we can reuse fragment shader
    from GLSL3 renderer and do 1 rendering pass instead of 3 for the
    text.

    Co-authored-by: Kirill Chibisov <[email protected]>
    Co-authored-by: Christian Duerr <[email protected]>

commit 29b1ff5
Author: Kirill Chibisov <[email protected]>
Date:   Tue Jun 7 11:09:03 2022 +0300

    Fix old vi cursor not being properly damaged

    Co-authored-by: Christian Duerr <[email protected]>

commit bb7b120
Author: Kirill Chibisov <[email protected]>
Date:   Mon Jun 6 11:00:39 2022 +0300

    Fix crash when damaging off-screen hint

    Co-authored-by: Christian Duerr <[email protected]>

commit 56a69c0
Author: Yuri Astrakhan <[email protected]>
Date:   Wed Jun 1 21:22:50 2022 -0400

    Fix a few minor clippy lints

commit e20541a
Author: André Kugland <[email protected]>
Date:   Wed Jun 1 03:33:08 2022 +0000

    Fix DEC Special Character Set (Line drawing)

    This patch resolves some mapping issues with the line drawing character
    set where characters like linefeed were incorrectly mapped to their
    proper character representation rather than the codepoint of their
    identification glpyh.

    Co-authored-by: Christian Duerr <[email protected]>

commit 63ef6c9
Author: Kirill Chibisov <[email protected]>
Date:   Fri May 27 00:30:33 2022 +0300

    Fix Vi cursor not being damaged on scroll

    There's no need to damage intermediate Vi mode cursor points, since it
    can't change the terminal content meaning that only the previous
    and current vi cursor's viewport points matter to damage it properly.

commit 3bfc4c2
Author: Kirill Chibisov <[email protected]>
Date:   Mon May 23 03:35:09 2022 +0300

    Don't inherit `--command` for `SpawnNewInstance`

    Fixes alacritty#6060.

commit c10888b
Author: a5ob7r <[email protected]>
Date:   Mon May 23 09:01:46 2022 +0900

    Fix selection change after leaving vi-mode

    This patch fixes that the right point of the selection range moves to
    another point when leaves vi-mode with a selection by ToggleViMode.
    The cause is that always moves a vi-mode cursor to a search origin
    whether or not the current search is active.

    This problem is a regression which is introduced by alacritty#5945.

commit 394b3ff
Author: Andrés Mejía <[email protected]>
Date:   Sun May 22 07:12:57 2022 -0500

    Fix inaccurate method documentation

commit 9f8c5c4
Author: Kirill Chibisov <[email protected]>
Date:   Fri May 20 22:23:55 2022 +0300

    Enable damage tracking only on Wayland

    Other platforms don't have such concepts in general or have them
    via different interfaces not related to EGL.

    This commit also resolves some minor clippy issues.

    Fixes alacritty#6051.

    Co-authored-by: Christian Duerr <[email protected]>

commit e319ca9
Author: algon <[email protected]>
Date:   Fri May 20 19:08:25 2022 +0900

    Fix builtin glyphs for U+2567 and U+2568

commit 5c51d52
Author: Kirill Chibisov <[email protected]>
Date:   Sun May 8 11:24:51 2022 +0300

    Fix gap in builtin box drawing

    Builtin box drawing glyphs in range from '\u{2580}' to `\u{2587}`
    could have gap due to missing rounding. Previously height was rounded,
    however not the `y` offset. This commit fixes it.

commit ad3ebba
Author: a5ob7r <[email protected]>
Date:   Fri Apr 29 10:24:35 2022 +0900

    Remove unnecessary commas in config keybindings

commit 9bbb296
Author: mahkoh <[email protected]>
Date:   Sat Apr 16 20:39:26 2022 +0200

    Fix selection copy without button release

    To prevent the current selection clipboard from being overwritten right
    before pasting, text is no longer copied solely because the user
    scrolled the scrollback buffer.

    The selection also isn't copied when a mouse button other than LMB/RMB
    are released, since these are the only ones capable of modifying the
    selection range.

    This should prevent issues where the selection of the user gets
    unexpectedly overwritten, especially in scenarios where the user is
    currently in the process of pasting something into Alacritty.

    Signed-off-by: Julian Orth <[email protected]>

commit d5cad2a
Author: kumattau <[email protected]>
Date:   Sat Apr 16 22:39:14 2022 +0900

    Fix cell_height of impl From<SizeInfo<f32>> for WindowSize

commit 6737104
Author: Kirill Chibisov <[email protected]>
Date:   Wed Apr 6 13:06:39 2022 +0300

    Extract `SizeInfo` from alacritty_terminal

    The `SizeInfo` is a SizeInfo used for rendering, which contains
    information about padding, and such, however all the terminal need is
    number of visible lines and columns.

commit 851dbc3
Author: Kirill Chibisov <[email protected]>
Date:   Sun Apr 3 23:08:44 2022 +0300

    Disallow OSC 52 for unfocused window

    This leads to issues on macOS, since if we store clipboard at the same
    time it could error out. Also, on e.g. Wayland the clipboard store for
    unfocused window won't work anyway.

commit 49d64fb
Author: Christian Duerr <[email protected]>
Date:   Fri Apr 1 01:10:12 2022 +0200

    Fix OSC 4 color response format

    The commit 60ef17e introduced support for the color query response
    escape for OSC 4, however it did omit the `4;` prefix and started the
    OSC with just the color index.

    This patch fixes this bug and correctly responds to queries with full
    OSC 4 format, including prefix plus color index.

    Fixes alacritty#5981.

commit b16fe12
Author: Kirill Chibisov <[email protected]>
Date:   Fri Mar 25 15:02:44 2022 +0300

    Reset blinking on search bindings in Vi mode

    The Vi cursor is used as the current match indicator, however when
    it's blinking during search jumps the current match is invisible.

    Fixes alacritty#5934.

commit e7bb6c2
Author: Kirill Chibisov <[email protected]>
Date:   Thu Mar 24 12:13:30 2022 +0300

    Persist OpenGL context creation flags

    This commit persists OpenGL context creation flags from previous window
    build attempts saving time in multiwindow context.

    It also creates window as srgb by default, since it's what Alacritty is
    rendering in. For reference [1] and [2]. Moreover the fallback for 10
    bit colors is also added.

    [1] - alacritty#4939 and
    [2] - alacritty#3756.

    Fixes alacritty#4703.

commit f4bdf5f
Author: Kirill Chibisov <[email protected]>
Date:   Wed Mar 16 19:27:55 2022 +0300

    Add colored underline support

    This commit adds support for colored underline and refines the dynamic
    extra storage. The extra storage now is using `Arc` making cloning it way
    faster compared to `Box` approach which scales really well when it comes
    to cloning in `Term::write_at_cursor`, since cloning `Arc` is constant
    time.

    Fixes alacritty#4142.

commit 589c1e9
Author: Kirill Chibisov <[email protected]>
Date:   Mon Mar 14 08:52:53 2022 +0300

    Use center of the pixel when aligning undercurl

    Since `x` position in rect shader represents left side of the pixel we
    should use the center of it when dealing with contiguous functions.

commit 7312f33
Author: Kirill Chibisov <[email protected]>
Date:   Fri Mar 11 12:34:15 2022 +0300

    Fix `font.glyph_offset` not live reloading

    Fixes alacritty#5944.

commit 0965773
Author: Christian Duerr <[email protected]>
Date:   Thu Mar 10 20:45:20 2022 +0100

    Fix crash when searching during reset

    This fixes a crash which occurs when the terminal is reset while
    searching, due to the vi mode cursor being outside of the visible area.

    This also fixes an issue where the search state reset would incorrectly
    clamp the vi mode cursor to the grid, rather than the absolute viewport
    position.

    While this fix does resolve all crashes when searching while running
    `cat /dev/urandom`, it does raise the question if manually clamping the
    vi mode cursor in every location where it is modified is the right
    choice.

    A follow-up to provide a safer API which guarantees correct modification
    of the vi mode cursor location is probably a good idea.

    Fixes alacritty#5942.

commit a69c3c4
Author: Kirill Chibisov <[email protected]>
Date:   Thu Mar 10 15:25:01 2022 +0300

    Fix line indicator damage computation

    The starting point of damage should be computed from the right side
    of the terminal, not from the starting point of line indicator.

commit dbccd7e
Author: Kirill Chibisov <[email protected]>
Date:   Sun Mar 6 19:34:12 2022 +0300

    Use round instead of ceil for line position

    Ceiling line position results in strikeout line being lower than
    it should.

commit d8113dc
Author: Kirill Chibisov <[email protected]>
Date:   Wed Mar 2 22:35:19 2022 +0300

    Fix gap calculation for dashed underline

commit 1880522
Author: Kirill Chibisov <[email protected]>
Date:   Wed Mar 2 13:05:12 2022 +0300

    Add fallback GLES2 renderer

    Currently Alacritty only works on hardware which supports OpenGL 3.3 or
    more, which can become problematic with older devices. This patch adds a
    new GLES2 renderer, since it is much more widely supported, especially
    on weaker hardware like phones or a Raspberry Pi.

    While the GLES2 renderer is slower than the OpenGL 3.3+ version, it is
    still significantly faster than software rendering. However because of
    this performance difference it is only used when necessary and there
    should be no difference for machines supporting OpenGL 3.3+.

    The two renderers are largely independent and separated in the
    `renderer/text/glsl3` and `renderer/text/gles2` modules. Separate
    shaders are also required for text rendering. The rectangle rendering
    for underlines and the visual bell works identically for both versions,
    but does have some version-specific shader code.

    Fixes #128.

    Co-authored-by: Christian Duerr <[email protected]>

commit 00383ae
Author: Chris Copeland <[email protected]>
Date:   Sun Feb 27 10:35:23 2022 -0800

    Add `ToggleMaximized` key binding action

commit 13b6248
Author: Christian Duerr <[email protected]>
Date:   Thu Feb 24 05:17:25 2022 +0100

    Add version 0.10.1 to changelog

commit 8ea6c3b
Author: nibon7 <[email protected]>
Date:   Tue Feb 22 21:08:49 2022 +0800

    Omit git version hash when git command fails

commit 36e981a
Author: Kirill Chibisov <[email protected]>
Date:   Tue Feb 22 13:57:04 2022 +0300

    Don't use 'origin_upper_left' in rect shaders

commit 4734b2b
Author: Kirill Chibisov <[email protected]>
Date:   Fri Feb 18 01:27:10 2022 +0300

    Don't load font twice during display creation

    This commit finishes the effort from a64553b to avoid reloading font
    twice during startup, since the original issue is with getting font
    metrics without building the glyph cache.

commit aaab88c
Author: mahkoh <[email protected]>
Date:   Wed Feb 16 22:15:50 2022 +0100

    Account for absolute WAYLAND_DISPLAY paths

    If WAYLAND_DISPLAY contains a '/', we have to replace with with another
    character before using WAYLAND_DISPLAY as a path component.

commit a64553b
Author: Greg Depoire--Ferrer <[email protected]>
Date:   Wed Feb 16 20:57:46 2022 +0000

    Reuse Rasterizer in Display::new

    Instead of creating a `Rasterizer` to guess the window dimensions,
    dropping it and then creating a new one for the glyph cache, reuse the
    same `Rasterizer`.

    This prevents the font from being loaded twice during startup.

commit ed5dbc1
Author: Kirill Chibisov <[email protected]>
Date:   Mon Feb 14 19:10:13 2022 +0300

    Add support for dashed and dotted underlines

    This finishes implementation of underline styles provided by
    `CSI 4 : [1-5] m` escape sequence.

commit 774eb03
Author: Kirill Chibisov <[email protected]>
Date:   Fri Feb 11 02:04:50 2022 +0300

    Clear damage rects right after drawing

    Since we could queue damage before we get into the actual rendering
    we should clear it after drawing not before.

commit 933030e
Author: Kirill Chibisov <[email protected]>
Date:   Thu Feb 10 23:42:33 2022 +0300

    Fix terminal not being damage when only font size changed

    If font size changes however the cells stay the same the terminal won't
    be damaged, since it wasn't resized, however the visual change happened,
    thus the entire screen should be damaged.

commit c35ccaf
Author: Kirill Chibisov <[email protected]>
Date:   Thu Feb 10 15:29:03 2022 +0300

    Make undercurls thickness close to underlines

    Fixes alacritty#5873.

commit eefce4e
Author: Christian Duerr <[email protected]>
Date:   Thu Feb 10 12:09:23 2022 +0100

    Add note about publishing RCs to crates.io

    We've been testing out the pre-release feature of crates.io and there
    haven't been any major issues. So this updates the documentation to
    recommend publishing to crates.io even before the official release.

commit d1608dd
Author: Christian Duerr <[email protected]>
Date:   Wed Feb 9 21:41:54 2022 +0100

    Add version to info log

commit 8afeb2c
Author: Kirill Chibisov <[email protected]>
Date:   Wed Feb 9 19:25:36 2022 +0300

    Fix warnings when building only with Wayland feature

    This commit also makes our CI fail hard when warning encountered when
    building only for either Wayland or X11.

commit 59f16f6
Author: Kirill Chibisov <[email protected]>
Date:   Wed Feb 9 17:41:57 2022 +0300

    Fix alpha when using `colors.transparent_background_colors`

    The alpha is expected to be premultiplied from the text shader, so
    we should apply it to the background color.

commit 73c3dd8
Author: Kirill Chibisov <[email protected]>
Date:   Tue Feb 8 20:47:31 2022 +0300

    Add support for drawing undercurls

    Fixes alacritty#1628.

commit 7263d22
Author: sckzor <[email protected]>
Date:   Tue Feb 8 06:43:27 2022 -0500

    Add instructions for building without X11/Wayland

commit c2959f4
Author: Kirill Chibisov <[email protected]>
Date:   Mon Feb 7 22:18:51 2022 +0300

    Fix alacritty_terminal not emitting damage on color change

commit 998250f
Author: Thomas Churchman <[email protected]>
Date:   Thu Feb 3 13:04:46 2022 +0100

    Fix renderable_cursor method documentation

    This method no longer returns an `Option` since alacritty#5773.

    Co-authored-by: Kirill Chibisov <[email protected]>

commit d22cd74
Author: Kirill Chibisov <[email protected]>
Date:   Thu Feb 3 03:22:28 2022 +0300

    Fix builtin font block elements going invisible

commit 4bf8f37
Author: Christian Duerr <[email protected]>
Date:   Wed Feb 2 20:23:29 2022 +0100

    Fix repeated permission requests on M1 macs

    This adds a codesign step to our makefile build which should
    automatically sign the application and resolve the issues on M1 macs
    where Alacritty constantly requests permissions.

    Since self-signing does still seem to fix this issue after sharing the
    resulting `Alacritty.app` with other M1 macs, the binary produced by our
    release build should also be fixed automatically.

    Fixes alacritty#5840.

commit 40b5e17
Author: Kirill Chibisov <[email protected]>
Date:   Wed Feb 2 20:20:14 2022 +0300

    Fix terminal damage after leaving Vi mode

    This fixes an issue when search results were not damaged when leaving Vi
    mode.

commit 8f1abe1
Author: Kirill Chibisov <[email protected]>
Date:   Wed Feb 2 00:12:58 2022 +0300

    Add damage tracking and reporting to compatible compositors

    This allows compositors to only process damaged (that is, updated)
    regions of our window buffer, which for larger window sizes (think 4k)
    should significantly reduce compositing workload under compositors that
    support/honor it, which is good for performance, battery life and lower
    latency over remote connections like VNC.

    On Wayland, clients are expected to always report correct damage, so
    this makes us a good citizen there. It can also aid remote desktop
    (waypipe, rdp, vnc, ...) and other types of screencopy by having damage
    bubble up correctly.

    Fixes alacritty#3186.

commit d58dff1
Author: oxalica <[email protected]>
Date:   Mon Jan 31 04:57:25 2022 +0800

    Clean up and abstract shader creation code

    Co-authored-by: Christian Duerr <[email protected]>

commit 5459492
Author: Kirill Chibisov <[email protected]>
Date:   Sun Jan 30 15:46:02 2022 +0300

    Use cell width to compute builtin font thickness

    While using underline thickness could sound logical to draw other
    lines most fonts don't make underlines thick compared to cell bounding
    box if you increase font size. So instead we're using cell width to
    scale builtin font nicely.

    This commit also adjusts arcs drawing and alignment.

    Fixes alacritty#5826.
    Fixes alacritty#5821.

commit efae2cc
Author: Kirill Chibisov <[email protected]>
Date:   Sun Jan 30 09:36:35 2022 +0300

    Log used display server on Linux/BSD

    This also fixes a bug where the welcome log message wasn't logged.

commit f6651a9
Author: Kirill Chibisov <[email protected]>
Date:   Sat Jan 29 23:06:44 2022 +0300

    Account for font.offset and glyph.offset in built-in font

    This commit takes into account `font.offset` and `font.glyph_offset`
    when generating built-in font.

commit 094c2c9
Author: zandr <[email protected]>
Date:   Sat Jan 29 14:50:44 2022 -0500

    Add option to control built-in box drawing chars

    This commit adds the config `font.builtin_box_drawing` option to
    control built-in font, which is enabled by default.

commit d1deff9
Author: Christian Duerr <[email protected]>
Date:   Sun Jan 23 15:22:23 2022 +0100

    Remove outdated changelog URLs

    Alacritty's website (https://alacritty.org) is now advertised publicly
    on the GitHub page. Since that includes the old 0.3.0 and 0.5.0
    changelogs, it's not necessary to point them out separately anymore.

commit 9f6b49c
Author: Christian Duerr <[email protected]>
Date:   Sat Jan 22 23:48:44 2022 +0100

    Fix logfile overwriting existing files

commit 4e91e99
Author: Ömer Sinan Ağacan <[email protected]>
Date:   Fri Jan 21 16:45:37 2022 +0300

    Fix typo in SizeInfo padding_y rustdoc

commit 14c22b1
Author: Kirill Chibisov <[email protected]>
Date:   Fri Jan 21 12:48:15 2022 +0300

    Reset cursor blinking on ToggleViMode

    Fixes alacritty#4468.

commit c4d610d
Author: DaftMouse <[email protected]>
Date:   Thu Jan 20 20:57:58 2022 -0300

    Fix OSC 104 with empty second parameter

    This fixes a bug where using OSC 104 without parameters but
    with a trailling semicolon (e.g. '\e]104;\e\\') would not be handled.

    Fixes alacritty#5542.

commit 60ef17e
Author: DaftMouse <[email protected]>
Date:   Sat Jan 15 00:35:05 2022 -0300

    Add ´?´ support to OSC 4

commit e38f51c
Author: Christian Duerr <[email protected]>
Date:   Thu Jan 13 06:36:22 2022 +0100

    Remove time dependency

    In 7398e9f a regression was introduced which causes Alacritty to crash
    on startup since wayland has a keyboard repeat rate thread started
    before our logger is initialized.

    Since the latest version of time was rather inconvenient to use anyway
    and there is no nice solution for this issue other than downgrading the
    `time` version again, the time since startup is now logged instead of
    the local time.

    This should still provide all the relevant information, while getting
    rid of an unnecessary dependency. While it would be possible to also
    print the delta between log messages, this can be trivially computed so
    it has been omitted to skip adding another `Mutex` to the `Logger`
    struct.

commit 7398e9f
Author: Christian Duerr <[email protected]>
Date:   Thu Jan 13 03:23:37 2022 +0100

    Fix macOS release CI

    Since the CI machine is amd64, it is not possible to just execute the
    aarch64 binary to test the application. So instead of running `cargo
    test`, we just use `cargo build` instead.

    Building on the non-release CI instead of just checking also allows us
    to make sure linking works properly before a release fails due to it.

commit 1c9fa73
Author: James McCoy <[email protected]>
Date:   Wed Jan 12 20:53:03 2022 -0500

    Update time crate to 0.3.5

    Due to unsoundness issues (c.f., time-rs/time#380 and time-rs/time#293),
    determining the local timezone can only happen while single-threaded.

    Determine the timezone early in startup and apply the offset to the UTC
    timestamp before formatting.

commit fd7573d
Author: Kirill Chibisov <[email protected]>
Date:   Tue Jan 11 23:58:50 2022 +0300

    Don't blink when cursor is hidden

    This prevents unnecessary redraws when the terminal is idle, cursor is
    hidden and blinking is enabled.

commit 01c1cc1
Author: Kirill Chibisov <[email protected]>
Date:   Tue Jan 11 23:41:57 2022 +0300

    Use `with_position` instead of `set_outer_position`

    This uses `with_position` method on a `WindowBuilder` instead of setting
    window position on the created window later on.

commit a8c8c57
Author: Kirill Chibisov <[email protected]>
Date:   Tue Jan 11 16:22:30 2022 +0300

    Fix use-after-free when formatting Wayland protocol error

commit 5e39ea9
Author: Kirill Chibisov <[email protected]>
Date:   Tue Jan 11 00:56:49 2022 +0300

    Fix block selection expansion with Ctrl + RMB

    When 'ExpandSelection' binding was added only default binding for
    RightClick was added, however to expand block selection holding control
    when doing a click is required, so this commit adds a binding for
    'RMB + Control'.

commit ed35d03
Author: Christian Duerr <[email protected]>
Date:   Sat Jan 8 21:24:42 2022 +0100

    Fix fullwidth char regex search infinite loop

    This resolves an issue where the regex search could loop indefinitely
    when the end point was defined in a location containing a fullwidth
    character, thus skipping over the end before termination.

    Fixes alacritty#5753.

commit 5aa8046
Author: a5ob7r <[email protected]>
Date:   Fri Jan 7 18:03:15 2022 +0900

    Fix last column block selection

    This fixes a regression introduced in 8e58409, where block selections
    containing the last cell would have the trailing newline stripped and be
    joined into one long line on copy.

commit 50c7c2b
Author: David <[email protected]>
Date:   Thu Jan 6 11:31:45 2022 +0800

    Fix macOS IME regression

    Fixes 5669.

commit db83902
Author: Kirill Chibisov <[email protected]>
Date:   Thu Jan 6 02:13:55 2022 +0300

    Fix title setting via IPC when dynamic_title is enabled

commit f717710
Author: Kirill Chibisov <[email protected]>
Date:   Thu Jan 6 00:45:06 2022 +0300

    Use builtin font for box drawing unicode characters

    This commit adds hand rolled drawing of unicode box drawing[1] and
    block elements[2] from ranges U+2500 up to U+259f. While using system
    font for such characters will look better most of the time, the
    characters tend to overlap or not align, so providing builtin font is
    the lesser evil here.

    [1] - https://www.unicode.org/charts/PDF/U2500.pdf
    [2] - https://www.unicode.org/charts/PDF/U2580.pdf

    Fixes alacritty#5485.

commit 2057ac2
Author: a5ob7r <[email protected]>
Date:   Wed Jan 5 06:46:20 2022 +0900

    Trim \n from hints/semantic-/simple selection

    Before this patch a hint regex ending in the last column would append a
    newline, despite this newline being "invisible" to the user. To match
    the expected behavior, newlines are trimmed from regex hint matches.

    To ensure consistency the simple and semantic selection also do not
    include a newline at the end of the copied text anymore.

    Fixes alacritty#5697.

commit 437f42f
Author: Christian Duerr <[email protected]>
Date:   Tue Jan 4 19:25:26 2022 +0100

    Migrate from structopt to clap 3

commit 75c14b9
Author: Kirill Chibisov <[email protected]>
Date:   Tue Jan 4 01:20:56 2022 +0300

    Update wayland-client to v0.29.3

    This should bring support for latest wayland.xml.
    It also updates some other dependencies which are used by alacritty.

    Fixes alacritty#5743.

commit ce59fa4
Author: Kirill Chibisov <[email protected]>
Date:   Mon Jan 3 21:55:22 2022 +0300

    Add title/class CLI parameters to create-window

    This adds the ability to pass title and class over IPC via the
    create-window subcommand, so users can run only one instance for windows
    of different spurposes in the window managers of their choice.

commit 7f4ceee
Author: ezhang7423 <[email protected]>
Date:   Sat Jan 1 03:11:27 2022 -0800

    rm println

commit 182468c
Author: ezhang7423 <[email protected]>
Date:   Sat Jan 1 03:10:31 2022 -0800

    huh

commit 45c9451
Author: ezhang7423 <[email protected]>
Date:   Sat Jan 1 03:01:20 2022 -0800

    fin
@tmccombs
Copy link
Author

tmccombs commented Dec 3, 2022

One rather significant case where this is still an issue is unit tests. By default, cargo runs tests with multiple threads, so even if your application only needs to get the local offset while single threaded, tests that use that function will fail.

See https://github.com/sharkdp/fd/pull/1190/files#diff-1fdc06e038afd6b916c6f6cf1db96920532fb43d1b66f453e744e89fb78f05b9R26

@jhpratt
Copy link
Member

jhpratt commented Dec 3, 2022

It's possible to pass --test-threads=1 to the test binary. That's what I do for this crate.

@tmccombs
Copy link
Author

tmccombs commented Dec 3, 2022

Yes. And then the tests run slower. Which is especially unfortunate if you only need it for one test. And you have to communicate that that is necessary for tests to pass.

@jhpratt
Copy link
Member

jhpratt commented Dec 3, 2022

I mean, the whole situation is unfortunate. But it's the reality of libc for you. There have been ideas thrown around before to be able to annotate a given test to run serially, but they have never gone anywhere to my knowledge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-local-offset Area: local offset C-tracking-issue Category: tracking issue for a feature/release E-hard Significant experience needed.
Projects
None yet
Development

No branches or pull requests

4 participants