Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rustc add_frameworks() not matching rlibs without build hashes #5033

Closed
bitonality opened this issue Apr 29, 2024 · 1 comment
Closed

Rustc add_frameworks() not matching rlibs without build hashes #5033

bitonality opened this issue Apr 29, 2024 · 1 comment
Labels
Milestone

Comments

@bitonality
Copy link
Contributor

Xmake Version

2.8.9

Operating System Version and Architecture

Ubuntu 22.04

Describe Bug

-- make the framework flag, crate module
function nf_framework(self, framework)
local basename = path.basename(framework)
local cratename = basename:match("lib(.-)%-.-") or basename:match("lib(.-)")
if cratename then
return {"--extern", cratename .. "=" .. framework}
end
end

When doing something like add_frameworks("/some/dir/libmydep.rlib"), rustc runs with --extern =/some/dir/libmydep.rlib.

add_frameworks("/some/dir/libmydep-asdf1234.rlib"), rustc runs with --extern mydep=/some/dir/libmydep-asdf1234.rlib (as expected)

Expected Behavior

I'd expect that add_frameworks("/some/dir/libmydep.rlib"), rustc runs with --extern mydep=/some/dir/libmydep.rlib.

Project Configuration

target("test_target")
    add_rules("rust")
    add_frameworks("src/libmydep.rlib")
    add_frameworks("src/libmydep-1234.rlib")

Additional Information and Error Logs

linkflags (rcld):
  -> --extern =src/libmydep.rlib --extern mydep=src/libmydep-1234.rlib --crate-type=bin
@bitonality bitonality added the bug label Apr 29, 2024
@waruqi
Copy link
Member

waruqi commented Apr 29, 2024

#5034

@waruqi waruqi closed this as completed Apr 29, 2024
@waruqi waruqi added this to the v2.9.2 milestone Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants