carina-studio / ULogViewer

Cross-Platform Universal Log Viewer.
https://carina-studio.github.io/ULogViewer/
MIT License
411 stars 41 forks source link

无法在ArchLinux下运行 #21

Closed zxp19821005 closed 1 year ago

zxp19821005 commented 1 year ago

我将软件包移植到了ArchLinux,目前未发布到AUR。PKGBUILD文件如下:

# Maintainer: zxp19821005 <zxp19821005 at 163 dot com>
pkgname=ulogviewer-bin
_appname=ULogViewer
pkgver=2.0.22.423
pkgrel=1
pkgdesc="Cross-Platform Universal Log Viewer."
arch=('aarch64' 'x86_64')
url="https://carina-studio.github.io/ULogViewer/"
_githuburl="https://github.com/carina-studio/ULogViewer"
license=('MIT')
depends=('zlib' 'fontconfig' 'glibc' 'gcc-libs' 'dotnet-runtime')
makedepends=('gendesk')
noextract=("${pkgname%-bin}-${pkgver}-${CARCH}.tar.gz")
conflicts=("${pkgname%-bin}")
source_aarch64=("${pkgname%-bin}-${pkgver}-aarch64.tar.gz::${_githuburl}/releases/download/${pkgver}/${_appname}-${pkgver}-linux-arm64.zip")
source_x86_64=("${pkgname%-bin}-${pkgver}-x86_64.tar.gz::${_githuburl}/releases/download/${pkgver}/${_appname}-${pkgver}-linux-x64.zip")
source=("LICENSE::https://raw.githubusercontent.com/carina-studio/ULogViewer/master/LICENSE")
sha256sums=('4b023d792eb6b929311286a207c6493e18875bd9d320db8f7a996dd5d5716fea')
sha256sums_aarch64=('5275c42021ffb5328073f2f1ec37d152c8ff53d308fad26bce64146ce1051752')
sha256sums_x86_64=('5f94b62de810219288582ed595fd2e2a38c4f8301f1cbc42271ad1728985beec')

package() {
    install -Dm755 -d "${pkgdir}/opt/${pkgname%-bin}"
    bsdtar -xf "${srcdir}/${pkgname%-bin}-${pkgver}-${CARCH}.tar.gz" -C "${pkgdir}/opt/${pkgname%-bin}" --gname root --uname root
    install -Dm644 "${pkgdir}/opt/${pkgname%-bin}/${_appname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname%-bin}.png"
    install -Dm644 "${srcdir}/LICENSE" -t "${pkgdir}/usr/share/licenses/${pkgname}"
    gendesk -f -n --icon "${pkgname%-bin}" --categories "Utility" --name "${_appname}" --exec "/opt/${pkgname%-bin}/${_appname}"
    install -Dm644 "${srcdir}/${pkgname%-bin}.desktop" -t "${pkgdir}/usr/share/applications"
}

打包安装之后,点击图标无反应,在终端下执行报错:

$ /opt/ulogviewer/ULogViewer 
Unhandled exception. System.InvalidOperationException: Default font family name can't be null or empty.
   at Avalonia.Media.FontManager..ctor(IFontManagerImpl platformImpl) in /_/src/Avalonia.Visuals/Media/FontManager.cs:line 33
   at Avalonia.Media.FontManager.get_Current() in /_/src/Avalonia.Visuals/Media/FontManager.cs:line 53
   at Avalonia.Media.TextFormatting.TextCharacters.TryGetRunProperties(ReadOnlySlice`1 text, Typeface typeface, Typeface defaultTypeface, Int32& count) in /_/src/Avalonia.Visuals/Media/TextFormatting/TextCharacters.cs:line 129
   at Avalonia.Media.TextFormatting.TextCharacters.CreateShapeableRun(ReadOnlySlice`1 text, TextRunProperties defaultProperties) in /_/src/Avalonia.Visuals/Media/TextFormatting/TextCharacters.cs:line 62
   at Avalonia.Media.TextFormatting.TextCharacters.GetShapeableCharacters() in /_/src/Avalonia.Visuals/Media/TextFormatting/TextCharacters.cs:line 40
   at Avalonia.Media.TextFormatting.TextFormatterImpl.FetchTextRuns(ITextSource textSource, Int32 firstTextSourceIndex, TextLineBreak previousLineBreak, TextLineBreak& nextLineBreak) in /_/src/Avalonia.Visuals/Media/TextFormatting/TextFormatterImpl.cs:line 280
   at Avalonia.Media.TextFormatting.TextFormatterImpl.FormatLine(ITextSource textSource, Int32 firstTextSourceIndex, Double paragraphWidth, TextParagraphProperties paragraphProperties, TextLineBreak previousLineBreak) in /_/src/Avalonia.Visuals/Media/TextFormatting/TextFormatterImpl.cs:line 15
   at Avalonia.Media.TextFormatting.TextLayout.UpdateLayout() in /_/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs:line 223
   at Avalonia.Media.TextFormatting.TextLayout..ctor(String text, Typeface typeface, Double fontSize, IBrush foreground, TextAlignment textAlignment, TextWrapping textWrapping, TextTrimming textTrimming, TextDecorationCollection textDecorations, Double maxWidth, Double maxHeight, Double lineHeight, Int32 maxLines, IReadOnlyList`1 textStyleOverrides) in /_/src/Avalonia.Visuals/Media/TextFormatting/TextLayout.cs:line 71
   at Avalonia.Controls.TextBlock.CreateTextLayout(Size constraint, String text) in /_/src/Avalonia.Controls/TextBlock.cs:line 475
   at Avalonia.Controls.TextBlock.get_TextLayout() in /_/src/Avalonia.Controls/TextBlock.cs:line 166
   at Avalonia.Controls.TextBlock.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/TextBlock.cs:line 521
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1150
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 1005
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 427
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Controls.Grid.MeasureCell(Int32 cell, Boolean forceInfinityV) in /_/src/Avalonia.Controls/Grid.cs:line 1150
   at Avalonia.Controls.Grid.MeasureCellsGroup(Int32 cellsHead, Size referenceSize, Boolean ignoreDesiredSizeU, Boolean forceInfinityV, Boolean& hasDesiredSizeUChanged) in /_/src/Avalonia.Controls/Grid.cs:line 1005
   at Avalonia.Controls.Grid.MeasureOverride(Size constraint) in /_/src/Avalonia.Controls/Grid.cs:line 427
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 625
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding) in /_/src/Avalonia.Layout/LayoutHelper.cs:line 46
   at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Layout/LayoutHelper.cs:line 39
   at Avalonia.Controls.Border.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Border.cs:line 187
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding) in /_/src/Avalonia.Layout/LayoutHelper.cs:line 46
   at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding, Thickness borderThickness) in /_/src/Avalonia.Layout/LayoutHelper.cs:line 39
   at Avalonia.Controls.Presenters.ContentPresenter.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Presenters/ContentPresenter.cs:line 366
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Layout.LayoutHelper.MeasureChild(ILayoutable control, Size availableSize, Thickness padding) in /_/src/Avalonia.Layout/LayoutHelper.cs:line 46
   at Avalonia.Controls.Primitives.VisualLayerManager.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Primitives/VisualLayerManager.cs:line 133
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 625
   at Avalonia.Layout.Layoutable.MeasureCore(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 559
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Layout.Layoutable.MeasureOverride(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 625
   at Avalonia.Controls.Window.MeasureOverride(Size availableSize) in /_/src/Avalonia.Controls/Window.cs:line 916
   at Avalonia.Controls.WindowBase.MeasureCore(Size availableSize) in /_/src/Avalonia.Controls/WindowBase.cs:line 247
   at Avalonia.Layout.Layoutable.Measure(Size availableSize) in /_/src/Avalonia.Layout/Layoutable.cs:line 364
   at Avalonia.Layout.LayoutManager.Measure(ILayoutable control) in /_/src/Avalonia.Layout/LayoutManager.cs:line 297
   at Avalonia.Layout.LayoutManager.ExecuteInitialLayoutPass() in /_/src/Avalonia.Layout/LayoutManager.cs:line 184
   at Avalonia.Controls.Window.ShowCore(Window parent) in /_/src/Avalonia.Controls/Window.cs:line 693
   at Avalonia.Controls.Window.Show() in /_/src/Avalonia.Controls/Window.cs:line 631
   at CarinaStudio.AppSuite.AppSuiteApplication.OnPrepareStartingAsync()
   at CarinaStudio.ULogViewer.App.OnPrepareStartingAsync() in /Users/carina/Studio/ULogViewer/ULogViewer/App.axaml.cs:line 378
   at CarinaStudio.AppSuite.AppSuiteApplication.<>c__DisplayClass202_0.<<OnFrameworkInitializationCompleted>b__4>d.MoveNext()
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Avalonia.Threading.AvaloniaSynchronizationContext.<>c__DisplayClass5_0.<Post>b__0() in /_/src/Avalonia.Base/Threading/AvaloniaSynchronizationContext.cs:line 33
   at Avalonia.Threading.JobRunner.Job.Avalonia.Threading.JobRunner.IJob.Run() in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 181
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1 priority) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 37
   at Avalonia.X11.X11PlatformThreading.CheckSignaled() in /_/src/Avalonia.X11/X11PlatformThreading.cs:line 164
   at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken) in /_/src/Avalonia.X11/X11PlatformThreading.cs:line 244
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken cancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 65
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 120
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 209
   at CarinaStudio.ULogViewer.App.Main(String[] args) in /Users/carina/Studio/ULogViewer/ULogViewer/App.axaml.cs:line 112
[1]    193408 IOT instruction (core dumped)  /opt/ulogviewer/ULogViewer

看报错信息似乎是因为默认字体为空导致的?

hamster620 commented 1 year ago

@zxp19821005 根據 https://github.com/AvaloniaUI/Avalonia/issues/4427 看起來是在 ArchLinux 上會出現的問題,我們會嘗試將預設字體內嵌以解決此問題,但應該會在 3.0 上修正。

zxp19821005 commented 1 year ago

好的,谢谢!

hamster620 commented 1 year ago

@zxp19821005 可以確認下 3.0.2.610 是否有修正此問題,謝謝。

zxp19821005 commented 1 year ago

似乎问题依旧?

$ /opt/ulogviewer/ULogViewer 
Unhandled exception. System.InvalidOperationException: Default font family name can't be null or empty.
   at Avalonia.Media.FontManager..ctor(IFontManagerImpl) in /_/src/Avalonia.Base/Media/FontManager.cs:line 33
   at Avalonia.Media.FontManager.get_Current() in /_/src/Avalonia.Base/Media/FontManager.cs:line 53
   at Avalonia.Media.Typeface.get_GlyphTypeface() in /_/src/Avalonia.Base/Media/Typeface.cs:line 84
   at Avalonia.Rendering.Composition.Server.ServerCompositionTarget..ctor(ServerCompositor, Func`1) in /_/src/Avalonia.Base/Rendering/Composition/Server/ServerCompositionTarget.cs:line 28
   at Avalonia.Rendering.Composition.Compositor.CreateCompositionTarget(Func`1) in /_/src/Avalonia.Base/Rendering/Composition/Compositor.Factories.cs:line 17
   at Avalonia.Rendering.Composition.CompositingRenderer..ctor(IRenderRoot, Compositor) in /_/src/Avalonia.Base/Rendering/Composition/CompositingRenderer.cs:line 47
   at Avalonia.X11.X11Window.CreateRenderer(IRenderRoot root) in /_/src/Avalonia.X11/X11Window.cs:line 394
   at Avalonia.Controls.TopLevel..ctor(ITopLevelImpl impl, IAvaloniaDependencyResolver dependencyResolver) in /_/src/Avalonia.Controls/TopLevel.cs:line 147
   at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl, IAvaloniaDependencyResolver dependencyResolver) in /_/src/Avalonia.Controls/WindowBase.cs:line 61
   at Avalonia.Controls.WindowBase..ctor(IWindowBaseImpl impl) in /_/src/Avalonia.Controls/WindowBase.cs:line 57
   at Avalonia.Controls.Window..ctor(IWindowImpl impl) in /_/src/Avalonia.Controls/Window.cs:line 230
   at Avalonia.Controls.Window..ctor() in /_/src/Avalonia.Controls/Window.cs:line 221
   at CarinaStudio.AppSuite.Controls.SplashWindowImpl..ctor()
   at CarinaStudio.AppSuite.AppSuiteApplication.OnPrepareStartingAsync()
   at CarinaStudio.ULogViewer.App.OnPrepareStartingAsync() in /Users/carina/Studio/ULogViewer/ULogViewer/App.axaml.cs:line 515
   at CarinaStudio.AppSuite.AppSuiteApplication.<>c__DisplayClass253_0.<<OnFrameworkInitializationCompleted>b__6>d.MoveNext()
--- End of stack trace from previous location ---
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_0(Object state)
   at Avalonia.Threading.JobRunner.JobWithArg.Avalonia.Threading.JobRunner.IJob.Run() in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 241
   at Avalonia.Threading.JobRunner.RunJobs(Nullable`1) in /_/src/Avalonia.Base/Threading/JobRunner.cs:line 38
   at Avalonia.X11.X11PlatformThreading.CheckSignaled() in /_/src/Avalonia.X11/X11PlatformThreading.cs:line 164
   at Avalonia.X11.X11PlatformThreading.RunLoop(CancellationToken cancellationToken) in /_/src/Avalonia.X11/X11PlatformThreading.cs:line 244
   at Avalonia.Threading.Dispatcher.MainLoop(CancellationToken) in /_/src/Avalonia.Base/Threading/Dispatcher.cs:line 61
   at Avalonia.Controls.ApplicationLifetimes.ClassicDesktopStyleApplicationLifetime.Start(String[] args) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 120
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime[T](T builder, String[] args, ShutdownMode shutdownMode) in /_/src/Avalonia.Controls/ApplicationLifetimes/ClassicDesktopStyleApplicationLifetime.cs:line 209
   at CarinaStudio.ULogViewer.App.Main(String[] args) in /Users/carina/Studio/ULogViewer/ULogViewer/App.axaml.cs:line 219
[1]    67837 IOT instruction (core dumped)  /opt/ulogviewer/ULogViewer
zxp19821005 commented 1 year ago

而且不知道咱们软件的配置文件在哪里?是否修改配置文件可以解决这个问题呢?我看了下~/.config目录,没有生成配置文件目录。 而且我是将文件安装到了/opt/ulogviewer/,本身读写就受限,默认应该是755(-rwxr-xr-x),前面在另外一款软件遇到过这个问题。 另,刚才看了下软件安装目录,部分dll的权限是744,但是大部分dll文件的权限是644。

hamster620 commented 1 year ago

ULogViewer 所有需要的文件都放在自身的目錄中 (即 /opt/ulogviewer/),相關的配置文件也沒有字型相關的。我這邊會直接在 Arch Linux ARM64 上看下這個問題。

hamster620 commented 1 year ago

@zxp19821005 3.0.3.620 修正了無法在非英語環境之 Linux 上啟動的問題。

zxp19821005 commented 1 year ago

已经能够正常运行了,谢谢!