-
Notifications
You must be signed in to change notification settings - Fork 5k
[mono][tasks] Extract EmitWasmBundle into generic EmitBundle task and enable bundling in mono self-contained library #84191
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
Merged
Merged
Changes from all commits
Commits
Show all changes
115 commits
Select commit
Hold shift + click to select a range
1d4e246
[tasks] Move EmitWasmBundle out of wasm specific task
mdh1418 2955cdb
[tasks] Make EmitBundle more generic
mdh1418 2d25efc
[tasks] Generate EmitBundle task and replace invocations of old task
mdh1418 d8d97e8
Extend preloading assemblies with mono_assembly_open
mdh1418 eb5e396
[LibraryBuilder] Integrate bundling
mdh1418 a34c284
Refactor LibraryBuilder targets to isolate Bundling
mdh1418 c1924b2
[mono] Add mono_get_bundled_assembly in preparation for bundled runti…
mdh1418 9084234
[mono][librarymode] Bundle runtimeconfig.bin
mdh1418 382a93d
Address feedback
mdh1418 d4d4193
Consolidate runtimeconfig functions
mdh1418 e70e61a
[LibraryBuilder] Enable bundling by default
mdh1418 ecf5ffc
Merge branch 'main' into mono_library_mode_bundling
lewing fda389a
Merge remote-tracking branch 'upstream/main' into HEAD
mdh1418 791c743
Handle pdb bundling
mdh1418 d98c0a5
Default EmitBundle callback function to mono_add_bundled_resource
mdh1418 6fc54b1
Combine bundled resource types into generic bundled data
mdh1418 d7c09d0
Add api to free memory dynamically allocated for the bundled resource…
mdh1418 d1b5f02
Prepend enum and entries with mono
mdh1418 c0c443c
Move bundling api into separate source and header
mdh1418 7683ed1
Fix source file name
mdh1418 b1f3240
Prefix struct with Mono
mdh1418 ddf6691
Integrate new bundling api into mono debug
mdh1418 130aff3
Fix types in autoinit
mdh1418 b8177d0
[mono] Base bundling apis around preallocation of MonoBundled*Resourc…
mdh1418 60aa110
[mono] Clean up bundled assembly and satellite assembly search
mdh1418 ba241b5
[mono] Incorporate new bundling APIs into bundled resource retrievals
mdh1418 cfa60e5
[EmitBundle][task] Add templates for bundled source files
mdh1418 6fe9912
[EmitBundle] Enable consolidation of bundled resource symbols
mdh1418 077c020
[EmitBundle] Generate bundled source file to preallocate MonoBundled*…
mdh1418 1e7ad1c
[EmitBundle] Output symbol to resource type map for populating functi…
mdh1418 c5eb985
[LibraryBuilder] Generate source file to add preallocated MonoBundled…
mdh1418 d28ee4b
[LibraryBuilder] Incorporate EmitBundle templates into targets flow
mdh1418 a796bfb
[EmitBundle] Move bundle registration back into EmitBundle
mdh1418 364a119
Update invocations of EmitBundle task
mdh1418 7e48dc6
Merge remote-tracking branch 'upstream/main' into mono_library_mode_b…
mdh1418 46bd211
Address feedback
mdh1418 ddade81
[mono] Prefer C99 compliant types for partially exposed APIs
mdh1418 7c0081f
Address various fixups
mdh1418 39b5107
Combine preallocation registration and rename to templates
mdh1418 69af44c
Prefer symbol data over symfile
mdh1418 c3401df
Differentiate resource name and symbol
mdh1418 239c649
Update invocations of EmitBundle
mdh1418 ae088f2
Add inlined resource getters
mdh1418 233025a
Add unique id field for each MonoBundledResource
mdh1418 7f4258a
Include culture information for satellite resources
mdh1418 a632a73
Generate preallocation and registration source file iff BundleFile pr…
mdh1418 429fe75
Generate output itemgroup detailing resource data
mdh1418 5aeaef4
Leverage new bundling api from old bundling api and deprecate
mdh1418 ccd783b
[mono][debug] Migrate symbol data registration to new bundling api
mdh1418 3cf95fc
Remove symbol data from MonoBundleSatelliteAssemblyResource
mdh1418 5d265db
Directly determine resource type
mdh1418 3206aab
Update bundled header and switch to non internal types
mdh1418 a8c5d88
Update Autoinitialization logic to leverage bundled runtimeconfig sym…
mdh1418 fbe022e
Integrate header into bundled source
mdh1418 3390e90
Add functions to free allocated MonoBundledResources
mdh1418 e16e467
Fixup Leverage new bundling api from old bundling api and deprecate
mdh1418 684b667
Fixup Address various fixups
mdh1418 50fd4ba
Remove unnecessary includes
mdh1418 236539a
Fix trailing commas in structs and extra lines in generated files
mdh1418 df96a6d
Move specific bundled resource getters into source file
mdh1418 befa5d6
Various cleanups
mdh1418 c3bb50a
Cleanup logic surrounding EmitBundle task invocations
mdh1418 a060748
Rename output metadata to DataLenSymbol and DataLenSymbolValue
mdh1418 aff9c60
Simplify bundled resource hashtable insertion
mdh1418 c1e9ec1
Cleanup variable instantiation
mdh1418 aeaf879
Fixup mono-debug
mdh1418 a6b9245
Cleanup header
mdh1418 6c7d33d
fixup wasi
mdh1418 dfba3f4
fixup template format
mdh1418 e8aa970
Add flexibility to auto initialize runtime without bundled runtimeconfig
mdh1418 d191d59
Various fixups
mdh1418 afaf91a
Use g_free for memory allocated through glib apis
mdh1418 3eff6b9
Move condition end tag into LibraryBuilder to avoid empty line and cl…
mdh1418 7d3bebd
Add bundled resource getters to access data values without MonoBundle…
mdh1418 187855f
Emit one object file for single resource data source file mode
mdh1418 7cf6edd
Rename resource size symbol
mdh1418 8a78222
Use public friendly API in file linking towards runtime
mdh1418 f5ec428
Cleanup types populated through bundled resource getters
mdh1418 f309569
Move extern block completely to LibraryBuilder side
mdh1418 5001622
Update EmitBundle task invocations to use BundleRegistrationFunctionName
mdh1418 0b3b30d
Refactor EmitBundle to account for timezone duplicate resource contents
mdh1418 1803ede
Merge remote-tracking branch 'upstream/main' into mono_library_mode_b…
mdh1418 2af674d
wip
mdh1418 4541530
wip
mdh1418 204cae7
WIP
mdh1418 a77c39c
[mono] Alias assemblies with known extension in bundled resources has…
mdh1418 ec2570d
[tasks] Calculate destination files within EmitBundle task itself
mdh1418 4ba29ad
Update invocations of EmitBundle to grab DestinationFiles from output
mdh1418 9e5e42f
Guard webcil specific logic
mdh1418 d0fafb6
Include OutputDirectory path into output destinationFiles
mdh1418 5dad711
Fix debugger tests and memory leak
mdh1418 51637a3
Various fixups and Documentation
mdh1418 0e33442
Try adding resources with known assembly extensions as dll
mdh1418 37b1c82
Revert to custom hash and equal without WEBCIL guard
mdh1418 88f90d4
Consolidate file and bundledResource variables
mdh1418 e4c6ef6
Add culture metadata to SatelliteAssembly resources
mdh1418 dbe7c21
Truncate Encoding for readability
mdh1418 8705c97
Enable custom hash for bundling resources on wasm
mdh1418 4071c10
Leverage new bundling api for wasm wasi drivers
mdh1418 a573583
Add helper to dynamically add bundled assembly and satellite_assembly…
mdh1418 7d1a6bd
Limit when bundled resources can be added and freed
mdh1418 58eeb95
Restrict MonoBundledResource getters
mdh1418 4e568b1
Restrict exposure of underlying MonoBundledAssemblyResource modification
mdh1418 b755fc7
WIP
mdh1418 e34aff7
Free function chaining.
lateralusX 854c5ec
Fix crash when output parameters are NULL.
lateralusX 4379c37
Fix WASM/WASI build errors.
lateralusX 59ba150
Align bundled resources registration struct
mdh1418 102c47d
Merge remote-tracking branch 'upstream/main' into mono_library_mode_b…
mdh1418 560491a
[task] Check PE metadata to determine resource type
mdh1418 5e41b81
Cleanup Satellite Assembly bundling
mdh1418 18afeda
Address Feedback
mdh1418 c2c69ab
Split MonoBundledAssemblyResource getter
mdh1418 45d2f8b
Addressing more feedback
mdh1418 b377ff4
Validate OutputDirectory
mdh1418 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
// Licensed to the .NET Foundation under one or more agreements. | ||
mdh1418 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// The .NET Foundation licenses this file to you under the MIT license. | ||
// | ||
|
||
#ifndef __MONO_METADATA_BUNDLED_RESOURCES_INTERNALS_H__ | ||
#define __MONO_METADATA_BUNDLED_RESOURCES_INTERNALS_H__ | ||
|
||
#include <stdbool.h> | ||
#include <stdint.h> | ||
|
||
typedef enum { | ||
MONO_BUNDLED_DATA, | ||
MONO_BUNDLED_ASSEMBLY, | ||
MONO_BUNDLED_SATELLITE_ASSEMBLY, | ||
MONO_BUNDLED_RESOURCE_COUNT | ||
} MonoBundledResourceType; | ||
|
||
typedef void (*free_bundled_resource_func)(void *, void*); | ||
|
||
typedef struct _MonoBundledResource { | ||
MonoBundledResourceType type; | ||
const char *id; | ||
free_bundled_resource_func free_func; | ||
void *free_data; | ||
} MonoBundledResource; | ||
|
||
typedef struct _MonoBundledData { | ||
const char *name; | ||
const uint8_t *data; | ||
uint32_t size; | ||
} MonoBundledData; | ||
|
||
typedef struct _MonoBundledDataResource { | ||
MonoBundledResource resource; | ||
MonoBundledData data; | ||
} MonoBundledDataResource; | ||
|
||
typedef struct _MonoBundledSymbolData { | ||
const uint8_t *data; | ||
uint32_t size; | ||
} MonoBundledSymbolData; | ||
|
||
typedef struct _MonoBundledAssemblyData { | ||
const char *name; | ||
const uint8_t *data; | ||
uint32_t size; | ||
} MonoBundledAssemblyData; | ||
|
||
typedef struct _MonoBundledAssemblyResource { | ||
MonoBundledResource resource; | ||
MonoBundledAssemblyData assembly; | ||
MonoBundledSymbolData symbol_data; | ||
} MonoBundledAssemblyResource; | ||
|
||
typedef struct _MonoBundledSatelliteAssemblyData { | ||
const char *name; | ||
const char *culture; | ||
const uint8_t *data; | ||
uint32_t size; | ||
} MonoBundledSatelliteAssemblyData; | ||
|
||
typedef struct _MonoBundledSatelliteAssemblyResource { | ||
MonoBundledResource resource; | ||
MonoBundledSatelliteAssemblyData satellite_assembly; | ||
} MonoBundledSatelliteAssemblyResource; | ||
|
||
void | ||
mono_bundled_resources_free (void); | ||
mdh1418 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
void | ||
mono_bundled_resources_add (MonoBundledResource **resources_to_bundle, uint32_t len); | ||
|
||
bool | ||
mono_bundled_resources_get_assembly_resource_values (const char *id, const uint8_t **data_out, uint32_t *size_out); | ||
|
||
bool | ||
mono_bundled_resources_get_assembly_resource_symbol_values (const char *id, const uint8_t **symbol_data_out, uint32_t *symbol_size_out); | ||
|
||
bool | ||
mono_bundled_resources_get_satellite_assembly_resource_values (const char *id, const uint8_t **data_out, uint32_t *size_out); | ||
|
||
bool | ||
mono_bundled_resources_get_data_resource_values (const char *id, const uint8_t **data_out, uint32_t *size_out); | ||
|
||
void | ||
mono_bundled_resources_add_assembly_resource (const char *id, const char *name, const uint8_t *data, uint32_t size, free_bundled_resource_func free_func, void *free_data); | ||
|
||
void | ||
mono_bundled_resources_add_assembly_symbol_resource (const char *id, const uint8_t *data, uint32_t size, free_bundled_resource_func free_func, void *free_data); | ||
|
||
void | ||
mono_bundled_resources_add_satellite_assembly_resource (const char *id, const char *name, const char *culture, const uint8_t *data, uint32_t size, free_bundled_resource_func free_func, void *free_data); | ||
|
||
void | ||
mono_bundled_resources_add_data_resource (const char *id, const char *name, const uint8_t *data, uint32_t size, free_bundled_resource_func free_func, void *free_data); | ||
|
||
bool | ||
mono_bundled_resources_contains_assemblies (void); | ||
|
||
bool | ||
mono_bundled_resources_contains_satellite_assemblies (void); | ||
|
||
#endif /* __MONO_METADATA_BUNDLED_RESOURCES_INTERNALS_H__ */ |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.