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

More helpful error message for empty cpu_target in Base.julia_cmd #52217

Merged
merged 1 commit into from
Nov 27, 2023

Conversation

giordano
Copy link
Contributor

Fix #52209.

@giordano giordano added bugfix This change fixes an existing bug backport 1.10 Change should be backported to the 1.10 release labels Nov 17, 2023
@giordano giordano force-pushed the mg/empty-cpu-target branch from 2b3cc15 to f8650f7 Compare November 18, 2023 01:03
@ericphanson
Copy link
Contributor

We could also error if the string is empty. In my case that would’ve been preferable, because I was trying to set it but had messed up my docker ENVs and so it got set to the empty string. It would’ve been harder to track down my error if it seemed to work.

@staticfloat
Copy link
Member

I think we should error on -C ''.

@giordano
Copy link
Contributor Author

I mean, that's already the case now and precisely the cause of #52209.

@ericphanson
Copy link
Contributor

The problem is the error message is misleading. The error message should be clear and direct: “invalid CPU target: ””

@giordano giordano force-pushed the mg/empty-cpu-target branch 2 times, most recently from ce15f83 to cf7cdd2 Compare November 18, 2023 12:03
@giordano giordano changed the title Handle empty cpu_target in Base.julia_cmd More helpful error message for empty cpu_target in Base.julia_cmd Nov 18, 2023
@giordano
Copy link
Contributor Author

With latest version:

% JULIA_CPU_TARGET='' julia -q
(@v1.11) pkg> activate --temp
  Activating new project at `/var/folders/v2/hmy3kzgj4tb3xsy8qkltxd0r0000gn/T/jl_G2vx2I`

(jl_G2vx2I) pkg> add Example
   Resolving package versions...
    Updating `/private/var/folders/v2/hmy3kzgj4tb3xsy8qkltxd0r0000gn/T/jl_G2vx2I/Project.toml`
  [7876af07] + Example v0.5.3
    Updating `/private/var/folders/v2/hmy3kzgj4tb3xsy8qkltxd0r0000gn/T/jl_G2vx2I/Manifest.toml`
  [7876af07] + Example v0.5.3
Precompiling project...
  ✗ Example
  0 dependencies successfully precompiled in 0 seconds
  1 dependency errored.
  For a report of the errors see `julia> err`. To retry use `pkg> precompile`

julia> using Example
Precompiling Example
        Info Given Example was explicitly requested, output will be shown live
ERROR: Invalid target option: empty CPU name
  ✗ Example
  0 dependencies successfully precompiled in 0 seconds

ERROR: The following 1 direct dependency failed to precompile:

Example [7876af07-990d-54b4-ab0e-23690620f79a]

Failed to precompile Example [7876af07-990d-54b4-ab0e-23690620f79a] to "/Users/mose/.julia/compiled/v1.11/Example/jl_pewRlt".
ERROR: Invalid target option: empty CPU nam
Stacktrace:

I don't know why in the last line the error message is missing the last character, but I think this is unrelated to this PR.

@staticfloat staticfloat merged commit 4a18886 into JuliaLang:master Nov 27, 2023
7 checks passed
@giordano giordano deleted the mg/empty-cpu-target branch November 27, 2023 08:24
KristofferC pushed a commit that referenced this pull request Nov 27, 2023
@KristofferC KristofferC mentioned this pull request Nov 27, 2023
39 tasks
KristofferC added a commit that referenced this pull request Dec 2, 2023
Backported PRs:
- [x] #51213 <!-- Wait for other threads to finish compiling before
exiting -->
- [x] #51520 <!-- Make allocopt respect the GC verifier rules with non
usual address spaces -->
- [x] #51598 <!-- Use a simple error when reporting sysimg load
failures. -->
- [x] #51757 <!-- fix parallel peakflop usage -->
- [x] #51781 <!-- Don't make pkgimages global editable -->
- [x] #51848 <!-- allow finalizers to take any locks and yield during
exit -->
- [x] #51847 <!-- add missing wait during Timer and AsyncCondition close
-->
- [x] #50824 <!-- Add some aliasing warnings to docstrings for mutating
functions in Base -->
- [x] #51885 <!-- remove chmodding the pkgimages -->
- [x] #50207 <!-- [devdocs] Improve documentation about building
external forks of LLVM -->
- [x] #51967 <!-- further fix to the new promoting method for
AbstractDateTime subtraction -->
- [x] #51980 <!-- macroexpand: handle const/atomic struct fields
correctly -->
- [x] #51995 <!-- [Artifacts] Pass artifacts dictionary to
`ensure_artifact_installed` dispatch -->
- [x] #52098 <!-- Fix errors in `sort` docstring -->
- [x] #52136 <!-- Bump JuliaSyntax to 0.4.7 -->
- [x] #52140 <!-- Make c func `abspath` consistent on Windows. Fix
tracking path conversion. -->
- [x] #52009 <!-- fix completion that resulted in startpos of 0 for `\\
-->
- [x] #52192 <!-- cap the number of GC threads to number of cpu cores
-->
- [x] #52206 <!-- Make have_fma consistent between interpreter and
compiled -->
- [x] #52027 <!-- fix Unicode.julia_chartransform for Julia 1.10 -->
- [x] #52217 <!-- More helpful error message for empty `cpu_target` in
`Base.julia_cmd` -->
- [x] #51371 <!-- Memoize `cwstring` when used for env lookup /
modification on Windows -->
- [x] #52214 <!-- Turn Method Overwritten Error into a PrecompileError
-- turning off caching -->
- [x] #51895 <!-- Devdocs on fixing precompile hangs, take 2 -->
- [x] #51596 <!-- Reland "Don't mark nonlocal symbols as hidden"" -->
- [x] #51834 <!-- [REPLCompletions] allow symbol completions within
incomplete macrocall expression -->
- [x] #52010 <!-- Revert "Support sorting iterators (#46104)" -->
- [x] #51430 <!-- add support for async backtraces of Tasks on any
thread -->
- [x] #51471 <!-- Fix segfault if root task is NULL -->
- [x] #52194 <!-- Fix multiversioning issues caused by the parallel llvm
work -->
- [x] #51035 <!-- refactor GC scanning code to reflect jl_binding_t are
now first class -->
- [x] #52030 <!-- Bump Statistics -->
- [x] #52189 <!-- codegen: ensure i1 bool is widened to i8 before
storing -->
- [x] #52228 <!-- Widen diagonal var during `Type` unwrapping in
`instanceof_tfunc` -->
- [x] #52182 <!-- jitlayers: replace sharedbytes intern pool with one
that respects alignment -->

Contains multiple commits, manual intervention needed:
- [ ] #51092 <!-- inference: fix bad effects for recursion -->

Non-merged PRs with backport label:
- [ ] #52196 <!-- Fix creating custom log level macros -->
- [ ] #52170 <!-- fix invalidations related to `ismutable` -->
- [ ] #51479 <!-- prevent code loading from lookin in the versioned
environment when building Julia -->
@KristofferC KristofferC removed the backport 1.10 Change should be backported to the 1.10 release label Dec 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix This change fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing error if JULIA_CPU_TARGET=""
4 participants