profile
viewpoint
Peter Atashian retep998 Massachusetts, USA Writes software in Rust and C++. Is fluffy.

notify-rs/notify 1006

🔭 Cross-platform filesystem notification library for Rust.

aatxe/irc 392

the irc crate – usable, async IRC for Rust

FTB-Gamepedia/mediawiki-rs 7

MediaWiki API in Rust

FTB-Gamepedia/ftb-rs 4

Stuff for FTB wiki

retep998/Chip8 4

A Chip8 emulator written in C++ and x86-64 MASM.

aatxe/tomato 3

Java MapleStory Server Emulator - v111

FTB-Gamepedia/bunnybutt-rs 2

An IRC bot for the FTB wiki

FTB-Gamepedia/FTB-Wiki-Issue-Tracker 1

Issue tracking (and hopefully squashing) for the FTB Wiki

issue commentretep998/winapi-rs

What's the cause, why winapi depends on std?

winapi only depends on std when the std feature is enabled, and it is disabled by default. If you didn't enable it, then check if any of your dependencies enabled it.

lygstate

comment created time in 9 days

issue commentrust-lang/rust-clippy

Tracking issue for RFC 2476, Clippy 1.0

The repo was moved to rust-lang but the rust- prefix was not dropped.

Manishearth

comment created time in 18 days

issue commentrust-lang/rust-clippy

Lint suggestions around vector iterations are counterproductive

clippy::explicit_iter_loop is currently a pedantic lint that is allow by default, so does that resolve this issue?

RalfJung

comment created time in 18 days

issue commentrust-lang/rust-clippy

explicit_iter_loop should warn &[T].iter()

This also applies to for foo in bar.iter() when bar: &Vec<T>.

malbarbo

comment created time in 18 days

issue commentretep998/winapi-rs

CONTEXT should be aligned to 16-byte boundary

This will be fixed in winapi 0.4 when the minimum Rust version is bumped to support #[repr(align(N))]

endeav0r

comment created time in a month

pull request commentretep998/winapi-rs

temporary: some km binding of winapi

I do plan on adding km support, however I don't have the time to dedicate to investigating it fully at the moment.

woodgear

comment created time in a month

issue commentrust-lang/rust

Linker error with wasm target with spaces in install path

Given that the linker input string contains "-L" "C:\\Program Files (x86)\\Rust nightly MSVC 1.48\\lib\\rustlib\\wasm32-unknown-unknown\\lib\\self-contained" I have no reason to believe Rust is doing anything wrong and that it is LLD which is at fault here.

Someone should debug LLD and figure out where those strings are getting split up incorrectly.

jminer

comment created time in a month

Pull request review commentrust-lang/rust

Apply `#![deny(unsafe_op_in_unsafe_fn)]` to sys/windows

+#![deny(unsafe_op_in_unsafe_fn)]+ use crate::alloc::{GlobalAlloc, Layout, System}; use crate::sys::c; use crate::sys_common::alloc::{realloc_fallback, MIN_ALIGN};  #[repr(C)] struct Header(*mut u8); +/// # Safety+///+/// There must be a `Header` at `ptr.offset(-1)`. unsafe fn get_header<'a>(ptr: *mut u8) -> &'a mut Header {-    &mut *(ptr as *mut Header).offset(-1)+    // SAFETY: the safety contract must be upheld by the caller+    unsafe { &mut *(ptr as *mut Header).offset(-1) } } +/// # Safety+///+/// `ptr`, once aligned, must have space for a Header at `ptr.offset(-1)`.

Change get_header to return a *mut Header and change align_ptr to use ptr::write to write the header.

carbotaniuman

comment created time in a month

PullRequestReviewEvent

issue commentFTB-Gamepedia/Tilesheets

Tilesheet Translator

Basically an interface where you can easily translate multiple tiles at the same time instead of having to translate each tile individually.

xbony2

comment created time in a month

push eventretep998/wio-rs

Peter Atashian

commit sha 43e50413c86e3a071a6d9884c481bcbf24bc88d5

Some minor assertion improvements

view details

push time in a month

issue commentrust-lang/libc

Address family (AF_INET, ...), IPPROTO and other constants missing from Windows implementation

I believe the intention is that libc on Windows stick strictly to what the CRT provides and does not touch Windows API which is winapi's domain (there are a few exceptions to this but they seem to all be accidental and only still exist due to backwards compatibility). Networking related constants all fall under Windows API and so do not belong in libc on Windows.

xanathar

comment created time in a month

issue commentrust-lang/rust

fs::write fails on long file name in deep directory path on windows

canonicalize is generally the wrong thing to use almost all the time. It's just convenient to reach for as it is the closest approximation std provides to what you actually need, and yet it is almost always the wrong tool.

There are several ways to improve this situation (and are by no means mutually exclusive):

  • First class support in Rust for Windows manifests, and by default provide long path awareness in the manifest.
  • Provide a function that turns any path into an absolute path and make people use it instead of canonicalize.
  • Make PathBuf::push/Path::join actually be smart when relative paths are pushed onto a \\?\ path. Path::new(r"\\?\C:\foo").join("../bar") should result in \\?\C:\bar but it currently results in \\?\C:\foo\../bar which is extremely wrong.
  • Have every std function that takes a path automatically convert any paths over MAX_PATH to \\?\ paths.
  • Provide better documentation and more warnings about path length limitations.
dsherret

comment created time in a month

pull request commentrust-lang/rfcs

Introduce Pointee and DynSized

I'd like to point out that while I think size_of/size_of_val should never work on extern types and other unsized types, align_of/align_of_val should sometimes work. There are some examples in Windows API where the type would be best represented as an extern type and yet the caller is still responsible for allocating memory for it where they would need to know the alignment of the type (but get the size via the function telling them how many bytes to allocate).

Therefore a type that is !DynSized should not always forbid align_of.

nox

comment created time in a month

Pull request review commentrust-lang/rust

Add a way to limit inheritable handles when spawning child process on Windows

 struct DropGuard<'a> {     lock: &'a Mutex, } +#[derive(Default)]+struct ProcAttributeList {+    buf: Vec<u8>,

If PROC_THREAD_ATTRIBUTE_LIST were to be defined as an extern type, then this would be a great example of allowing alignment on extern types. I'm not aware of any alignment requirements, but 8/16 byte alignment would be a safe assumption (as that is what HeapAlloc guarantees).

quark-zju

comment created time in a month

PullRequestReviewEvent

issue commentrust-lang/unsafe-code-guidelines

Stacked Borrows: raw pointer usable only for `T` too strict?

I have created a VariableSizedBox smart pointer in wio that as far as I can tell is sound. I would appreciate some thorough review to ensure it is correct and a valid solution to the problem of FFI structs with variable sized arrays.

https://github.com/retep998/wio-rs/blob/master/src/vsb.rs

RalfJung

comment created time in a month

issue commentrust-lang/rust-bindgen

__BindgenUnionField and __IncompleteArrayField are UB according to Stacked Borrows model.

For reference this is the API I use for working with such variable sized structs: https://github.com/retep998/wio-rs/blob/master/src/vsb.rs

Dirbaio

comment created time in a month

Pull request review commentrust-lang/rust

Raise noncontinuable exception when aborting on earlier Windows versions

 pub fn dur2timeout(dur: Duration) -> c::DWORD {         .unwrap_or(c::INFINITE) } -/// Use `__fastfail` to abort the process+/// On Windows 8 and later versions, use the processor-specific `__fastfail`+/// mechanism. This will terminate the process immediately without running any+/// in-process exception handlers.+/// On Windows 7, use `RaiseFailFastException` to raise a noncontinuable exception+/// `STATUS_FAIL_FAST_EXCEPTION`.+/// On earlier versions of Windows, use `RaiseException` to raise the same+/// noncontinuable exception. ///-/// This is the same implementation as in libpanic_abort's `__rust_start_panic`. See-/// that function for more information on `__fastfail`+/// This is the same implementation as in libpanic_abort's `__rust_start_panic`. #[allow(unreachable_code)] pub fn abort_internal() -> ! {-    const FAST_FAIL_FATAL_APP_EXIT: usize = 7;     unsafe {-        cfg_if::cfg_if! {-            if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {-                asm!("int $$0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT);-                crate::intrinsics::unreachable();-            } else if #[cfg(all(target_arch = "arm", target_feature = "thumb-mode"))] {-                asm!(".inst 0xDEFB", in("r0") FAST_FAIL_FATAL_APP_EXIT);-                crate::intrinsics::unreachable();-            } else if #[cfg(target_arch = "aarch64")] {-                asm!("brk 0xF003", in("x0") FAST_FAIL_FATAL_APP_EXIT);-                crate::intrinsics::unreachable();+        if c::IsProcessorFeaturePresent(c::PF_FASTFAIL_AVAILABLE) != c::FALSE {+            const FAST_FAIL_FATAL_APP_EXIT: usize = 7;+            cfg_if::cfg_if! {+                if #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] {+                    asm!("int $$0x29", in("ecx") FAST_FAIL_FATAL_APP_EXIT);+                } else if #[cfg(all(target_arch = "arm", target_feature = "thumb-mode"))] {+                    asm!(".inst 0xDEFB", in("r0") FAST_FAIL_FATAL_APP_EXIT);+                } else if #[cfg(target_arch = "aarch64")] {+                    asm!("brk 0xF003", in("x0") FAST_FAIL_FATAL_APP_EXIT);+                } else {+                    crate::intrinsics::abort();+                }             }+        } else {+            match compat::lookup("kernel32", "RaiseFailFastException") {+                Some(..) => c::RaiseFailFastException(ptr::null(), ptr::null(), 0),

RaiseFailFastException requires Windows 7 so we'd need a fallback for XP/Vista.

NextTurn

comment created time in 2 months

PullRequestReviewEvent

issue commentnabijaczleweli/rust-embed-resource

Spurious build failures sometimes

  [...\Rust\registry\src\github.com-1ecc6299db9ec823\embed-resource-1.3.3\src\lib.rs:129] env::var("OUT_DIR") = Ok(
      ".../target\\debug\\build\\rust-cam-worker-dd42d6b834aee72b\\out",
  )
[...\Rust\registry\src\github.com-1ecc6299db9ec823\embed-resource-1.3.3\src\windows_msvc.rs:27] &["/fo", &format!("{}/{}.lib", out_dir, prefix), resource] = [
      "/fo",
      ".../target\\debug\\build\\rust-cam-worker-dd42d6b\u{0}\u{0}4aee72b\\out/elevated-manifest.lib",
      "elevated-manifest.rc",
  ]

Don't you just love to see memory corruption? I'm going to pin the blame firmly on vswhom and work on my own replacement for all the VS finding logic.

retep998

comment created time in 2 months

issue commentrust-lang/rust

Windows SOCKET type defined inconsistently between libc vs std::os::windows

From what I remember back when winapi was switching from u32/u64 to usize, it was the breaking change risk that stopped std from changing this definition. I'd love if it could be fixed.

Is crater able to actually test Windows specific changes like this yet?

infinity0

comment created time in 2 months

issue commentRybadour/Foreman

Error when loading 1.0 with Bob's mods

I've tried to debug this locally but when I run it with debugging it crashes on form.ShowDialog(); in ReloadFactorioData() with a System.InvalidOperationException. If I run it without debugging then I get the other error from earlier.

angelfrmhvn

comment created time in 2 months

issue commentRybadour/Foreman

Error when loading 1.0 with Bob's mods

I'm also having this crash when trying to run Foreman. It used to run fine in the past, and I haven't changed anything other than the passage of time and Factorio updating itself.

See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
   at Foreman.DataCache.ReadModSettings() in E:\Projects\ForemanGit\Foreman\DataCache.cs:line 392
   at Foreman.DataCache.LoadAllData(List`1 enabledMods, CancellableProgress progress) in E:\Projects\ForemanGit\Foreman\DataCache.cs:line 223
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Foreman.ProgressForm.<ProgressForm_Load>d__4.MoveNext() in E:\Projects\ForemanGit\Foreman\Forms\ProgressForm.cs:line 44
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
Foreman
    Assembly Version: 0.0.1.1
    Win32 Version: 0.0.0.0
    CodeBase: file:///D:/Software/Foreman/Foreman.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4150.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4001.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System.Configuration
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Core
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Xml
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
Microsoft.GeneratedCode
    Assembly Version: 1.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
NLua
    Assembly Version: 1.3.2.0
    Win32 Version: 1.3.2
    CodeBase: file:///D:/Software/Foreman/NLua.DLL
----------------------------------------
KeraLua
    Assembly Version: 1.3.2.0
    Win32 Version: 1.3.2.0
    CodeBase: file:///D:/Software/Foreman/KeraLua.DLL
----------------------------------------
Accessibility
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
Newtonsoft.Json
    Assembly Version: 10.0.0.0
    Win32 Version: 10.0.1.20720
    CodeBase: file:///D:/Software/Foreman/Newtonsoft.Json.DLL
----------------------------------------
Microsoft.CSharp
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/Microsoft.CSharp/v4.0_4.0.0.0__b03f5f7f11d50a3a/Microsoft.CSharp.dll
----------------------------------------
System.Numerics
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.3752.0 built by: NET48REL1
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Numerics/v4.0_4.0.0.0__b77a5c561934e089/System.Numerics.dll
----------------------------------------
System.Runtime.Serialization
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4180.0 built by: NET48REL1LAST_B
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.Serialization/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.Serialization.dll
----------------------------------------
System.Data
    Assembly Version: 4.0.0.0
    Win32 Version: 4.8.4121.0 built by: NET48REL1LAST_C
    CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_64/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.
angelfrmhvn

comment created time in 2 months

issue openedFTB-Gamepedia/OreDict

editoredict API should not wipe unspecified parameters

If a user calls editoredict and only specifies odmod for example, it should only update the mod. It should not set the tag, item name, and parameters to blank. The recent change entries look like everything is fine: 01:58, 13 August 2020 PonyButt talk contribs block points edited entry #10519 (Quintuple Chrome Plate from GregTech 5). Changes: mod [GT -> GT5] ; But a quick look at the oredictlist shows everything is awful: image

created time in 2 months

issue commentrust-lang/rust

Conditional features should be made clear in generated docs

It's unfortunate that we have to add an extra attribute to document that instead of preserving the cfg information so rustdoc can report it directly.

jdm

comment created time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha a4e1f68cf219f3f28058375ffb223ce44e8567d8

Add Default impl for VariableSizedBox

view details

push time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha a8997e66bbf4dfc074c543d1a7902070b3288d6d

This was probably wrong before

view details

push time in 2 months

issue commentnabijaczleweli/rust-embed-resource

Spurious build failures sometimes

Caused by:
  process didn't exit successfully: `.../target\debug\build\...-bc1d1fa0f0973d32\build-script-build` (exit code: 101)
--- stderr
[...\Rust\registry\src\github.com-1ecc6299db9ec823\embed-resource-1.3.3\src\windows_msvc.rs:26] find_windows_sdk_rc_exe().as_ref().map_or(Path::new("rc.exe"), Path::new) = "C:\\Program Files (x86)\\Windows Kits\\10\\bin\\10.0.19041.0\\x64\\rc.exe"
[...\Rust\registry\src\github.com-1ecc6299db9ec823\embed-resource-1.3.3\src\windows_msvc.rs:27] &["/fo", &format!("{}/{}.lib", out_dir, prefix), resource] = [
    "/fo",
    ".../target\\debug\\build\\...-ee488b4\u{0}\u{0}95c5992\\out/elevated-manifest.lib",
    "elevated-manifest.rc",
]
thread 'main' panicked at 'Are you sure you have RC.EXE in your $PATH?: Custom { kind: InvalidInput, error: "nul byte found in provided data" }', ...\Rust\registry\src\github.com-1ecc6299db9ec823\embed-resource-1.3.3\src\windows_msvc.rs:26:13

out_dir somehow has nul bytes in it?! It should be ee488b44895c5992 not ee488b4\u{0}\u{0}95c5992. I'm definitely not calling it in any weird way, just a literal embed_resource::compile("elevated-manifest.rc"); as the first line in the build script. So now I added a dbg! to when out_dir is originally acquired to find out if env::var("OUT_DIR") is giving us garbage, or if UB later on is somehow corrupting it. I would not be surprised if vswhom is inflicting UB here.

retep998

comment created time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha 2892ea96d65d4844a6ad4a74c9089c2372f0d17d

Handle zero sized VariableSizedBox It's UB to pass 0 to alloc

view details

push time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha 34c6816f346b81b30b138c463c6644cedd4e5650

Technically this is more correct

view details

Peter Atashian

commit sha 5ac6c1855a0ded9e60421fed53f158b833724852

Use NonNull

view details

push time in 2 months

PullRequestReviewEvent

PR closed retep998/wio-rs

Add default-target = "x86_64-pc-windows-msvc" key to Cargo.toml

This fixes #19.

+3 -0

1 comment

1 changed file

Osspial

pr closed time in 2 months

pull request commentretep998/wio-rs

Add default-target = "x86_64-pc-windows-msvc" key to Cargo.toml

Deprecated by https://github.com/retep998/wio-rs/commit/4339425eb6c5784e6050e237ed142e7a357ac7ee

Osspial

comment created time in 2 months

PR closed retep998/wio-rs

Add `docs.rs` metadata like that of upstream `winapi`

This allows for a nicer experiences at https://docs.rs/wio (which right now shows no symbols):

image

...so that, like https://docs.rs/winapi, there's actually something to see as intended:

image

+5 -0

1 comment

1 changed file

ErichDonGubler

pr closed time in 2 months

pull request commentretep998/wio-rs

Add `docs.rs` metadata like that of upstream `winapi`

Deprecated by https://github.com/retep998/wio-rs/commit/4339425eb6c5784e6050e237ed142e7a357ac7ee

ErichDonGubler

comment created time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha 4339425eb6c5784e6050e237ed142e7a357ac7ee

Improve documentation of VariableSizedBox.

view details

push time in 2 months

issue commentnabijaczleweli/rust-embed-resource

Spurious build failures sometimes

It is panicking on this line specifically, and there's only one way it gets called so I didn't think a backtrace would make much of a difference (plus getting one for a heisenbug like this...) https://github.com/nabijaczleweli/rust-embed-resource/blob/fcd30ad3fac44abd74afe9dcc3ade7ade24f8ddd/src/windows_msvc.rs#L30

The actually useful information would be knowing which ensure_no_nuls call is failing but the backtrace can't tell us that: https://github.com/rust-lang/rust/blob/d9d4d39612aae0b8398340bd83d592cafad8e4ec/library/std/src/sys/windows/process.rs#L60-L66

retep998

comment created time in 2 months

issue openedMelvorIdle/melvoridle.github.io

Bank tooltips can sometimes cause intense shaking or vibrations

Describe the bug When selecting certain items in the bank, it will cause intense shaking or vibration.

To Reproduce Steps to reproduce the behavior:

  1. Go to the bank
  2. Ensure your visible area is the right width.
  3. Click on a certain item in the bank to open the tooltip.
  4. Be horrified

Expected behavior I expect it to behave like any other bank tooltip and not rapidly vibrate.

Screenshots Due to limitations of capture software the shaking is not as pronounced in this videos, however I can assure you that it is switching back and forth as fast as my browser can keep up. https://i.imgur.com/n4Hstv0.gifv https://i.imgur.com/NoC6eCs.gifv

Browser Mozilla Firefox 79.0 on Windows 10.

Console output Nothing relevant.

Are you using any scripts? Yes, an auto farming script that should have no effect on bank layout shenanigans.

created time in 2 months

pull request commentFTB-Gamepedia/mediawiki-rs

Update upload_file and add new ways to upload

Outdated by https://github.com/FTB-Gamepedia/mediawiki-rs/commit/54b48419e8b9faa80fc3f55fb2d7a6f99b6ce638

SizableShrimp

comment created time in 2 months

issue openednabijaczleweli/rust-embed-resource

Spurious build failures sometimes

When building a program that uses this crate, I will sometimes get this error:

thread 'main' panicked at 'Are you sure you have RC.EXE in your $PATH?: Custom { kind: InvalidInput, error: "nul byte found in provided data" }', C:\...\Rust\registry\src\github.com-1ecc6299db9ec823\embed-resource-1.3.3\src\windows_msvc.rs:27:13

It goes away if I try to build again.

created time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha e39b82300ada3c00fab1bb77a88c22b12a560cd0

Add convenience methods to VariableSizedBox to acquire slices

view details

push time in 2 months

push eventFTB-Gamepedia/mediawiki-rs

Peter Atashian

commit sha 54b48419e8b9faa80fc3f55fb2d7a6f99b6ce638

Make upload more flexible

view details

push time in 2 months

issue commentretep998/Vana

Is this v75 source fully functional?

I'm so glad I'm using Rust for my own projects nowadays and not C++, so I don't have to deal with this dependency building hell.

Z41N

comment created time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha 536042e1de43a78cb85cd68b61a483ba4cbc47ca

Handle allocation failure for BStr

view details

push time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha 727516be714f48b7108b4b6d93a51b47293864df

Improvements to BStr

view details

push time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha b0c38f3490c2ae260a08bc4f4b267c0fd8d81522

Add delicious BStr wrapper

view details

push time in 2 months

pull request commentretep998/windump-rs

Merge libs with ar instead of creating linker scripts

There is no automated way to test it currently.

mati865

comment created time in 2 months

pull request commentretep998/windump-rs

Merge libs with ar instead of creating linker scripts

It should probably delete the unmerged import libraries after merging them.

mati865

comment created time in 2 months

push eventretep998/wio-rs

Peter Atashian

commit sha e471fac80d8de210e65035af66f6fd111e0d3b32

Experimenting with new VariableSizedBox

view details

push time in 2 months

issue commentrust-lang/rust

"Illegal instruction" from oxipng on old CPU (i5-650)

cc.flag_if_supported("/arch:AVX"); is definitely flat out wrong if intending to run the software on CPUs without AVX support. What is the current recommended approach to identifying the CPU target features for the target from the build script?

vkcz

comment created time in 2 months

pull request commentrust-lang/rust

Add a way to limit inheritable handles when spawning child process on Windows

Personally I would prefer to never automatically inherit handles and instead always explicitly specify the set of handles to be inherited. However there is the potential for that to be a breaking change, and the migration story would not be great if the only way around it was using an unstable API. It's also really hard to actually determine whether anyone would be affected without just deploying it live and seeing whether people complain about it breaking.

quark-zju

comment created time in 2 months

pull request commentrust-lang/rust

Add std::thread::hardware_threads

It still needs a big warning in the documentation that the number may not be accurate. If interpreted as the number of actual hardware threads, it can undercount on Windows systems with more than 64 hardware threads. If interpreted as the available concurrency for that process, it can overcount on Windows systems when limited by a process wide affinity mask or job object limitations.

yoshuawuyts

comment created time in 2 months

issue commentrust-lang/rust-clippy

Lint to disallow using `as` for pointer casts in favor of `.cast()`

Yes, and there are also lints for specific types of as casts. There is no lint for specifically pointer casts while still allowing other kinds of as casts.

retep998

comment created time in 2 months

issue openedrust-lang/rust-clippy

Lint to disallow using `as` for pointer casts in favor of `.cast()`

What it does

Any raw pointer cast from *const T to *const U or *mut T to *mut U that uses as should be caught by this lint. Instead you should use .cast().

Should probably be a pedantic or restriction lint.

Drawbacks

None.

Example

foo as *const c_void

Could be written as:

foo.cast()

created time in 2 months

issue commentrust-lang/rust

8.5% runtime performance degradation for GNU-toolchain 1.45.x vs. 1.44.x in Windows

Why is there even any sort of performance difference based on which linker is used? Shouldn't Rust be generating the same code regardless?

mvanthoor

comment created time in 2 months

issue commentrust-lang/rust

Tracking issue for `safe_packed_borrows` compatibility lint

No, that is not UB. Rust can easily see that you're assigning a value to a misaligned location and tell LLVM to generate the correct code for it. It is only the creation of references to misaligned locations that is bad because the reference does not preserve any alignment information.

arielb1

comment created time in 2 months

issue closedretep998/winapi-rs

BUG error: failed to run custom build command for `winapi v0.3.9`

rust version:

1.45.0

error: failed to run custom build command for winapi v0.3.9

Caused by: could not execute process D:\RustProject\cf\target\debug\build\winapi-68cc666bcca840ff\build-script-build (never executed)

Caused by: 该版本的 %1 与你运行的 Windows 版本不兼容。请查看计算机的系统信息,然后联系软件发布者。 (os error 216)

closed time in 2 months

zhuxiujia

Pull request review commentretep998/winapi-rs

Add bindings to DirectShow stuff

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::{GUID};+use shared::wtypes::{BSTR};+use um::oaidl::{IDispatch, IDispatchVtbl, LPDISPATCH, VARIANT};+use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN};+use um::winnt::{HRESULT};+pub type LONG_PTR = i64;+RIDL!{#[uuid(0x56a868b9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IAMCollection(IAMCollectionVtbl): IDispatch(IDispatchVtbl) {+    fn get_Count(+        plCount: *mut i32,+    ) -> HRESULT,+    fn Item(+        lItem: i32,+        ppUnk: *mut LPUNKNOWN,+    ) -> HRESULT,+    fn get__NewEnum(+        ppUnk: *mut LPUNKNOWN,+    ) -> HRESULT,+}}+RIDL!{#[uuid(0x56a868b1, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IMediaControl(IMediaControlVtbl): IDispatch(IDispatchVtbl) {+    fn Run(+    ) -> HRESULT,+    fn Pause(+    ) -> HRESULT,+    fn Stop(+    ) -> HRESULT,+    fn GetState(+        msTimeout: i32,+        pfs: *mut i32,+    ) -> HRESULT,+    fn RenderFile(+        strFilename: BSTR,+    ) -> HRESULT,+    fn AddSourceFilter(+        strFilename: BSTR,+        ppUnk: *mut LPDISPATCH,
        ppUnk: *mut *mut IDispatch,
fkaa

comment created time in 3 months

Pull request review commentretep998/winapi-rs

Add bindings to DirectShow stuff

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::{GUID};+use shared::wtypes::{BSTR};+use um::oaidl::{IDispatch, IDispatchVtbl, LPDISPATCH, VARIANT};+use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN};+use um::winnt::{HRESULT};+pub type LONG_PTR = i64;+RIDL!{#[uuid(0x56a868b9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IAMCollection(IAMCollectionVtbl): IDispatch(IDispatchVtbl) {+    fn get_Count(+        plCount: *mut i32,+    ) -> HRESULT,+    fn Item(+        lItem: i32,+        ppUnk: *mut LPUNKNOWN,+    ) -> HRESULT,+    fn get__NewEnum(+        ppUnk: *mut LPUNKNOWN,+    ) -> HRESULT,+}}+RIDL!{#[uuid(0x56a868b1, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IMediaControl(IMediaControlVtbl): IDispatch(IDispatchVtbl) {+    fn Run(+    ) -> HRESULT,+    fn Pause(+    ) -> HRESULT,+    fn Stop(+    ) -> HRESULT,+    fn GetState(+        msTimeout: i32,
        msTimeout: LONG,
fkaa

comment created time in 3 months

Pull request review commentretep998/winapi-rs

Add bindings to DirectShow stuff

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::{GUID};+use shared::wtypes::{BSTR};+use um::oaidl::{IDispatch, IDispatchVtbl, LPDISPATCH, VARIANT};+use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN};+use um::winnt::{HRESULT};+pub type LONG_PTR = i64;+RIDL!{#[uuid(0x56a868b9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IAMCollection(IAMCollectionVtbl): IDispatch(IDispatchVtbl) {+    fn get_Count(+        plCount: *mut i32,+    ) -> HRESULT,+    fn Item(+        lItem: i32,+        ppUnk: *mut LPUNKNOWN,+    ) -> HRESULT,+    fn get__NewEnum(+        ppUnk: *mut LPUNKNOWN,+    ) -> HRESULT,+}}+RIDL!{#[uuid(0x56a868b1, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IMediaControl(IMediaControlVtbl): IDispatch(IDispatchVtbl) {+    fn Run(+    ) -> HRESULT,+    fn Pause(+    ) -> HRESULT,+    fn Stop(+    ) -> HRESULT,+    fn GetState(+        msTimeout: i32,+        pfs: *mut i32,
        pfs: *mut OAFilterState,
fkaa

comment created time in 3 months

Pull request review commentretep998/winapi-rs

Add bindings to DirectShow stuff

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::{GUID};+use shared::wtypes::{BSTR};+use um::oaidl::{IDispatch, IDispatchVtbl, LPDISPATCH, VARIANT};+use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN};+use um::winnt::{HRESULT};+pub type LONG_PTR = i64;+RIDL!{#[uuid(0x56a868b9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IAMCollection(IAMCollectionVtbl): IDispatch(IDispatchVtbl) {+    fn get_Count(+        plCount: *mut i32,+    ) -> HRESULT,+    fn Item(+        lItem: i32,+        ppUnk: *mut LPUNKNOWN,+    ) -> HRESULT,+    fn get__NewEnum(+        ppUnk: *mut LPUNKNOWN,+    ) -> HRESULT,+}}+RIDL!{#[uuid(0x56a868b1, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IMediaControl(IMediaControlVtbl): IDispatch(IDispatchVtbl) {+    fn Run(+    ) -> HRESULT,
    fn Run() -> HRESULT,

Zero argument functions should be a single line.

fkaa

comment created time in 3 months

Pull request review commentretep998/winapi-rs

Add bindings to DirectShow stuff

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::{GUID};+use shared::wtypes::{BSTR};+use um::oaidl::{IDispatch, IDispatchVtbl, LPDISPATCH, VARIANT};+use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN};+use um::winnt::{HRESULT};+pub type LONG_PTR = i64;+RIDL!{#[uuid(0x56a868b9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IAMCollection(IAMCollectionVtbl): IDispatch(IDispatchVtbl) {+    fn get_Count(+        plCount: *mut i32,+    ) -> HRESULT,+    fn Item(+        lItem: i32,+        ppUnk: *mut LPUNKNOWN,
        ppUnk: *mut *mut IUnknown,
fkaa

comment created time in 3 months

Pull request review commentretep998/winapi-rs

Add bindings to DirectShow stuff

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::{GUID};+use shared::wtypes::{BSTR};+use um::oaidl::{IDispatch, IDispatchVtbl, LPDISPATCH, VARIANT};+use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN};+use um::winnt::{HRESULT};+pub type LONG_PTR = i64;+RIDL!{#[uuid(0x56a868b9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IAMCollection(IAMCollectionVtbl): IDispatch(IDispatchVtbl) {+    fn get_Count(+        plCount: *mut i32,+    ) -> HRESULT,+    fn Item(+        lItem: i32,
        lItem: c_long,
fkaa

comment created time in 3 months

Pull request review commentretep998/winapi-rs

Add bindings to DirectShow stuff

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::{GUID};+use shared::wtypes::{BSTR};+use um::oaidl::{IDispatch, IDispatchVtbl, LPDISPATCH, VARIANT};+use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN};+use um::winnt::{HRESULT};+pub type LONG_PTR = i64;+RIDL!{#[uuid(0x56a868b9, 0x0ad4, 0x11ce, 0xb0, 0x3a, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70)]+interface IAMCollection(IAMCollectionVtbl): IDispatch(IDispatchVtbl) {+    fn get_Count(+        plCount: *mut i32,
        plCount: *mut LONG,
fkaa

comment created time in 3 months

Pull request review commentretep998/winapi-rs

Add bindings to DirectShow stuff

+// Licensed under the Apache License, Version 2.0+// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT license+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.+// All files in the project carrying such notice may not be copied, modified, or distributed+// except according to those terms.+use shared::guiddef::{GUID};+use shared::wtypes::{BSTR};+use um::oaidl::{IDispatch, IDispatchVtbl, LPDISPATCH, VARIANT};+use um::unknwnbase::{IUnknown, IUnknownVtbl, LPUNKNOWN};+use um::winnt::{HRESULT};+pub type LONG_PTR = i64;

LONG_PTR is not defined in this header, and this is the incorrect definition for it anyway. There should be REFTIME OAEVENT OAHWND and OAFilterState definitions at the top here though.

fkaa

comment created time in 3 months

startedghostinthecamera/IGCS-GITC

started time in 3 months

issue commentrust-lang/rust

Joining thread in thread local storage destructor never returns on Windows

This excerpt from MSDN might be relevant:

The ExitProcess, ExitThread, CreateThread, CreateRemoteThread functions, and a process that is starting (as the result of a CreateProcess call) are serialized between each other within a process. Only one of these events can happen in an address space at a time. This means the following restrictions hold:

  • During process startup and DLL initialization routines, new threads can be created, but they do not begin execution until DLL initialization is done for the process.
  • Only one thread in a process can be in a DLL initialization or detach routine at a time.
  • ExitProcess does not return until no threads are in their DLL initialization or detach routines.
emgre

comment created time in 3 months

issue commentrust-lang/backtrace-rs

Support column information

Note that Windows dbghelp also provides column numbers, although dbghelp calls it "displacement". Most of the functions that are called which provide the line number also provide the displacement but that parameter is currently ignored.

est31

comment created time in 3 months

issue commentrust-lang/rust-clippy

Clippy doesn't report error/warnings after cargo check

I'm running into this a lot because rust-analyzer will automatically run cargo check on save, so when I decide to run cargo clippy it doesn't report anything.

b1zzu

comment created time in 3 months

CommitCommentEvent

Pull request review commentrust-lang/rust

Use union to cast between big endian fields of s6_addr

 impl Ipv6Addr {     /// ```     #[stable(feature = "rust1", since = "1.0.0")]     pub fn segments(&self) -> [u16; 8] {-        let arr = &self.inner.s6_addr;-        [-            u16::from_be_bytes([arr[0], arr[1]]),-            u16::from_be_bytes([arr[2], arr[3]]),-            u16::from_be_bytes([arr[4], arr[5]]),-            u16::from_be_bytes([arr[6], arr[7]]),-            u16::from_be_bytes([arr[8], arr[9]]),-            u16::from_be_bytes([arr[10], arr[11]]),-            u16::from_be_bytes([arr[12], arr[13]]),-            u16::from_be_bytes([arr[14], arr[15]]),-        ]+        // SAFETY: All element of `s6_addr16` must be big edian.+        unsafe { Ipv6Bytes { addr: self.inner.s6_addr }.addr16 }

This will need to do something like [u16::from_be(arr[0]), u16::from_be(arr[1]), ...]

lzutao

comment created time in 3 months

issue commentretep998/winapi-rs

Avoding linker scripts in MinGW libraries

If there is some way to detect whether Rust is not using self-contained mode, then sure I could have winapi automatically disable the bundled import libraries. raw-dylib is still better though.

mati865

comment created time in 3 months

issue openedrust-lang/rustup

Concurrent installations of a toolchain potentially racy

We have a CI setup where the builders run on the same machine but are not sandboxed from each other. When updating Rust toolchains this means that the builders can attempt to install the same toolchain concurrently resulting in interesting errors. For example:

>rustup target add i686-pc-windows-msvc 
22:39:06 info: syncing channel updates for '1.45.2-x86_64-pc-windows-msvc'
22:39:06 info: latest update on 2020-08-03, rust version 1.45.2 (d3fb005a3 2020-07-31)
22:39:06 info: downloading component 'cargo'
22:39:06 info: downloading component 'clippy'
22:39:06 info: downloading component 'rust-docs'
22:39:08 info: downloading component 'rust-std'
22:39:09 info: downloading component 'rustc'
22:39:13 info: downloading component 'rustfmt'
22:39:13 info: installing component 'cargo'
22:39:13 info: installing component 'clippy'
22:39:13 info: installing component 'rust-docs'
22:39:52 info: installing component 'rust-std'
22:39:52 info: installing component 'rustc'
22:39:54 info: installing component 'rustfmt'
22:39:57 info: downloading component 'rust-std' for 'i686-pc-windows-msvc'
22:40:01 info: installing component 'rust-std' for 'i686-pc-windows-msvc'
>rustup target add i686-pc-windows-msvc 
22:39:05 info: syncing channel updates for '1.45.2-x86_64-pc-windows-msvc'
22:39:06 info: latest update on 2020-08-03, rust version 1.45.2 (d3fb005a3 2020-07-31)
22:39:06 info: downloading component 'cargo'
22:39:06 info: downloading component 'clippy'
22:39:07 info: downloading component 'rust-docs'
22:39:08 error: component download failed for rust-docs-x86_64-pc-windows-msvc
22:39:08 error: caused by: could not rename file

It would probably be better to detect this situation and have one of the rustup invocations wait for the other to finish before proceeding and realizing the toolchain was already installed.

created time in 3 months

issue commentretep998/winapi-rs

Avoding linker scripts in MinGW libraries

Feel free to improve how they are generated. https://github.com/retep998/windump-rs/blob/master/src/bin/exports.rs

Ideally I'd like raw-dylib to be implemented so I don't need these import libraries.

mati865

comment created time in 3 months

push eventretep998/windump-rs

Peter Atashian

commit sha 166fae712548941b09b0576f87ebde37242fe66f

No judgerino

view details

push time in 3 months

Pull request review commentrust-lang/rust

Use union to cast between big endian fields of s6_addr

 impl Ipv6Addr {     /// ```     #[stable(feature = "rust1", since = "1.0.0")]     #[rustc_const_stable(feature = "const_ipv6", since = "1.32.0")]+    #[allow_internal_unstable(const_fn_union)]     pub const fn new(a: u16, b: u16, c: u16, d: u16, e: u16, f: u16, g: u16, h: u16) -> Ipv6Addr {         Ipv6Addr {             inner: c::in6_addr {-                s6_addr: [-                    (a >> 8) as u8,-                    a as u8,-                    (b >> 8) as u8,-                    b as u8,-                    (c >> 8) as u8,-                    c as u8,-                    (d >> 8) as u8,-                    d as u8,-                    (e >> 8) as u8,-                    e as u8,-                    (f >> 8) as u8,-                    f as u8,-                    (g >> 8) as u8,-                    g as u8,-                    (h >> 8) as u8,-                    h as u8,-                ],+                // SAFETY: Each element of `s6_addr16` is big edian.+                s6_addr: unsafe { in6_union { s6_addr16: [a, b, c, d, e, f, g, h] }.s6_addr },

Or [a.to_be(), b.to_be(), ...] to get a [u16; 8] directly that is big endian.

lzutao

comment created time in 3 months

pull request commentrust-lang/rust

Use union to cast between big endian fields of s6_addr

All members of the IN6_ADDR structure must be specified in network-byte-order (big-endian).

I'm pretty sure this means that if you're on a little endian system you have to byte swap your shorts before writing them to this structure.

lzutao

comment created time in 3 months

issue commentrust-lang/rust

The way to use `include_bytes!` in a cross-platform way is not discoverable

Well it is the same parsing. Concatenating foo/bar onto a Path that starts with \\?\ on Windows also runs into the exact same issue.

Shnatsel

comment created time in 3 months

issue commentrust-lang/rust

The way to use `include_bytes!` in a cross-platform way is not discoverable

/ should work on Windows, if it doesn't then that is the issue.

On Windows if OUT_DIR for whatever reason uses \\?\ paths then using / as the separator will break. While it is nice to support / in paths as much as we can, we should be pushing to ensure code always uses the correct separator for the platform.

Shnatsel

comment created time in 3 months

issue commentrust-lang/rust

No way platform-independent way to `include_bytes!` data generated by a build script

Can you use a build script to use cargo:rustc-env to set your own environment variable that contains the full path using the host specific path separators and whatnot?

Shnatsel

comment created time in 3 months

issue commentrust-lang/cargo

Mutually exclusive features

At least in my view of what mutually exclusive features are used for, building a crate twice with different mutually exclusive features seems not particularly useful. Typically the most common sort of mutually exclusive option is things like choosing 1. which backend or implementation to use for some crate or 2. how to link to some library. Both of those situations aren't decisions that their direct reverse dependencies typically care about, but it does matter to the top level binary crate and the user building it. Therefore what I think the solution should be is adding support for features that are chosen by the top level crate and not the direct reverse dependencies and allowing mutually exclusive features as part of them. As well there should probably be some way for crates to learn what features are enabled in their dependencies so they can automatically adapt to the situation.

retep998

comment created time in 3 months

issue commentrust-lang/rust

Path::starts_with and ends_with should be case-insensitive on Windows

I think it would also be good to have a crate like same-file provide a starts_with that does hit the filesystem. Such an API would also be able to detect when the same folder is specified but using alternate prefixes or mount points or through symbolic links.

zuobaoquan

comment created time in 3 months

CommitCommentEvent

issue commentrust-lang/rust

Joining thread in thread local storage destructor never returns on Windows

There's definitely race conditions involved as inserting sleeps at certain points changes the behavior.

emgre

comment created time in 3 months

issue commentrust-lang/rust

"File too big" when using nightly-x86_64-pc-windows-gnu

Is this Rust's fault? This looks more like an issue with the cc crate for not passing those flags to the compiler. Probably better to move this issue to https://github.com/alexcrichton/cc-rs

sum-elier

comment created time in 3 months

issue commentrust-lang/rust

Joining thread in thread local storage destructor never returns on Windows

Hmmm, I'll have to investigate further into what is going on...

emgre

comment created time in 3 months

issue commentrust-lang/rust

Joining thread in thread local storage destructor never returns on Windows

join() does not return until the thread has actually and completely finished running. If it is still running TLS destructors then the thread is still running. Doing a join() on the current thread will always deadlock, at least on Windows anyway.

emgre

comment created time in 3 months

issue commentrust-lang/libc

Add "_aligned_malloc" on windows platform

Keep in mind that aligned_malloc is not the same as posix_memalign as memory allocated using posix_memalign can be freed using free but _aligned_malloc memory has to be deallocated specifically using _aligned_free.

paddyhoran

comment created time in 3 months

IssuesEvent

issue commentrust-lang/rust

Incorrect read_vectored behaviour on Windows

Generally when an issue turns out to be not a bug, but docs can be improved, the issue is left open but tags changed like so.

kubkon

comment created time in 3 months

issue commentrust-lang/rust

Incorrect read_vectored behaviour on Windows

This sort of behavior difference isn't guaranteed either. Any platform is free to fill as much or as little of your provided buffer(s) as they want, and does not have to be consistent about it. It is your responsibility, regardless of platform, to check how many bytes were read and proceed accordingly.

kubkon

comment created time in 3 months

Pull request review commentrust-lang/rust

MinGW: enable dllexport/dllimport

 impl<'a> Linker for GccLinker<'a> {             return;         } +        let is_windows = self.sess.target.target.options.is_like_windows;         let mut arg = OsString::new();-        let path = tmpdir.join("list");+        let path = tmpdir.join(if is_windows { "list.def" } else { "list" });

On Windows .map files have a different meaning. https://docs.microsoft.com/en-us/cpp/build/reference/map-generate-mapfile?view=vs-2019

mati865

comment created time in 3 months

issue commentEngineHub/WorldEdit

//undo with use-inventory returns one item of all materials used when all materials should be consumed.

I do wish the use-inventory option was supported. It's such a useful middle ground between creative and survival.

CHduckie

comment created time in 3 months

issue openedEngineHub/WorldEdit

Wall mounted torches cannot be replaced when using inventory

Versions WorldEdit version:WorldEdit version 7.2.0-beta-02 Platform version: git-Paper-115

Describe the bug Wall mounted torches cannot be replaced when worldedit is configured to use the inventory.

To Reproduce Using WorldEdit configured like so:

use-inventory:
    enable: true
    allow-override: false
    creative-mode-overrides: true
  1. Place a torch on a wall.
  2. Create a selection containing that torch.
  3. //set air
  4. Observe no change occur and an error get dumped in the log

Expected behavior I would like the torch to be replaced with whatever I want it to be replaced with, and the torch to go in my inventory.

Screenshots image

Additional context

java.lang.reflect.InvocationTargetException: null
at com.sk89q.worldedit.util.eventbus.EventHandler.handleEvent(EventHandler.java:75) ~[?:?]
at com.sk89q.worldedit.util.eventbus.EventBus.dispatch(EventBus.java:193) ~[?:?]
at com.sk89q.worldedit.util.eventbus.EventBus.post(EventBus.java:181) ~[?:?]
at com.sk89q.worldedit.bukkit.WorldEditPlugin.onCommand(WorldEditPlugin.java:350) ~[?:?]
at com.sk89q.bukkit.util.DynamicPluginCommand.execute(DynamicPluginCommand.java:55) ~[?:?]
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:159) ~[patched_1.16.1.jar:git-Paper-115]
at org.bukkit.craftbukkit.v1_16_R1.CraftServer.dispatchCommand(CraftServer.java:794) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.PlayerConnection.handleCommand(PlayerConnection.java:1912) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:1723) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.java:47) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.PacketPlayInChat.a(PacketPlayInChat.java:5) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$ensureMainThread$1(PlayerConnectionUtils.java:23) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(IAsyncTaskHandler.java:136) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(IAsyncTaskHandler.java:109) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:1136) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftServer.java:1129) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.awaitTasks(IAsyncTaskHandler.java:119) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.MinecraftServer.sleepForTick(MinecraftServer.java:1090) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:1004) ~[patched_1.16.1.jar:git-Paper-115]
at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$a$0(MinecraftServer.java:177) ~[patched_1.16.1.jar:git-Paper-115]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_251]
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
at com.sk89q.worldedit.util.eventbus.MethodEventHandler.dispatch(MethodEventHandler.java:58) ~[?:?]
at com.sk89q.worldedit.util.eventbus.EventHandler.handleEvent(EventHandler.java:73) ~[?:?]
... 22 more
Caused by: java.lang.IllegalArgumentException: This block cannot be stored
at com.sk89q.worldedit.bukkit.BukkitPlayerBlockBag.storeBlock(BukkitPlayerBlockBag.java:114) ~[?:?]
at com.sk89q.worldedit.extent.inventory.BlockBag.storeBlock(BlockBag.java:80) ~[?:?]
at com.sk89q.worldedit.extent.inventory.BlockBag.storeDroppedBlock(BlockBag.java:41) ~[?:?]
at com.sk89q.worldedit.extent.inventory.BlockBagExtent.setBlock(BlockBagExtent.java:107) ~[?:?]
at com.sk89q.worldedit.function.operation.SetBlockMap.resume(SetBlockMap.java:45) ~[?:?]
at com.sk89q.worldedit.extent.reorder.MultiStageReorder$1.resume(MultiStageReorder.java:273) ~[?:?]
at com.sk89q.worldedit.function.operation.OperationQueue.resume(OperationQueue.java:92) ~[?:?]
at com.sk89q.worldedit.function.operation.OperationQueue.resume(OperationQueue.java:92) ~[?:?]
at com.sk89q.worldedit.function.operation.Operations.completeBlindly(Operations.java:74) ~[?:?]
at com.sk89q.worldedit.EditSession.flushSession(EditSession.java:833) ~[?:?]
at com.sk89q.worldedit.extension.platform.PlatformCommandManager.handleCommand(PlatformCommandManager.java:534) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_251]
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_251]
at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_251]
at com.sk89q.worldedit.util.eventbus.MethodEventHandler.dispatch(MethodEventHandler.java:58) ~[?:?]
at com.sk89q.worldedit.util.eventbus.EventHandler.handleEvent(EventHandler.java:73) ~[?:?]
... 22 more

created time in 3 months

issue commentrust-lang/rust

concat doesn't allow string constants as parameters

@sergeken Because concat! cannot be changed to do this. However a const fn way of concatenating strings is possible. https://github.com/rust-lang/const-eval/issues/20 is probably the best place to follow for further developments.

CodeMonkey90

comment created time in 3 months

issue commentrust-lang/rust

Spurious error while building Rust locally

I haven't built Rust recently.

retep998

comment created time in 3 months

issue commentrust-lang/rust

CString and OsString do not preserve capacity

I don't know why OsString is being dragged into this. At least on Windows OsString is a wrapper around Vec<u8>, and OsString has APIs to work with its capacity. That said it would be great to have more methods on OsString to manipulate it directly.

kotauskas

comment created time in 3 months

more